Skip to content

Cleanup/1886 cleanup global space in prim tests, replace pull_msg with expect_throw_msg #1947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7f3a1ea
cleanup pull_msg from gp_ tests
rok-cesnovar May 17, 2020
68eea50
Merge remote-tracking branch 'origin/develop' into cleanup/1886-test-…
rok-cesnovar Jun 22, 2020
ea9a8f5
cleaned up prim/functor
rok-cesnovar Jun 22, 2020
85945d6
cleaned up prim/meta
rok-cesnovar Jun 22, 2020
8e11862
cleaned up prim/err
rok-cesnovar Jun 22, 2020
c5335a9
cleaned up prim/prob
rok-cesnovar Jun 22, 2020
73a09a8
cleaned up prim/fun
rok-cesnovar Jun 22, 2020
9554327
log mix test
rok-cesnovar Jun 22, 2020
8e54edc
Merge commit 'de6e454a7db5854c413dbb943a5a4f056d9085ec' into HEAD
yashikno Jun 22, 2020
d2bf577
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jun 22, 2020
cc0a815
Merge remote-tracking branch 'origin/develop' into cleanup/1886-test-…
rok-cesnovar Jun 23, 2020
5c7cc03
fix namespace errors
rok-cesnovar Jun 23, 2020
3dff203
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jun 23, 2020
b00d550
mising namespace
rok-cesnovar Jun 23, 2020
2e4066c
namespace fix
rok-cesnovar Jun 23, 2020
62ab0c6
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jun 23, 2020
ad9a559
jumbo init
rok-cesnovar Jun 23, 2020
eb2623f
fix namespace use in log_mix
rok-cesnovar Jun 23, 2020
2e3f863
more fix tests
rok-cesnovar Jun 23, 2020
609c7a6
Merge branch 'jumbotests' into cleanup/1886-test-util-cleanup-part2
rok-cesnovar Jun 23, 2020
3f7c339
add jumbo
rok-cesnovar Jun 23, 2020
3035dcd
missing namespace in categorical test
rok-cesnovar Jun 23, 2020
3ed6342
fix eigen namespace
rok-cesnovar Jun 23, 2020
f3af9d0
fix missing Eigen
rok-cesnovar Jun 23, 2020
6aae15b
add header guards
rok-cesnovar Jun 23, 2020
87770b4
cleanup global namespace
rok-cesnovar Jun 23, 2020
8f584bc
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jun 23, 2020
7866ca9
Revert "Merge branch 'jumbotests' into cleanup/1886-test-util-cleanup…
rok-cesnovar Jun 23, 2020
d3f7fb6
Revert "add jumbo"
rok-cesnovar Jun 23, 2020
6fe1529
include prim/fun/eigen in utils
rok-cesnovar Jun 23, 2020
34c24f1
dont test exact message for multiple bad args
rok-cesnovar Jul 2, 2020
8c57e24
replace correct_type_* with expect_type_*
rok-cesnovar Jul 2, 2020
5ec9ef3
Merge commit '844c61f6a2b7c5faf21f72084849557206998d99' into HEAD
yashikno Jul 2, 2020
bdbd7f7
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 2, 2020
29592cf
more exact message tests for multiple bad args removed
rok-cesnovar Jul 2, 2020
63b873e
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def generateTests(j):
else:
doCommand('make -j%d generate-tests -s' % (j or 1))


def makeTest(name, j):
"""Run the make command for a given single test."""
if isWin():
Expand Down
3 changes: 1 addition & 2 deletions test/unit/math/prim/err/check_2F1_converges_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#include <gtest/gtest.h>
#include <limits>

using stan::math::check_2F1_converges;

TEST(passesOnConvergentArgs, Check2F1Converges) {
using stan::math::check_2F1_converges;
const char* function = "check_2F1_converges";
double a1 = 1.0;
double a2 = 1.0;
Expand Down
3 changes: 1 addition & 2 deletions test/unit/math/prim/err/check_3F2_converges_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#include <gtest/gtest.h>
#include <limits>

using stan::math::check_3F2_converges;

TEST(passesOnConvergentArgs, Check3F2Converges) {
using stan::math::check_3F2_converges;
const char* function = "check_3F2_converges";
double a1 = 1.0;
double a2 = 1.0;
Expand Down
7 changes: 5 additions & 2 deletions test/unit/math/prim/err/check_bounded_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#include <gtest/gtest.h>
#include <limits>

using stan::math::check_bounded;

TEST(ErrorHandlingScalar, CheckBounded_x) {
using stan::math::check_bounded;
const char* function = "check_bounded";
const char* name = "x";
double x = 0;
Expand Down Expand Up @@ -51,6 +50,7 @@ TEST(ErrorHandlingScalar, CheckBounded_x) {
<< ", " << low;
}
TEST(ErrorHandlingScalar, CheckBounded_Low) {
using stan::math::check_bounded;
const char* function = "check_bounded";
const char* name = "x";
double x = 0;
Expand All @@ -77,6 +77,7 @@ TEST(ErrorHandlingScalar, CheckBounded_Low) {
<< ", " << high;
}
TEST(ErrorHandlingScalar, CheckBounded_High) {
using stan::math::check_bounded;
const char* function = "check_bounded";
const char* name = "x";
double x = 0;
Expand All @@ -103,6 +104,7 @@ TEST(ErrorHandlingScalar, CheckBounded_High) {
<< ", " << high;
}
TEST(ErrorHandlingScalar, CheckBounded_nan) {
using stan::math::check_bounded;
double nan = std::numeric_limits<double>::quiet_NaN();

const char* function = "check_bounded";
Expand All @@ -123,6 +125,7 @@ TEST(ErrorHandlingScalar, CheckBounded_nan) {
}

TEST(ErrorHandlingScalar, CheckBounded_size_zero_vector) {
using stan::math::check_bounded;
const char* function = "check_bounded";
const char* name = "x";
double x = 0;
Expand Down
5 changes: 3 additions & 2 deletions test/unit/math/prim/err/check_corr_matrix_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#include <limits>
#include <string>

using stan::math::check_corr_matrix;

TEST(ErrorHandlingMatrix, CheckCorrMatrix) {
using stan::math::check_corr_matrix;
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> y;
y.resize(2, 2);

Expand All @@ -17,6 +16,7 @@ TEST(ErrorHandlingMatrix, CheckCorrMatrix) {
}

TEST(ErrorHandlingMatrix, CheckCorrMatrix_one_indexed_message) {
using stan::math::check_corr_matrix;
std::string message;
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> y;
y.resize(2, 2);
Expand All @@ -37,6 +37,7 @@ TEST(ErrorHandlingMatrix, CheckCorrMatrix_one_indexed_message) {
}

TEST(ErrorHandlingMatrix, CheckCorrMatrix_nan) {
using stan::math::check_corr_matrix;
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> y;
y.resize(2, 2);
double nan = std::numeric_limits<double>::quiet_NaN();
Expand Down
11 changes: 7 additions & 4 deletions test/unit/math/prim/err/check_finite_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
#include <string>
#include <vector>

using stan::math::check_finite;

// ---------- check_finite: vector tests ----------
TEST(ErrorHandlingArr, CheckFinite_Vector) {
using stan::math::check_finite;
const char* function = "check_finite";
std::vector<double> x = {-1, 0, 1};
ASSERT_NO_THROW(check_finite(function, "x", x))
Expand All @@ -27,6 +25,7 @@ TEST(ErrorHandlingArr, CheckFinite_Vector) {
}

TEST(ErrorHandlingArr, CheckFinite_nan) {
using stan::math::check_finite;
const char* function = "check_finite";
double nan = std::numeric_limits<double>::quiet_NaN();

Expand All @@ -40,8 +39,8 @@ TEST(ErrorHandlingArr, CheckFinite_nan) {
EXPECT_THROW(check_finite(function, "x", x), std::domain_error);
}

// ---------- check_finite: matrix tests ----------
TEST(ErrorHandlingMat, CheckFinite_Matrix) {
using stan::math::check_finite;
const char* function = "check_finite";
Eigen::Matrix<double, Eigen::Dynamic, 1> x;

Expand All @@ -67,6 +66,7 @@ TEST(ErrorHandlingMat, CheckFinite_Matrix) {
}

TEST(ErrorHandlingMat, CheckFinite_Matrix_one_indexed_message) {
using stan::math::check_finite;
const char* function = "check_finite";
Eigen::Matrix<double, Eigen::Dynamic, 1> x;
std::string message;
Expand All @@ -86,6 +86,7 @@ TEST(ErrorHandlingMat, CheckFinite_Matrix_one_indexed_message) {
}

TEST(ErrorHandlingMat, CheckFinite_nan) {
using stan::math::check_finite;
const char* function = "check_finite";
double nan = std::numeric_limits<double>::quiet_NaN();

Expand All @@ -101,6 +102,7 @@ TEST(ErrorHandlingMat, CheckFinite_nan) {
}

TEST(ErrorHandlingScalar, CheckFinite) {
using stan::math::check_finite;
const char* function = "check_finite";
double x = 0;

Expand All @@ -119,6 +121,7 @@ TEST(ErrorHandlingScalar, CheckFinite) {
}

TEST(ErrorHandlingScalar, CheckFinite_nan) {
using stan::math::check_finite;
const char* function = "check_finite";
double nan = std::numeric_limits<double>::quiet_NaN();

Expand Down
7 changes: 5 additions & 2 deletions test/unit/math/prim/err/check_greater_or_equal_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#include <limits>
#include <string>

using stan::math::check_greater_or_equal;

TEST(ErrorHandlingMat, CheckGreaterOrEqualMatrix) {
using stan::math::check_greater_or_equal;
const char* function = "check_greater_or_equal";
double x;
double low;
Expand Down Expand Up @@ -120,6 +119,7 @@ TEST(ErrorHandlingMat, CheckGreaterOrEqualMatrix) {
}

TEST(ErrorHandlingMat, CheckGreaterOrEqual_Matrix_one_indexed_message) {
using stan::math::check_greater_or_equal;
const char* function = "check_greater_or_equal";
double x;
double low;
Expand Down Expand Up @@ -178,6 +178,7 @@ TEST(ErrorHandlingMat, CheckGreaterOrEqual_Matrix_one_indexed_message) {
}

TEST(ErrorHandlingMat, CheckGreaterOrEqual_nan) {
using stan::math::check_greater_or_equal;
const char* function = "check_greater_or_equal";
double nan = std::numeric_limits<double>::quiet_NaN();

Expand Down Expand Up @@ -218,6 +219,7 @@ TEST(ErrorHandlingMat, CheckGreaterOrEqual_nan) {
}

TEST(ErrorHandlingScalar, CheckGreaterOrEqual) {
using stan::math::check_greater_or_equal;
const char* function = "check_greater_or_equal";
double x = 10.0;
double lb = 0.0;
Expand Down Expand Up @@ -250,6 +252,7 @@ TEST(ErrorHandlingScalar, CheckGreaterOrEqual) {
}

TEST(ErrorHandlingScalar, CheckGreaterOrEqual_nan) {
using stan::math::check_greater_or_equal;
const char* function = "check_greater_or_equal";
double x = 10.0;
double lb = 0.0;
Expand Down
7 changes: 5 additions & 2 deletions test/unit/math/prim/err/check_greater_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#include <limits>
#include <string>

using stan::math::check_greater;

TEST(ErrorHandlingMat, CheckGreater_Matrix) {
using stan::math::check_greater;
const char* function = "check_greater";
double x;
double low;
Expand Down Expand Up @@ -110,6 +109,7 @@ TEST(ErrorHandlingMat, CheckGreater_Matrix) {
}

TEST(ErrorHandlingMat, CheckGreater_Matrix_one_indexed_message) {
using stan::math::check_greater;
const char* function = "check_greater";
double x;
double low;
Expand Down Expand Up @@ -168,6 +168,7 @@ TEST(ErrorHandlingMat, CheckGreater_Matrix_one_indexed_message) {
}

TEST(ErrorHandlingMat, CheckGreater_nan) {
using stan::math::check_greater;
const char* function = "check_greater";
double x = 10.0;
double lb = 0.0;
Expand All @@ -179,6 +180,7 @@ TEST(ErrorHandlingMat, CheckGreater_nan) {
}

TEST(ErrorHandlingScalar, CheckGreater) {
using stan::math::check_greater;
const char* function = "check_greater";
double x = 10.0;
double lb = 0.0;
Expand Down Expand Up @@ -210,6 +212,7 @@ TEST(ErrorHandlingScalar, CheckGreater) {
}

TEST(ErrorHandlingScalar, CheckGreater_nan) {
using stan::math::check_greater;
const char* function = "check_greater";
double x = 10.0;
double lb = 0.0;
Expand Down
7 changes: 5 additions & 2 deletions test/unit/math/prim/err/check_less_or_equal_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#include <limits>
#include <string>

using stan::math::check_less_or_equal;

TEST(ErrorHandlingMat, CheckLessOrEqual_Matrix) {
using stan::math::check_less_or_equal;
const char* function = "check_less_or_equal";
double x;
double high;
Expand Down Expand Up @@ -84,6 +83,7 @@ TEST(ErrorHandlingMat, CheckLessOrEqual_Matrix) {
}

TEST(ErrorHandlingMat, CheckLessOrEqual_Matrix_one_indexed_message) {
using stan::math::check_less_or_equal;
const char* function = "check_less";
double x;
double high;
Expand Down Expand Up @@ -142,6 +142,7 @@ TEST(ErrorHandlingMat, CheckLessOrEqual_Matrix_one_indexed_message) {
}

TEST(ErrorHandlingMat, CheckLessOrEqual_nan) {
using stan::math::check_less_or_equal;
const char* function = "check_less_or_equal";
double nan = std::numeric_limits<double>::quiet_NaN();
Eigen::Matrix<double, Eigen::Dynamic, 1> x_vec(3);
Expand Down Expand Up @@ -181,6 +182,7 @@ TEST(ErrorHandlingMat, CheckLessOrEqual_nan) {
}

TEST(ErrorHandlingScalar, CheckLessOrEqual) {
using stan::math::check_less_or_equal;
const char* function = "check_less_or_equal";
double x = -10.0;
double lb = 0.0;
Expand Down Expand Up @@ -213,6 +215,7 @@ TEST(ErrorHandlingScalar, CheckLessOrEqual) {
}

TEST(ErrorHandlingScalar, CheckLessOrEqual_nan) {
using stan::math::check_less_or_equal;
const char* function = "check_less_or_equal";
double x = 10.0;
double lb = 0.0;
Expand Down
7 changes: 5 additions & 2 deletions test/unit/math/prim/err/check_less_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#include <limits>
#include <string>

using stan::math::check_less;

TEST(ErrorHandlingMat, CheckLess_Matrix) {
using stan::math::check_less;
const char* function = "check_less";
double x;
double high;
Expand Down Expand Up @@ -81,6 +80,7 @@ TEST(ErrorHandlingMat, CheckLess_Matrix) {
}

TEST(ErrorHandlingMat, CheckLess_Matrix_one_indexed_message) {
using stan::math::check_less;
const char* function = "check_less";
double x;
double high;
Expand Down Expand Up @@ -139,6 +139,7 @@ TEST(ErrorHandlingMat, CheckLess_Matrix_one_indexed_message) {
}

TEST(ErrorHandlingMat, CheckLess_nan) {
using stan::math::check_less;
const char* function = "check_less";
double nan = std::numeric_limits<double>::quiet_NaN();

Expand Down Expand Up @@ -176,6 +177,7 @@ TEST(ErrorHandlingMat, CheckLess_nan) {
}

TEST(ErrorHandlingScalar, CheckLess) {
using stan::math::check_less;
const char* function = "check_less";
double x = -10.0;
double lb = 0.0;
Expand Down Expand Up @@ -207,6 +209,7 @@ TEST(ErrorHandlingScalar, CheckLess) {
}

TEST(ErrorHandlingScalar, CheckLess_nan) {
using stan::math::check_less;
const char* function = "check_less";
double x = 10.0;
double lb = 0.0;
Expand Down
7 changes: 5 additions & 2 deletions test/unit/math/prim/err/check_nonnegative_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
#include <limits>
#include <string>

using stan::math::check_nonnegative;

TEST(ErrorHandlingArr, CheckNonnegativeVectorized) {
using stan::math::check_nonnegative;
int N = 5;
const char* function = "check_nonnegative";
std::vector<double> x(N);
Expand Down Expand Up @@ -34,6 +33,7 @@ TEST(ErrorHandlingArr, CheckNonnegativeVectorized) {
}

TEST(ErrorHandlingArr, CheckNonnegativeVectorized_one_indexed_message) {
using stan::math::check_nonnegative;
int N = 5;
const char* function = "check_nonnegative";
std::vector<double> x(N);
Expand All @@ -54,6 +54,7 @@ TEST(ErrorHandlingArr, CheckNonnegativeVectorized_one_indexed_message) {
}

TEST(ErrorHandlingArr, CheckNonnegative_nan) {
using stan::math::check_nonnegative;
const char* function = "check_nonnegative";
double nan = std::numeric_limits<double>::quiet_NaN();

Expand All @@ -67,6 +68,7 @@ TEST(ErrorHandlingArr, CheckNonnegative_nan) {
}

TEST(ErrorHandlingScalar, CheckNonnegative) {
using stan::math::check_nonnegative;
const char* function = "check_nonnegative";
double x = 0;

Expand All @@ -91,6 +93,7 @@ TEST(ErrorHandlingScalar, CheckNonnegative) {
}

TEST(ErrorHandlingScalar, CheckNonnegative_nan) {
using stan::math::check_nonnegative;
const char* function = "check_nonnegative";
double nan = std::numeric_limits<double>::quiet_NaN();

Expand Down
Loading