diff options
author | Gael Guennebaud <g.gael@free.fr> | 2018-07-17 14:46:15 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2018-07-17 14:46:15 +0200 |
commit | 82f0ce27261df3b21037d93d4595655b3df754a6 (patch) | |
tree | aa62ebfceb605052be0cc3c4456852dfecef7fda /test | |
parent | 37f4bdd97df454f2c85c6047d190f5db21c3a09b (diff) |
Get rid of EIGEN_TEST_FUNC, unit tests must now be declared with EIGEN_DECLARE_TEST(mytest) { /* code */ }.
This provide several advantages:
- more flexibility in designing unit tests
- unit tests can be glued to speed up compilation
- unit tests are compiled with same predefined macros, which is a requirement for zapcc
Diffstat (limited to 'test')
138 files changed, 185 insertions, 159 deletions
diff --git a/test/adjoint.cpp b/test/adjoint.cpp index 37032d220..ca44466b2 100644 --- a/test/adjoint.cpp +++ b/test/adjoint.cpp @@ -145,7 +145,7 @@ template<typename MatrixType> void adjoint(const MatrixType& m) VERIFY_IS_APPROX(rv1.template cast<Scalar>().dot(v1), rv1.dot(v1)); } -void test_adjoint() +EIGEN_DECLARE_TEST(adjoint) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( adjoint(Matrix<float, 1, 1>()) ); diff --git a/test/array.cpp b/test/array.cpp index 7e228ed54..c01653668 100644 --- a/test/array.cpp +++ b/test/array.cpp @@ -449,7 +449,7 @@ template<typename ArrayType> void min_max(const ArrayType& m) } -void test_array() +EIGEN_DECLARE_TEST(array) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( array(Array<float, 1, 1>()) ); diff --git a/test/array_for_matrix.cpp b/test/array_for_matrix.cpp index 3dc5dc487..6b03abb10 100644 --- a/test/array_for_matrix.cpp +++ b/test/array_for_matrix.cpp @@ -256,7 +256,7 @@ void regrrssion_bug_1410() VERIFY((internal::traits<MatrixWrapper<Array4i> >::Flags&LvalueBit)==LvalueBit); } -void test_array_for_matrix() +EIGEN_DECLARE_TEST(array_for_matrix) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( array_for_matrix(Matrix<float, 1, 1>()) ); diff --git a/test/array_of_string.cpp b/test/array_of_string.cpp index e23b7c59e..23e51529b 100644 --- a/test/array_of_string.cpp +++ b/test/array_of_string.cpp @@ -9,7 +9,7 @@ #include "main.h" -void test_array_of_string() +EIGEN_DECLARE_TEST(array_of_string) { typedef Array<std::string,1,Dynamic> ArrayXs; ArrayXs a1(3), a2(3), a3(3), a3ref(3); diff --git a/test/array_replicate.cpp b/test/array_replicate.cpp index 0dad5bace..057c3c77b 100644 --- a/test/array_replicate.cpp +++ b/test/array_replicate.cpp @@ -68,7 +68,7 @@ template<typename MatrixType> void replicate(const MatrixType& m) VERIFY_IS_APPROX(vx1, v1.colwise().replicate(f2)); } -void test_array_replicate() +EIGEN_DECLARE_TEST(array_replicate) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( replicate(Matrix<float, 1, 1>()) ); diff --git a/test/array_reverse.cpp b/test/array_reverse.cpp index 9d5b9a66d..317b9a6e2 100644 --- a/test/array_reverse.cpp +++ b/test/array_reverse.cpp @@ -123,7 +123,7 @@ template<typename MatrixType> void reverse(const MatrixType& m) VERIFY_IS_APPROX(x, m1(r, cols - 1 - c)); } -void test_array_reverse() +EIGEN_DECLARE_TEST(array_reverse) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( reverse(Matrix<float, 1, 1>()) ); diff --git a/test/bandmatrix.cpp b/test/bandmatrix.cpp index f8c38f7c3..66a1b0db4 100644 --- a/test/bandmatrix.cpp +++ b/test/bandmatrix.cpp @@ -59,7 +59,7 @@ template<typename MatrixType> void bandmatrix(const MatrixType& _m) using Eigen::internal::BandMatrix; -void test_bandmatrix() +EIGEN_DECLARE_TEST(bandmatrix) { for(int i = 0; i < 10*g_repeat ; i++) { Index rows = internal::random<Index>(1,10); diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 0fbeb42eb..5ad4090cd 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -268,7 +268,7 @@ void fixedSizeMatrixConstruction() } } -void test_basicstuff() +EIGEN_DECLARE_TEST(basicstuff) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( basicStuff(Matrix<float, 1, 1>()) ); diff --git a/test/bdcsvd.cpp b/test/bdcsvd.cpp index 109218766..3065ff015 100644 --- a/test/bdcsvd.cpp +++ b/test/bdcsvd.cpp @@ -62,7 +62,7 @@ void compare_bdc_jacobi(const MatrixType& a = MatrixType(), unsigned int computa if(computationOptions & ComputeThinV) VERIFY_IS_APPROX(bdc_svd.matrixV(), jacobi_svd.matrixV()); } -void test_bdcsvd() +EIGEN_DECLARE_TEST(bdcsvd) { CALL_SUBTEST_3(( svd_verify_assert<BDCSVD<Matrix3f> >(Matrix3f()) )); CALL_SUBTEST_4(( svd_verify_assert<BDCSVD<Matrix4d> >(Matrix4d()) )); diff --git a/test/bicgstab.cpp b/test/bicgstab.cpp index 4cc0dd31c..89d6a45ef 100644 --- a/test/bicgstab.cpp +++ b/test/bicgstab.cpp @@ -26,7 +26,7 @@ template<typename T, typename I> void test_bicgstab_T() //CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_ssor) ); } -void test_bicgstab() +EIGEN_DECLARE_TEST(bicgstab) { CALL_SUBTEST_1((test_bicgstab_T<double,int>()) ); CALL_SUBTEST_2((test_bicgstab_T<std::complex<double>, int>())); diff --git a/test/block.cpp b/test/block.cpp index a45dd501d..ca13539a9 100644 --- a/test/block.cpp +++ b/test/block.cpp @@ -276,7 +276,7 @@ void data_and_stride(const MatrixType& m) compare_using_data_and_stride(m1.col(c1).transpose()); } -void test_block() +EIGEN_DECLARE_TEST(block) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( block(Matrix<float, 1, 1>()) ); diff --git a/test/boostmultiprec.cpp b/test/boostmultiprec.cpp index bafbd3b96..1588eb86d 100644 --- a/test/boostmultiprec.cpp +++ b/test/boostmultiprec.cpp @@ -145,7 +145,7 @@ namespace Eigen { } -void test_boostmultiprec() +EIGEN_DECLARE_TEST(boostmultiprec) { typedef Matrix<Real,Dynamic,Dynamic> Mat; typedef Matrix<std::complex<Real>,Dynamic,Dynamic> MatC; diff --git a/test/cholesky.cpp b/test/cholesky.cpp index 62c391de4..b871351e0 100644 --- a/test/cholesky.cpp +++ b/test/cholesky.cpp @@ -488,7 +488,7 @@ template<typename MatrixType> void cholesky_verify_assert() VERIFY_RAISES_ASSERT(ldlt.solveInPlace(&tmp)) } -void test_cholesky() +EIGEN_DECLARE_TEST(cholesky) { int s = 0; for(int i = 0; i < g_repeat; i++) { diff --git a/test/cholmod_support.cpp b/test/cholmod_support.cpp index 931207334..89b9cf41e 100644 --- a/test/cholmod_support.cpp +++ b/test/cholmod_support.cpp @@ -55,7 +55,7 @@ template<typename T, int flags, typename IdxType> void test_cholmod_T() test_cholmod_ST<SparseMatrix<T, flags, IdxType> >(); } -void test_cholmod_support() +EIGEN_DECLARE_TEST(cholmod_support) { CALL_SUBTEST_11( (test_cholmod_T<double , ColMajor, int >()) ); CALL_SUBTEST_12( (test_cholmod_T<double , ColMajor, long>()) ); diff --git a/test/commainitializer.cpp b/test/commainitializer.cpp index 9844adbd2..3cb94da62 100644 --- a/test/commainitializer.cpp +++ b/test/commainitializer.cpp @@ -65,7 +65,7 @@ struct test_block_recursion<-1> static void run() { } }; -void test_commainitializer() +EIGEN_DECLARE_TEST(commainitializer) { Matrix3d m3; Matrix4d m4; diff --git a/test/conjugate_gradient.cpp b/test/conjugate_gradient.cpp index 9622fd86d..47a4ca707 100644 --- a/test/conjugate_gradient.cpp +++ b/test/conjugate_gradient.cpp @@ -26,7 +26,7 @@ template<typename T, typename I> void test_conjugate_gradient_T() CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_upper_I) ); } -void test_conjugate_gradient() +EIGEN_DECLARE_TEST(conjugate_gradient) { CALL_SUBTEST_1(( test_conjugate_gradient_T<double,int>() )); CALL_SUBTEST_2(( test_conjugate_gradient_T<std::complex<double>, int>() )); diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp index 21a1db4ac..d3d0a5a31 100644 --- a/test/conservative_resize.cpp +++ b/test/conservative_resize.cpp @@ -109,7 +109,7 @@ void run_vector_tests() } } -void test_conservative_resize() +EIGEN_DECLARE_TEST(conservative_resize) { for(int i=0; i<g_repeat; ++i) { diff --git a/test/constructor.cpp b/test/constructor.cpp index eec9e2192..1dd3bc3c0 100644 --- a/test/constructor.cpp +++ b/test/constructor.cpp @@ -37,7 +37,7 @@ template<typename MatrixType> void ctor_init1(const MatrixType& m) } -void test_constructor() +EIGEN_DECLARE_TEST(constructor) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( ctor_init1(Matrix<float, 1, 1>()) ); diff --git a/test/corners.cpp b/test/corners.cpp index 32edadb25..73342a8dd 100644 --- a/test/corners.cpp +++ b/test/corners.cpp @@ -101,7 +101,7 @@ template<typename MatrixType, int CRows, int CCols, int SRows, int SCols> void c VERIFY_IS_EQUAL((const_matrix.template rightCols<c>()), (const_matrix.template block<rows,c>(0,cols-c))); } -void test_corners() +EIGEN_DECLARE_TEST(corners) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( corners(Matrix<float, 1, 1>()) ); diff --git a/test/ctorleak.cpp b/test/ctorleak.cpp index c158f5e4e..7202e90dd 100644 --- a/test/ctorleak.cpp +++ b/test/ctorleak.cpp @@ -33,7 +33,7 @@ Index Foo::object_limit = 0; #undef EIGEN_TEST_MAX_SIZE #define EIGEN_TEST_MAX_SIZE 3 -void test_ctorleak() +EIGEN_DECLARE_TEST(ctorleak) { typedef Matrix<Foo, Dynamic, Dynamic> MatrixX; typedef Matrix<Foo, Dynamic, 1> VectorX; diff --git a/test/denseLM.cpp b/test/denseLM.cpp index 0aa736ea3..afb8004b1 100644 --- a/test/denseLM.cpp +++ b/test/denseLM.cpp @@ -182,7 +182,7 @@ void test_denseLM_T() } -void test_denseLM() +EIGEN_DECLARE_TEST(denseLM) { CALL_SUBTEST_2(test_denseLM_T<double>()); diff --git a/test/dense_storage.cpp b/test/dense_storage.cpp index e63712b1a..1150ec52b 100644 --- a/test/dense_storage.cpp +++ b/test/dense_storage.cpp @@ -52,7 +52,7 @@ void dense_storage_assignment() VERIFY_IS_EQUAL(raw_reference[i], raw_copied_reference[i]); } -void test_dense_storage() +EIGEN_DECLARE_TEST(dense_storage) { dense_storage_copy<int,Dynamic,Dynamic>(); dense_storage_copy<int,Dynamic,3>(); diff --git a/test/determinant.cpp b/test/determinant.cpp index b8c9babb3..7dd33c373 100644 --- a/test/determinant.cpp +++ b/test/determinant.cpp @@ -50,7 +50,7 @@ template<typename MatrixType> void determinant(const MatrixType& m) VERIFY_IS_APPROX(m2.block(0,0,0,0).determinant(), Scalar(1)); } -void test_determinant() +EIGEN_DECLARE_TEST(determinant) { for(int i = 0; i < g_repeat; i++) { int s = 0; diff --git a/test/diagonal.cpp b/test/diagonal.cpp index 8ed9b4682..4e8c4b3c9 100644 --- a/test/diagonal.cpp +++ b/test/diagonal.cpp @@ -88,7 +88,7 @@ template<typename MatrixType> void diagonal_assert(const MatrixType& m) { VERIFY_RAISES_ASSERT( m1.diagonal(-(rows+1)) ); } -void test_diagonal() +EIGEN_DECLARE_TEST(diagonal) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( diagonal(Matrix<float, 1, 1>()) ); diff --git a/test/diagonalmatrices.cpp b/test/diagonalmatrices.cpp index c55733df8..ba58ca8d1 100644 --- a/test/diagonalmatrices.cpp +++ b/test/diagonalmatrices.cpp @@ -144,7 +144,7 @@ void bug987() VERIFY_IS_APPROX(( res1 = points.topLeftCorner<2,2>()*diag.asDiagonal()) , res2 = tmp2*diag.asDiagonal() ); } -void test_diagonalmatrices() +EIGEN_DECLARE_TEST(diagonalmatrices) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( diagonalmatrices(Matrix<float, 1, 1>()) ); diff --git a/test/dontalign.cpp b/test/dontalign.cpp index ac00112ed..2e4102b86 100644 --- a/test/dontalign.cpp +++ b/test/dontalign.cpp @@ -44,7 +44,7 @@ void dontalign(const MatrixType& m) internal::aligned_delete(array, rows); } -void test_dontalign() +EIGEN_DECLARE_TEST(dontalign) { #if defined EIGEN_TEST_PART_1 || defined EIGEN_TEST_PART_5 dontalign(Matrix3d()); diff --git a/test/dynalloc.cpp b/test/dynalloc.cpp index f1cc70bee..ceecd76e3 100644 --- a/test/dynalloc.cpp +++ b/test/dynalloc.cpp @@ -119,7 +119,7 @@ template<typename T> void check_custom_new_delete() #endif } -void test_dynalloc() +EIGEN_DECLARE_TEST(dynalloc) { // low level dynamic memory allocation CALL_SUBTEST(check_handmade_aligned_malloc()); diff --git a/test/eigen2support.cpp b/test/eigen2support.cpp index ac6931a0e..49d7328e9 100644 --- a/test/eigen2support.cpp +++ b/test/eigen2support.cpp @@ -52,7 +52,7 @@ template<typename MatrixType> void eigen2support(const MatrixType& m) m1.minor(0,0); } -void test_eigen2support() +EIGEN_DECLARE_TEST(eigen2support) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( eigen2support(Matrix<double,1,1>()) ); diff --git a/test/eigensolver_complex.cpp b/test/eigensolver_complex.cpp index 8f279dc00..c5373f420 100644 --- a/test/eigensolver_complex.cpp +++ b/test/eigensolver_complex.cpp @@ -152,7 +152,7 @@ template<typename MatrixType> void eigensolver_verify_assert(const MatrixType& m VERIFY_RAISES_ASSERT(eig.eigenvectors()); } -void test_eigensolver_complex() +EIGEN_DECLARE_TEST(eigensolver_complex) { int s = 0; for(int i = 0; i < g_repeat; i++) { diff --git a/test/eigensolver_generalized_real.cpp b/test/eigensolver_generalized_real.cpp index 9dd44c89d..95ed431db 100644 --- a/test/eigensolver_generalized_real.cpp +++ b/test/eigensolver_generalized_real.cpp @@ -85,7 +85,7 @@ template<typename MatrixType> void generalized_eigensolver_real(const MatrixType } } -void test_eigensolver_generalized_real() +EIGEN_DECLARE_TEST(eigensolver_generalized_real) { for(int i = 0; i < g_repeat; i++) { int s = 0; diff --git a/test/eigensolver_generic.cpp b/test/eigensolver_generic.cpp index 07bf65e03..b41186819 100644 --- a/test/eigensolver_generic.cpp +++ b/test/eigensolver_generic.cpp @@ -100,7 +100,7 @@ template<typename MatrixType> void eigensolver_verify_assert(const MatrixType& m VERIFY_RAISES_ASSERT(eig.pseudoEigenvectors()); } -void test_eigensolver_generic() +EIGEN_DECLARE_TEST(eigensolver_generic) { int s = 0; for(int i = 0; i < g_repeat; i++) { diff --git a/test/eigensolver_selfadjoint.cpp b/test/eigensolver_selfadjoint.cpp index 0e39b5364..65b80c3fb 100644 --- a/test/eigensolver_selfadjoint.cpp +++ b/test/eigensolver_selfadjoint.cpp @@ -230,7 +230,7 @@ void bug_1204() SelfAdjointEigenSolver<Eigen::SparseMatrix<double> > eig(A); } -void test_eigensolver_selfadjoint() +EIGEN_DECLARE_TEST(eigensolver_selfadjoint) { int s = 0; for(int i = 0; i < g_repeat; i++) { diff --git a/test/evaluators.cpp b/test/evaluators.cpp index aed5a05a7..f4fdaf053 100644 --- a/test/evaluators.cpp +++ b/test/evaluators.cpp @@ -101,7 +101,7 @@ using namespace std; #define VERIFY_IS_APPROX_EVALUATOR(DEST,EXPR) VERIFY_IS_APPROX(copy_using_evaluator(DEST,(EXPR)), (EXPR).eval()); #define VERIFY_IS_APPROX_EVALUATOR2(DEST,EXPR,REF) VERIFY_IS_APPROX(copy_using_evaluator(DEST,(EXPR)), (REF).eval()); -void test_evaluators() +EIGEN_DECLARE_TEST(evaluators) { // Testing Matrix evaluator and Transpose Vector2d v = Vector2d::Random(); diff --git a/test/exceptions.cpp b/test/exceptions.cpp index b83fb82ba..182082e39 100644 --- a/test/exceptions.cpp +++ b/test/exceptions.cpp @@ -107,7 +107,7 @@ void memoryleak() VERIFY(ScalarWithExceptions::instances==0 && "global memory leak detected in " && EIGEN_MAKESTRING(OP)); \ } -void test_exceptions() +EIGEN_DECLARE_TEST(exceptions) { CALL_SUBTEST( memoryleak() ); } diff --git a/test/fastmath.cpp b/test/fastmath.cpp index cc5db0746..c30f0a846 100644 --- a/test/fastmath.cpp +++ b/test/fastmath.cpp @@ -88,7 +88,7 @@ void check_inf_nan(bool dryrun) { } } -void test_fastmath() { +EIGEN_DECLARE_TEST(fastmath) { std::cout << "*** float *** \n\n"; check_inf_nan<float>(true); std::cout << "*** double ***\n\n"; check_inf_nan<double>(true); std::cout << "*** long double *** \n\n"; check_inf_nan<long double>(true); diff --git a/test/first_aligned.cpp b/test/first_aligned.cpp index ae2d4bc42..ed9945077 100644 --- a/test/first_aligned.cpp +++ b/test/first_aligned.cpp @@ -26,7 +26,7 @@ void test_none_aligned_helper(Scalar *array, int size) struct some_non_vectorizable_type { float x; }; -void test_first_aligned() +EIGEN_DECLARE_TEST(first_aligned) { EIGEN_ALIGN16 float array_float[100]; test_first_aligned_helper(array_float, 50); diff --git a/test/geo_alignedbox.cpp b/test/geo_alignedbox.cpp index 87bf1140f..c6c051ce4 100644 --- a/test/geo_alignedbox.cpp +++ b/test/geo_alignedbox.cpp @@ -169,7 +169,7 @@ void specificTest2() } -void test_geo_alignedbox() +EIGEN_DECLARE_TEST(geo_alignedbox) { for(int i = 0; i < g_repeat; i++) { diff --git a/test/geo_eulerangles.cpp b/test/geo_eulerangles.cpp index 932ebe773..693c627a9 100644 --- a/test/geo_eulerangles.cpp +++ b/test/geo_eulerangles.cpp @@ -103,7 +103,7 @@ template<typename Scalar> void eulerangles() check_all_var(ea); } -void test_geo_eulerangles() +EIGEN_DECLARE_TEST(geo_eulerangles) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( eulerangles<float>() ); diff --git a/test/geo_homogeneous.cpp b/test/geo_homogeneous.cpp index 2187c7bf9..9aebe6226 100644 --- a/test/geo_homogeneous.cpp +++ b/test/geo_homogeneous.cpp @@ -115,7 +115,7 @@ template<typename Scalar,int Size> void homogeneous(void) VERIFY_IS_APPROX( (t2.template triangularView<Lower>() * v0.homogeneous()).eval(), (t2.template triangularView<Lower>()*hv0) ); } -void test_geo_homogeneous() +EIGEN_DECLARE_TEST(geo_homogeneous) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1(( homogeneous<float,1>() )); diff --git a/test/geo_hyperplane.cpp b/test/geo_hyperplane.cpp index b3a48c585..a26709301 100644 --- a/test/geo_hyperplane.cpp +++ b/test/geo_hyperplane.cpp @@ -180,7 +180,7 @@ template<typename Scalar> void hyperplane_alignment() } -void test_geo_hyperplane() +EIGEN_DECLARE_TEST(geo_hyperplane) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( hyperplane(Hyperplane<float,2>()) ); diff --git a/test/geo_orthomethods.cpp b/test/geo_orthomethods.cpp index e178df257..b7b660740 100644 --- a/test/geo_orthomethods.cpp +++ b/test/geo_orthomethods.cpp @@ -115,7 +115,7 @@ template<typename Scalar, int Size> void orthomethods(int size=Size) VERIFY_IS_APPROX(mcrossN3.row(i), matN3.row(i).cross(vec3)); } -void test_geo_orthomethods() +EIGEN_DECLARE_TEST(geo_orthomethods) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( orthomethods_3<float>() ); diff --git a/test/geo_parametrizedline.cpp b/test/geo_parametrizedline.cpp index 14cf4fd48..7135c8fa5 100644 --- a/test/geo_parametrizedline.cpp +++ b/test/geo_parametrizedline.cpp @@ -117,7 +117,7 @@ template<typename Scalar> void parametrizedline_alignment() #endif } -void test_geo_parametrizedline() +EIGEN_DECLARE_TEST(geo_parametrizedline) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( parametrizedline(ParametrizedLine<float,2>()) ); diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index 5854d39c5..3541b8b25 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -285,7 +285,7 @@ template<typename PlainObjectType> void check_const_correctness(const PlainObjec VERIFY( !(Map<ConstPlainObjectType, Aligned>::Flags & LvalueBit) ); } -void test_geo_quaternion() +EIGEN_DECLARE_TEST(geo_quaternion) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1(( quaternion<float,AutoAlign>() )); diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp index 278e527c2..bf920696b 100755 --- a/test/geo_transformations.cpp +++ b/test/geo_transformations.cpp @@ -612,7 +612,7 @@ template<typename Scalar, int Dim, int Options> void transform_products() VERIFY_IS_APPROX((ac*p).matrix(), a_m*p_m); } -void test_geo_transformations() +EIGEN_DECLARE_TEST(geo_transformations) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1(( transformations<double,Affine,AutoAlign>() )); diff --git a/test/gpu_basic.cu b/test/gpu_basic.cu index 285b87910..e8069f185 100644 --- a/test/gpu_basic.cu +++ b/test/gpu_basic.cu @@ -15,7 +15,6 @@ #define EIGEN_TEST_NO_LONGDOUBLE #define EIGEN_TEST_NO_COMPLEX -#define EIGEN_TEST_FUNC gpu_basic #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int #include "main.h" @@ -162,7 +161,7 @@ struct matrix_inverse { } }; -void test_gpu_basic() +EIGEN_DECLARE_TEST(gpu_basic) { ei_test_init_gpu(); diff --git a/test/half_float.cpp b/test/half_float.cpp index 5a881680a..2a7f9b497 100644 --- a/test/half_float.cpp +++ b/test/half_float.cpp @@ -272,7 +272,7 @@ void test_product() VERIFY_IS_APPROX(Ch.noalias()+=Ah*Bh, (Cf.noalias()+=Af*Bf).cast<half>()); } -void test_half_float() +EIGEN_DECLARE_TEST(half_float) { CALL_SUBTEST(test_numtraits()); for(int i = 0; i < g_repeat; i++) { diff --git a/test/hessenberg.cpp b/test/hessenberg.cpp index 96bc19e2e..0e1b0098d 100644 --- a/test/hessenberg.cpp +++ b/test/hessenberg.cpp @@ -49,7 +49,7 @@ template<typename Scalar,int Size> void hessenberg(int size = Size) // TODO: Add tests for packedMatrix() and householderCoefficients() } -void test_hessenberg() +EIGEN_DECLARE_TEST(hessenberg) { CALL_SUBTEST_1(( hessenberg<std::complex<double>,1>() )); CALL_SUBTEST_2(( hessenberg<std::complex<double>,2>() )); diff --git a/test/householder.cpp b/test/householder.cpp index ccda46811..cad8138a2 100644 --- a/test/householder.cpp +++ b/test/householder.cpp @@ -133,7 +133,7 @@ template<typename MatrixType> void householder(const MatrixType& m) VERIFY_IS_APPROX(m3 * m5, m1); // test evaluating rhseq to a dense matrix, then applying } -void test_householder() +EIGEN_DECLARE_TEST(householder) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( householder(Matrix<double,2,2>()) ); diff --git a/test/incomplete_cholesky.cpp b/test/incomplete_cholesky.cpp index 59ffe9259..52235c2c2 100644 --- a/test/incomplete_cholesky.cpp +++ b/test/incomplete_cholesky.cpp @@ -29,7 +29,7 @@ template<typename T, typename I> void test_incomplete_cholesky_T() CALL_SUBTEST( check_sparse_spd_solving(cg_illt_uplo_amd) ); } -void test_incomplete_cholesky() +EIGEN_DECLARE_TEST(incomplete_cholesky) { CALL_SUBTEST_1(( test_incomplete_cholesky_T<double,int>() )); CALL_SUBTEST_2(( test_incomplete_cholesky_T<std::complex<double>, int>() )); diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 551dc55b0..4cc0954f7 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -388,7 +388,7 @@ void check_indexed_view() } -void test_indexed_view() +EIGEN_DECLARE_TEST(indexed_view) { // for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( check_indexed_view() ); diff --git a/test/inplace_decomposition.cpp b/test/inplace_decomposition.cpp index 92d0d91b6..e3aa9957d 100644 --- a/test/inplace_decomposition.cpp +++ b/test/inplace_decomposition.cpp @@ -79,7 +79,7 @@ template<typename DecType,typename MatrixType> void inplace(bool square = false, } -void test_inplace_decomposition() +EIGEN_DECLARE_TEST(inplace_decomposition) { EIGEN_UNUSED typedef Matrix<double,4,3> Matrix43d; for(int i = 0; i < g_repeat; i++) { diff --git a/test/integer_types.cpp b/test/integer_types.cpp index 36295598f..88573c568 100644 --- a/test/integer_types.cpp +++ b/test/integer_types.cpp @@ -131,7 +131,7 @@ template<typename MatrixType> void integer_type_tests(const MatrixType& m) VERIFY_IS_APPROX((m1 * m2.transpose()) * m1, m1 * (m2.transpose() * m1)); } -void test_integer_types() +EIGEN_DECLARE_TEST(integer_types) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( integer_type_tests(Matrix<unsigned int, 1, 1>()) ); diff --git a/test/inverse.cpp b/test/inverse.cpp index be607cc8b..b989c7905 100644 --- a/test/inverse.cpp +++ b/test/inverse.cpp @@ -92,7 +92,7 @@ template<typename MatrixType> void inverse(const MatrixType& m) } } -void test_inverse() +EIGEN_DECLARE_TEST(inverse) { int s = 0; for(int i = 0; i < g_repeat; i++) { diff --git a/test/is_same_dense.cpp b/test/is_same_dense.cpp index c4e2fbc92..23dd806eb 100644 --- a/test/is_same_dense.cpp +++ b/test/is_same_dense.cpp @@ -11,7 +11,7 @@ using internal::is_same_dense; -void test_is_same_dense() +EIGEN_DECLARE_TEST(is_same_dense) { typedef Matrix<double,Dynamic,Dynamic,ColMajor> ColMatrixXd; typedef Matrix<std::complex<double>,Dynamic,Dynamic,ColMajor> ColMatrixXcd; diff --git a/test/jacobi.cpp b/test/jacobi.cpp index 319e4767a..5604797f5 100644 --- a/test/jacobi.cpp +++ b/test/jacobi.cpp @@ -57,7 +57,7 @@ void jacobi(const MatrixType& m = MatrixType()) } } -void test_jacobi() +EIGEN_DECLARE_TEST(jacobi) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1(( jacobi<Matrix3f, float>() )); diff --git a/test/jacobisvd.cpp b/test/jacobisvd.cpp index 72007bff5..f9a59e0e7 100644 --- a/test/jacobisvd.cpp +++ b/test/jacobisvd.cpp @@ -69,7 +69,7 @@ void jacobisvd_method() VERIFY_IS_APPROX(m.jacobiSvd(ComputeFullU|ComputeFullV).solve(m), m); } -void test_jacobisvd() +EIGEN_DECLARE_TEST(jacobisvd) { CALL_SUBTEST_3(( jacobisvd_verify_assert(Matrix3f()) )); CALL_SUBTEST_4(( jacobisvd_verify_assert(Matrix4d()) )); diff --git a/test/klu_support.cpp b/test/klu_support.cpp index 138dcc301..f806ad50e 100644 --- a/test/klu_support.cpp +++ b/test/klu_support.cpp @@ -24,7 +24,7 @@ template<typename T> void test_klu_support_T() //check_sparse_square_determinant(umfpack_rowmajor); } -void test_klu_support() +EIGEN_DECLARE_TEST(klu_support) { CALL_SUBTEST_1(test_klu_support_T<double>()); CALL_SUBTEST_2(test_klu_support_T<std::complex<double> >()); diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp index b6559b2a0..4137b0251 100644 --- a/test/linearstructure.cpp +++ b/test/linearstructure.cpp @@ -110,7 +110,7 @@ template<typename MatrixType> void real_complex(DenseIndex rows = MatrixType::Ro VERIFY(g_called && "matrix<complex> - real not properly optimized"); } -void test_linearstructure() +EIGEN_DECLARE_TEST(linearstructure) { g_called = true; VERIFY(g_called); // avoid `unneeded-internal-declaration` warning. diff --git a/test/lscg.cpp b/test/lscg.cpp index d49ee00c3..feb2347a8 100644 --- a/test/lscg.cpp +++ b/test/lscg.cpp @@ -30,7 +30,7 @@ template<typename T> void test_lscg_T() CALL_SUBTEST( check_sparse_leastsquare_solving(lscg_rowmajor_I) ); } -void test_lscg() +EIGEN_DECLARE_TEST(lscg) { CALL_SUBTEST_1(test_lscg_T<double>()); CALL_SUBTEST_2(test_lscg_T<std::complex<double> >()); diff --git a/test/lu.cpp b/test/lu.cpp index cad703dd0..144496e91 100644 --- a/test/lu.cpp +++ b/test/lu.cpp @@ -242,7 +242,7 @@ template<typename MatrixType> void lu_verify_assert() VERIFY_RAISES_ASSERT(plu.inverse()) } -void test_lu() +EIGEN_DECLARE_TEST(lu) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( lu_non_invertible<Matrix3f>() ); diff --git a/test/main.h b/test/main.h index 51399f7ad..5d64bc736 100644 --- a/test/main.h +++ b/test/main.h @@ -128,7 +128,6 @@ inline void on_temporary_creation(long int size) { #endif -// the following file is automatically generated by cmake #include "split_test_helper.h" #ifdef NDEBUG @@ -145,10 +144,6 @@ inline void on_temporary_creation(long int size) { #define EIGEN_MAKING_DOCS #endif -#ifndef EIGEN_TEST_FUNC -#error EIGEN_TEST_FUNC must be defined -#endif - #define DEFAULT_REPEAT 10 namespace Eigen @@ -157,17 +152,45 @@ namespace Eigen // level == 0 <=> abort if test fail // level >= 1 <=> warning message to std::cerr if test fail static int g_test_level = 0; - static int g_repeat; - static unsigned int g_seed; - static bool g_has_set_repeat, g_has_set_seed; + static int g_repeat = 1; + static unsigned int g_seed = 0; + static bool g_has_set_repeat = false, g_has_set_seed = false; + + class EigenTest + { + public: + EigenTest() : m_func(0) {} + EigenTest(const char* a_name, void (*func)(void)) + : m_name(a_name), m_func(func) + { + ms_registered_tests.push_back(this); + } + const std::string& name() const { return m_name; } + void operator()() const { m_func(); } + + static const std::vector<EigenTest*>& all() { return ms_registered_tests; } + protected: + std::string m_name; + void (*m_func)(void); + static std::vector<EigenTest*> ms_registered_tests; + }; + + std::vector<EigenTest*> EigenTest::ms_registered_tests; + + // Declare and register a test, e.g.: + // EIGEN_DECLARE_TEST(mytest) { ... } + // will create a function: + // void test_mytest() { ... } + // that will be automatically called. + #define EIGEN_DECLARE_TEST(X) \ + void EIGEN_CAT(test_,X) (); \ + static EigenTest EIGEN_CAT(test_handler_,X) (EIGEN_MAKESTRING(X), & EIGEN_CAT(test_,X)); \ + void EIGEN_CAT(test_,X) () } #define TRACK std::cerr << __FILE__ << " " << __LINE__ << std::endl // #define TRACK while() -#define EI_PP_MAKE_STRING2(S) #S -#define EI_PP_MAKE_STRING(S) EI_PP_MAKE_STRING2(S) - #define EIGEN_DEFAULT_IO_FORMAT IOFormat(4, 0, " ", "\n", "", "", "", "") #if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__) @@ -225,7 +248,7 @@ namespace Eigen } \ else if (Eigen::internal::push_assert) \ { \ - eigen_assert_list.push_back(std::string(EI_PP_MAKE_STRING(__FILE__) " (" EI_PP_MAKE_STRING(__LINE__) ") : " #a) ); \ + eigen_assert_list.push_back(std::string(EIGEN_MAKESTRING(__FILE__) " (" EIGEN_MAKESTRING(__LINE__) ") : " #a) ); \ } #ifdef EIGEN_EXCEPTIONS @@ -338,10 +361,10 @@ inline void verify_impl(bool condition, const char *testname, const char *file, } } -#define VERIFY(a) ::verify_impl(a, g_test_stack.back().c_str(), __FILE__, __LINE__, EI_PP_MAKE_STRING(a)) +#define VERIFY(a) ::verify_impl(a, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a)) -#define VERIFY_GE(a, b) ::verify_impl(a >= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EI_PP_MAKE_STRING(a >= b)) -#define VERIFY_LE(a, b) ::verify_impl(a <= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EI_PP_MAKE_STRING(a <= b)) +#define VERIFY_GE(a, b) ::verify_impl(a >= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a >= b)) +#define VERIFY_LE(a, b) ::verify_impl(a <= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a <= b)) #define VERIFY_IS_EQUAL(a, b) VERIFY(test_is_equal(a, b, true)) @@ -358,7 +381,7 @@ inline void verify_impl(bool condition, const char *testname, const char *file, #define STATIC_CHECK(COND) EIGEN_STATIC_ASSERT( (COND) , EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT ) #define CALL_SUBTEST(FUNC) do { \ - g_test_stack.push_back(EI_PP_MAKE_STRING(FUNC)); \ + g_test_stack.push_back(EIGEN_MAKESTRING(FUNC)); \ FUNC; \ g_test_stack.pop_back(); \ } while (0) @@ -709,9 +732,6 @@ template<> std::string type_name<std::complex<double> >() { return "comple template<> std::string type_name<std::complex<long double> >() { return "complex<long double>"; } template<> std::string type_name<std::complex<int> >() { return "complex<int>"; } -// forward declaration of the main test function -void EIGEN_CAT(test_,EIGEN_TEST_FUNC)(); - using namespace Eigen; inline void set_repeat_from_string(const char *str) @@ -798,9 +818,16 @@ int main(int argc, char *argv[]) srand(g_seed); std::cout << "Repeating each test " << g_repeat << " times" << std::endl; - Eigen::g_test_stack.push_back(std::string(EI_PP_MAKE_STRING(EIGEN_TEST_FUNC))); + VERIFY(EigenTest::all().size()>0); + + for(std::size_t i=0; i<EigenTest::all().size(); ++i) + { + const EigenTest& current_test = *EigenTest::all()[i]; + Eigen::g_test_stack.push_back(current_test.name()); + current_test(); + Eigen::g_test_stack.pop_back(); + } - EIGEN_CAT(test_,EIGEN_TEST_FUNC)(); return 0; } diff --git a/test/mapped_matrix.cpp b/test/mapped_matrix.cpp index a530fab41..e1106ba42 100644 --- a/test/mapped_matrix.cpp +++ b/test/mapped_matrix.cpp @@ -177,7 +177,7 @@ void map_not_aligned_on_scalar() internal::aligned_delete(array1, (size+1)*(size+1)+1); } -void test_mapped_matrix() +EIGEN_DECLARE_TEST(mapped_matrix) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( map_class_vector(Matrix<float, 1, 1>()) ); diff --git a/test/mapstaticmethods.cpp b/test/mapstaticmethods.cpp index 8156ca939..f32c0beec 100644 --- a/test/mapstaticmethods.cpp +++ b/test/mapstaticmethods.cpp @@ -143,7 +143,7 @@ void mapstaticmethods(const PlainObjectType& m) VERIFY(true); // just to avoid 'unused function' warning } -void test_mapstaticmethods() +EIGEN_DECLARE_TEST(mapstaticmethods) { ptr = internal::aligned_new<float>(1000); for(int i = 0; i < 1000; i++) ptr[i] = float(i); diff --git a/test/mapstride.cpp b/test/mapstride.cpp index d785148cf..09196600b 100644 --- a/test/mapstride.cpp +++ b/test/mapstride.cpp @@ -197,7 +197,7 @@ void bug1453() VERIFY_IS_APPROX(RowMatrix32i::Map(data, InnerStride<>(2)), RowMatrixXi::Map(data, 3, 2, Stride<4,2>())); } -void test_mapstride() +EIGEN_DECLARE_TEST(mapstride) { for(int i = 0; i < g_repeat; i++) { int maxn = 30; diff --git a/test/meta.cpp b/test/meta.cpp index 34c5520a6..a6a67b85c 100644 --- a/test/meta.cpp +++ b/test/meta.cpp @@ -27,7 +27,7 @@ struct MyImpl : public MyInterface { void func() {} }; -void test_meta() +EIGEN_DECLARE_TEST(meta) { VERIFY((internal::conditional<(3<4),internal::true_type, internal::false_type>::type::value)); VERIFY(( internal::is_same<float,float>::value)); diff --git a/test/metis_support.cpp b/test/metis_support.cpp index d87c56a13..b490dacde 100644 --- a/test/metis_support.cpp +++ b/test/metis_support.cpp @@ -19,7 +19,7 @@ template<typename T> void test_metis_T() check_sparse_square_solving(sparselu_metis); } -void test_metis_support() +EIGEN_DECLARE_TEST(metis_support) { CALL_SUBTEST_1(test_metis_T<double>()); } diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp index f17291c40..e71712f33 100644 --- a/test/miscmatrices.cpp +++ b/test/miscmatrices.cpp @@ -34,7 +34,7 @@ template<typename MatrixType> void miscMatrices(const MatrixType& m) VERIFY_IS_APPROX(square, MatrixType::Identity(rows, rows)); } -void test_miscmatrices() +EIGEN_DECLARE_TEST(miscmatrices) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( miscMatrices(Matrix<float, 1, 1>()) ); diff --git a/test/mixingtypes.cpp b/test/mixingtypes.cpp index b796082cd..38f062f1e 100644 --- a/test/mixingtypes.cpp +++ b/test/mixingtypes.cpp @@ -286,7 +286,7 @@ template<int SizeAtCompileType> void mixingtypes(int size = SizeAtCompileType) VERIFY_IS_APPROX( rcd.noalias() -= mcd + md*md, - ((md*md).eval().template cast<CD>()) ); } -void test_mixingtypes() +EIGEN_DECLARE_TEST(mixingtypes) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1(mixingtypes<3>()); diff --git a/test/nesting_ops.cpp b/test/nesting_ops.cpp index a419b0e44..4b5fc21f2 100644 --- a/test/nesting_ops.cpp +++ b/test/nesting_ops.cpp @@ -91,7 +91,7 @@ template <typename MatrixType> void run_nesting_ops_2(const MatrixType& _m) } -void test_nesting_ops() +EIGEN_DECLARE_TEST(nesting_ops) { CALL_SUBTEST_1(run_nesting_ops_1(MatrixXf::Random(25,25))); CALL_SUBTEST_2(run_nesting_ops_1(MatrixXcd::Random(25,25))); diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp index d1ca79d68..cb4c073e9 100644 --- a/test/nomalloc.cpp +++ b/test/nomalloc.cpp @@ -202,7 +202,7 @@ template<typename MatrixType> void test_reference(const MatrixType& m) { } -void test_nomalloc() +EIGEN_DECLARE_TEST(nomalloc) { // create some dynamic objects Eigen::MatrixXd M1 = MatrixXd::Random(3,3); diff --git a/test/nullary.cpp b/test/nullary.cpp index 22ec92352..9e6e6eaa0 100644 --- a/test/nullary.cpp +++ b/test/nullary.cpp @@ -239,7 +239,7 @@ void testMatrixType(const MatrixType& m) VERIFY_IS_APPROX( A(i,j), s1 ); } -void test_nullary() +EIGEN_DECLARE_TEST(nullary) { CALL_SUBTEST_1( testMatrixType(Matrix2d()) ); CALL_SUBTEST_2( testMatrixType(MatrixXcf(internal::random<int>(1,300),internal::random<int>(1,300))) ); diff --git a/test/num_dimensions.cpp b/test/num_dimensions.cpp index f5209283d..7ad7ef697 100644 --- a/test/num_dimensions.cpp +++ b/test/num_dimensions.cpp @@ -60,7 +60,7 @@ using TMatrix = Matrix<Scalar,Rows,Cols>; #endif -void test_num_dimensions() +EIGEN_DECLARE_TEST(num_dimensions) { int n = 10; ArrayXXd A(n,n); diff --git a/test/numext.cpp b/test/numext.cpp index 3de33e2f9..6307f5979 100644 --- a/test/numext.cpp +++ b/test/numext.cpp @@ -33,7 +33,7 @@ void check_abs() { } } -void test_numext() { +EIGEN_DECLARE_TEST(numext) { CALL_SUBTEST( check_abs<bool>() ); CALL_SUBTEST( check_abs<signed char>() ); CALL_SUBTEST( check_abs<unsigned char>() ); diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 56e017383..58a1c60bf 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -627,7 +627,7 @@ template<typename Scalar> void packetmath_scatter_gather() } } -void test_packetmath() +EIGEN_DECLARE_TEST(packetmath) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( packetmath<float>() ); diff --git a/test/pardiso_support.cpp b/test/pardiso_support.cpp index 67efad6d8..9c16ded5b 100644 --- a/test/pardiso_support.cpp +++ b/test/pardiso_support.cpp @@ -20,7 +20,7 @@ template<typename T> void test_pardiso_T() check_sparse_square_solving(pardiso_lu); } -void test_pardiso_support() +EIGEN_DECLARE_TEST(pardiso_support) { CALL_SUBTEST_1(test_pardiso_T<float>()); CALL_SUBTEST_2(test_pardiso_T<double>()); diff --git a/test/pastix_support.cpp b/test/pastix_support.cpp index b62f85739..9b64417c1 100644 --- a/test/pastix_support.cpp +++ b/test/pastix_support.cpp @@ -45,7 +45,7 @@ template<typename T> void test_pastix_T_LU() check_sparse_square_solving(pastix_lu); } -void test_pastix_support() +EIGEN_DECLARE_TEST(pastix_support) { CALL_SUBTEST_1(test_pastix_T<float>()); CALL_SUBTEST_2(test_pastix_T<double>()); diff --git a/test/permutationmatrices.cpp b/test/permutationmatrices.cpp index e885f0e04..71f09be0f 100644 --- a/test/permutationmatrices.cpp +++ b/test/permutationmatrices.cpp @@ -152,7 +152,7 @@ void bug890() VERIFY_IS_APPROX(v1, (P.inverse() * rhs).eval()); } -void test_permutationmatrices() +EIGEN_DECLARE_TEST(permutationmatrices) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( permutationmatrices(Matrix<float, 1, 1>()) ); diff --git a/test/prec_inverse_4x4.cpp b/test/prec_inverse_4x4.cpp index eb6ad18c9..072466467 100644 --- a/test/prec_inverse_4x4.cpp +++ b/test/prec_inverse_4x4.cpp @@ -68,7 +68,7 @@ template<typename MatrixType> void inverse_general_4x4(int repeat) } } -void test_prec_inverse_4x4() +EIGEN_DECLARE_TEST(prec_inverse_4x4) { CALL_SUBTEST_1((inverse_permutation_4x4<Matrix4f>())); CALL_SUBTEST_1(( inverse_general_4x4<Matrix4f>(200000 * g_repeat) )); diff --git a/test/product_extra.cpp b/test/product_extra.cpp index de2709d8b..bd31df84d 100644 --- a/test/product_extra.cpp +++ b/test/product_extra.cpp @@ -352,7 +352,7 @@ void bug_1308() VERIFY_IS_APPROX(r44.noalias() += Vector4d::Ones() * m44.col(0).transpose(), ones44); } -void test_product_extra() +EIGEN_DECLARE_TEST(product_extra) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( product_extra(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) ); diff --git a/test/product_large.cpp b/test/product_large.cpp index 14a4f739d..1b6fec738 100644 --- a/test/product_large.cpp +++ b/test/product_large.cpp @@ -30,7 +30,7 @@ void test_aliasing() x = z; } -void test_product_large() +EIGEN_DECLARE_TEST(product_large) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( product(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) ); diff --git a/test/product_mmtr.cpp b/test/product_mmtr.cpp index d3e24b012..bb19e6e52 100644 --- a/test/product_mmtr.cpp +++ b/test/product_mmtr.cpp @@ -84,7 +84,7 @@ template<typename Scalar> void mmtr(int size) VERIFY_IS_APPROX(matc, ref2); } -void test_product_mmtr() +EIGEN_DECLARE_TEST(product_mmtr) { for(int i = 0; i < g_repeat ; i++) { diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp index b90165b2f..dffb07608 100644 --- a/test/product_notemporary.cpp +++ b/test/product_notemporary.cpp @@ -150,7 +150,7 @@ template<typename MatrixType> void product_notemporary(const MatrixType& m) VERIFY_EVALUATION_COUNT( rvres.noalias() = rv1 * (m1 * m2.adjoint()), 1 ); } -void test_product_notemporary() +EIGEN_DECLARE_TEST(product_notemporary) { int s; for(int i = 0; i < g_repeat; i++) { diff --git a/test/product_selfadjoint.cpp b/test/product_selfadjoint.cpp index 88d68391b..bdccd0491 100644 --- a/test/product_selfadjoint.cpp +++ b/test/product_selfadjoint.cpp @@ -59,7 +59,7 @@ template<typename MatrixType> void product_selfadjoint(const MatrixType& m) } } -void test_product_selfadjoint() +EIGEN_DECLARE_TEST(product_selfadjoint) { int s = 0; for(int i = 0; i < g_repeat ; i++) { diff --git a/test/product_small.cpp b/test/product_small.cpp index fdfdd9f6c..16138631a 100644 --- a/test/product_small.cpp +++ b/test/product_small.cpp @@ -228,7 +228,7 @@ void bug_1311() VERIFY_IS_APPROX(res, A*b); } -void test_product_small() +EIGEN_DECLARE_TEST(product_small) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( product(Matrix<float, 3, 2>()) ); diff --git a/test/product_symm.cpp b/test/product_symm.cpp index 7d1042a4f..7d786467d 100644 --- a/test/product_symm.cpp +++ b/test/product_symm.cpp @@ -94,7 +94,7 @@ template<typename Scalar, int Size, int OtherSize> void symm(int size = Size, in } -void test_product_symm() +EIGEN_DECLARE_TEST(product_symm) { for(int i = 0; i < g_repeat ; i++) { diff --git a/test/product_syrk.cpp b/test/product_syrk.cpp index 3ebbe14ca..23406fe4b 100644 --- a/test/product_syrk.cpp +++ b/test/product_syrk.cpp @@ -117,7 +117,7 @@ template<typename MatrixType> void syrk(const MatrixType& m) ((s1 * m1.row(c).adjoint() * m1.row(c).adjoint().adjoint()).eval().template triangularView<Upper>().toDenseMatrix())); } -void test_product_syrk() +EIGEN_DECLARE_TEST(product_syrk) { for(int i = 0; i < g_repeat ; i++) { diff --git a/test/product_trmm.cpp b/test/product_trmm.cpp index e08d9f39f..c7594e512 100644 --- a/test/product_trmm.cpp +++ b/test/product_trmm.cpp @@ -115,7 +115,7 @@ void trmm(int rows=get_random_size<Scalar>(), int cols=get_random_size<Scalar>() CALL_ALL_ORDERS(EIGEN_CAT(3,NB),SCALAR,StrictlyLower) -void test_product_trmm() +EIGEN_DECLARE_TEST(product_trmm) { for(int i = 0; i < g_repeat ; i++) { diff --git a/test/product_trmv.cpp b/test/product_trmv.cpp index 65d66e57b..5eb1b5ac0 100644 --- a/test/product_trmv.cpp +++ b/test/product_trmv.cpp @@ -70,7 +70,7 @@ template<typename MatrixType> void trmv(const MatrixType& m) // TODO check with sub-matrices } -void test_product_trmv() +EIGEN_DECLARE_TEST(product_trmv) { int s = 0; for(int i = 0; i < g_repeat ; i++) { diff --git a/test/product_trsolve.cpp b/test/product_trsolve.cpp index 4b97fa9d6..0c22cccf6 100644 --- a/test/product_trsolve.cpp +++ b/test/product_trsolve.cpp @@ -73,7 +73,7 @@ template<typename Scalar,int Size, int Cols> void trsolve(int size=Size,int cols VERIFY_TRSM(cmLhs.template triangularView<Lower>(), rmRhs.col(c)); } -void test_product_trsolve() +EIGEN_DECLARE_TEST(product_trsolve) { for(int i = 0; i < g_repeat ; i++) { diff --git a/test/qr.cpp b/test/qr.cpp index 02e3ed74c..4799aa9ef 100644 --- a/test/qr.cpp +++ b/test/qr.cpp @@ -100,7 +100,7 @@ template<typename MatrixType> void qr_verify_assert() VERIFY_RAISES_ASSERT(qr.logAbsDeterminant()) } -void test_qr() +EIGEN_DECLARE_TEST(qr) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( qr(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) ); diff --git a/test/qr_colpivoting.cpp b/test/qr_colpivoting.cpp index 96c0badb7..d224a9436 100644 --- a/test/qr_colpivoting.cpp +++ b/test/qr_colpivoting.cpp @@ -296,7 +296,7 @@ template<typename MatrixType> void qr_verify_assert() VERIFY_RAISES_ASSERT(qr.logAbsDeterminant()) } -void test_qr_colpivoting() +EIGEN_DECLARE_TEST(qr_colpivoting) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( qr<MatrixXf>() ); diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index c270edf1a..150b4256c 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -125,7 +125,7 @@ template<typename MatrixType> void qr_verify_assert() VERIFY_RAISES_ASSERT(qr.logAbsDeterminant()) } -void test_qr_fullpivoting() +EIGEN_DECLARE_TEST(qr_fullpivoting) { for(int i = 0; i < 1; i++) { CALL_SUBTEST_5( qr<Matrix3f>() ); diff --git a/test/qtvector.cpp b/test/qtvector.cpp index 22df0d515..4ec79b1e6 100644 --- a/test/qtvector.cpp +++ b/test/qtvector.cpp @@ -125,7 +125,7 @@ void check_qtvector_quaternion(const QuaternionType&) } } -void test_qtvector() +EIGEN_DECLARE_TEST(qtvector) { // some non vectorizable fixed sizes CALL_SUBTEST(check_qtvector_matrix(Vector2f())); diff --git a/test/rand.cpp b/test/rand.cpp index 51cf01773..1b5c058ab 100644 --- a/test/rand.cpp +++ b/test/rand.cpp @@ -54,7 +54,7 @@ template<typename Scalar> void check_histogram(Scalar x, Scalar y, int bins) VERIFY( (((hist.cast<double>()/double(f))-1.0).abs()<0.02).all() ); } -void test_rand() +EIGEN_DECLARE_TEST(rand) { long long_ref = NumTraits<long>::highest()/10; signed char char_offset = (std::min)(g_repeat,64); diff --git a/test/real_qz.cpp b/test/real_qz.cpp index 3c1492e4b..1cf7aba2d 100644 --- a/test/real_qz.cpp +++ b/test/real_qz.cpp @@ -75,7 +75,7 @@ template<typename MatrixType> void real_qz(const MatrixType& m) VERIFY_IS_APPROX(qz.matrixZ()*qz.matrixZ().adjoint(), MatrixType::Identity(dim,dim)); } -void test_real_qz() +EIGEN_DECLARE_TEST(real_qz) { int s = 0; for(int i = 0; i < g_repeat; i++) { diff --git a/test/redux.cpp b/test/redux.cpp index 213f080aa..9e3ed4546 100644 --- a/test/redux.cpp +++ b/test/redux.cpp @@ -146,7 +146,7 @@ template<typename VectorType> void vectorRedux(const VectorType& w) VERIFY_RAISES_ASSERT(v.head(0).maxCoeff()); } -void test_redux() +EIGEN_DECLARE_TEST(redux) { // the max size cannot be too large, otherwise reduxion operations obviously generate large errors. int maxsize = (std::min)(100,EIGEN_TEST_MAX_SIZE); diff --git a/test/ref.cpp b/test/ref.cpp index 704495aff..a94ea9677 100644 --- a/test/ref.cpp +++ b/test/ref.cpp @@ -264,7 +264,7 @@ void test_ref_fixed_size_assert() VERIFY_RAISES_STATIC_ASSERT( Ref<const Vector3f> y = 2*v4; (void)y; ); } -void test_ref() +EIGEN_DECLARE_TEST(ref) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( ref_vector(Matrix<float, 1, 1>()) ); diff --git a/test/resize.cpp b/test/resize.cpp index 4adaafe56..646a75b8f 100644 --- a/test/resize.cpp +++ b/test/resize.cpp @@ -33,7 +33,7 @@ void resizeLikeTest12() { resizeLikeTest<1,2>(); } void resizeLikeTest1020() { resizeLikeTest<10,20>(); } void resizeLikeTest31() { resizeLikeTest<3,1>(); } -void test_resize() +EIGEN_DECLARE_TEST(resize) { CALL_SUBTEST(resizeLikeTest12() ); CALL_SUBTEST(resizeLikeTest1020() ); diff --git a/test/rvalue_types.cpp b/test/rvalue_types.cpp index 8887f1b1b..5f52fb3bc 100644 --- a/test/rvalue_types.cpp +++ b/test/rvalue_types.cpp @@ -43,7 +43,7 @@ template <typename MatrixType> void rvalue_copyassign(const MatrixType&) {} #endif -void test_rvalue_types() +EIGEN_DECLARE_TEST(rvalue_types) { CALL_SUBTEST_1(rvalue_copyassign( MatrixXf::Random(50,50).eval() )); CALL_SUBTEST_1(rvalue_copyassign( ArrayXXf::Random(50,50).eval() )); diff --git a/test/schur_complex.cpp b/test/schur_complex.cpp index deb78e44e..03e17e81d 100644 --- a/test/schur_complex.cpp +++ b/test/schur_complex.cpp @@ -79,7 +79,7 @@ template<typename MatrixType> void schur(int size = MatrixType::ColsAtCompileTim } } -void test_schur_complex() +EIGEN_DECLARE_TEST(schur_complex) { CALL_SUBTEST_1(( schur<Matrix4cd>() )); CALL_SUBTEST_2(( schur<MatrixXcf>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4)) )); diff --git a/test/schur_real.cpp b/test/schur_real.cpp index e5229e6e8..945461027 100644 --- a/test/schur_real.cpp +++ b/test/schur_real.cpp @@ -98,7 +98,7 @@ template<typename MatrixType> void schur(int size = MatrixType::ColsAtCompileTim } } -void test_schur_real() +EIGEN_DECLARE_TEST(schur_real) { CALL_SUBTEST_1(( schur<Matrix4f>() )); CALL_SUBTEST_2(( schur<MatrixXd>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4)) )); diff --git a/test/selfadjoint.cpp b/test/selfadjoint.cpp index bb11cc351..9ca9cef9e 100644 --- a/test/selfadjoint.cpp +++ b/test/selfadjoint.cpp @@ -56,7 +56,7 @@ void bug_159() EIGEN_UNUSED_VARIABLE(m) } -void test_selfadjoint() +EIGEN_DECLARE_TEST(selfadjoint) { for(int i = 0; i < g_repeat ; i++) { diff --git a/test/simplicial_cholesky.cpp b/test/simplicial_cholesky.cpp index 5bb1e0d6c..314b903e2 100644 --- a/test/simplicial_cholesky.cpp +++ b/test/simplicial_cholesky.cpp @@ -39,7 +39,7 @@ template<typename T, typename I> void test_simplicial_cholesky_T() check_sparse_spd_solving(ldlt_colmajor_upper_nat, (std::min)(300,EIGEN_TEST_MAX_SIZE), 1000); } -void test_simplicial_cholesky() +EIGEN_DECLARE_TEST(simplicial_cholesky) { CALL_SUBTEST_1(( test_simplicial_cholesky_T<double,int>() )); CALL_SUBTEST_2(( test_simplicial_cholesky_T<std::complex<double>, int>() )); diff --git a/test/sizeof.cpp b/test/sizeof.cpp index e552bae7a..af34e97dd 100644 --- a/test/sizeof.cpp +++ b/test/sizeof.cpp @@ -18,7 +18,7 @@ template<typename MatrixType> void verifySizeOf(const MatrixType&) VERIFY_IS_EQUAL(sizeof(MatrixType),sizeof(Scalar*) + 2 * sizeof(Index)); } -void test_sizeof() +EIGEN_DECLARE_TEST(sizeof) { CALL_SUBTEST(verifySizeOf(Matrix<float, 1, 1>()) ); CALL_SUBTEST(verifySizeOf(Array<float, 2, 1>()) ); diff --git a/test/sizeoverflow.cpp b/test/sizeoverflow.cpp index 240d22294..421351233 100644 --- a/test/sizeoverflow.cpp +++ b/test/sizeoverflow.cpp @@ -34,7 +34,7 @@ void triggerVectorBadAlloc(Index size) VERIFY_THROWS_BADALLOC( VectorType v; v.conservativeResize(size) ); } -void test_sizeoverflow() +EIGEN_DECLARE_TEST(sizeoverflow) { // there are 2 levels of overflow checking. first in PlainObjectBase.h we check for overflow in rows*cols computations. // this is tested in tests of the form times_itself_gives_0 * times_itself_gives_0 diff --git a/test/smallvectors.cpp b/test/smallvectors.cpp index 781511397..f9803acbb 100644 --- a/test/smallvectors.cpp +++ b/test/smallvectors.cpp @@ -57,7 +57,7 @@ template<typename Scalar> void smallVectors() } } -void test_smallvectors() +EIGEN_DECLARE_TEST(smallvectors) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST(smallVectors<int>() ); diff --git a/test/sparseLM.cpp b/test/sparseLM.cpp index 8e148f9bc..a48fcb685 100644 --- a/test/sparseLM.cpp +++ b/test/sparseLM.cpp @@ -168,7 +168,7 @@ void test_sparseLM_T() return ; } -void test_sparseLM() +EIGEN_DECLARE_TEST(sparseLM) { CALL_SUBTEST_1(test_sparseLM_T<double>()); diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index f84b6e3f5..bfd61f69f 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -641,7 +641,7 @@ void big_sparse_triplet(Index rows, Index cols, double density) { } -void test_sparse_basic() +EIGEN_DECLARE_TEST(sparse_basic) { for(int i = 0; i < g_repeat; i++) { int r = Eigen::internal::random<int>(1,200), c = Eigen::internal::random<int>(1,200); diff --git a/test/sparse_block.cpp b/test/sparse_block.cpp index 2a0b3b617..e7303eab0 100644 --- a/test/sparse_block.cpp +++ b/test/sparse_block.cpp @@ -288,7 +288,7 @@ template<typename SparseMatrixType> void sparse_block(const SparseMatrixType& re } } -void test_sparse_block() +EIGEN_DECLARE_TEST(sparse_block) { for(int i = 0; i < g_repeat; i++) { int r = Eigen::internal::random<int>(1,200), c = Eigen::internal::random<int>(1,200); diff --git a/test/sparse_permutations.cpp b/test/sparse_permutations.cpp index b82cceff8..e93493c39 100644 --- a/test/sparse_permutations.cpp +++ b/test/sparse_permutations.cpp @@ -220,7 +220,7 @@ template<typename Scalar> void sparse_permutations_all(int size) CALL_SUBTEST(( sparse_permutations<RowMajor>(SparseMatrix<Scalar, RowMajor>(size,size)) )); } -void test_sparse_permutations() +EIGEN_DECLARE_TEST(sparse_permutations) { for(int i = 0; i < g_repeat; i++) { int s = Eigen::internal::random<int>(1,50); diff --git a/test/sparse_product.cpp b/test/sparse_product.cpp index f47170b72..d6b7638b1 100644 --- a/test/sparse_product.cpp +++ b/test/sparse_product.cpp @@ -453,7 +453,7 @@ void test_mixing_types() VERIFY_IS_APPROX( dC2 = sC1 * dR1.col(0), dC3 = sC1 * dR1.template cast<Cplx>().col(0) ); } -void test_sparse_product() +EIGEN_DECLARE_TEST(sparse_product) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( (sparse_product<SparseMatrix<double,ColMajor> >()) ); diff --git a/test/sparse_ref.cpp b/test/sparse_ref.cpp index 5e9607234..12b6f8a9d 100644 --- a/test/sparse_ref.cpp +++ b/test/sparse_ref.cpp @@ -126,7 +126,7 @@ void call_ref() VERIFY_EVALUATION_COUNT( call_ref_5(A.row(2), A.row(2).transpose()), 1); } -void test_sparse_ref() +EIGEN_DECLARE_TEST(sparse_ref) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( check_const_correctness(SparseMatrix<float>()) ); diff --git a/test/sparse_solvers.cpp b/test/sparse_solvers.cpp index 3a8873d43..aaf3d39c9 100644 --- a/test/sparse_solvers.cpp +++ b/test/sparse_solvers.cpp @@ -101,7 +101,7 @@ template<typename Scalar> void sparse_solvers(int rows, int cols) } } -void test_sparse_solvers() +EIGEN_DECLARE_TEST(sparse_solvers) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1(sparse_solvers<double>(8, 8) ); diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp index b3e1dda25..35129278b 100644 --- a/test/sparse_vector.cpp +++ b/test/sparse_vector.cpp @@ -145,7 +145,7 @@ template<typename Scalar,typename StorageIndex> void sparse_vector(int rows, int } -void test_sparse_vector() +EIGEN_DECLARE_TEST(sparse_vector) { for(int i = 0; i < g_repeat; i++) { int r = Eigen::internal::random<int>(1,500), c = Eigen::internal::random<int>(1,500); diff --git a/test/sparselu.cpp b/test/sparselu.cpp index bd000baf1..84cc6ebe5 100644 --- a/test/sparselu.cpp +++ b/test/sparselu.cpp @@ -36,7 +36,7 @@ template<typename T> void test_sparselu_T() check_sparse_square_determinant(sparselu_amd); } -void test_sparselu() +EIGEN_DECLARE_TEST(sparselu) { CALL_SUBTEST_1(test_sparselu_T<float>()); CALL_SUBTEST_2(test_sparselu_T<double>()); diff --git a/test/sparseqr.cpp b/test/sparseqr.cpp index f0e721fce..3ffe62314 100644 --- a/test/sparseqr.cpp +++ b/test/sparseqr.cpp @@ -117,7 +117,7 @@ template<typename Scalar> void test_sparseqr_scalar() dQ = solver.matrixQ(); VERIFY_IS_APPROX(Q, dQ); } -void test_sparseqr() +EIGEN_DECLARE_TEST(sparseqr) { for(int i=0; i<g_repeat; ++i) { diff --git a/test/special_numbers.cpp b/test/special_numbers.cpp index 2f1b704be..1e1a63631 100644 --- a/test/special_numbers.cpp +++ b/test/special_numbers.cpp @@ -49,7 +49,7 @@ template<typename Scalar> void special_numbers() VERIFY(!mboth.array().allFinite()); } -void test_special_numbers() +EIGEN_DECLARE_TEST(special_numbers) { for(int i = 0; i < 10*g_repeat; i++) { CALL_SUBTEST_1( special_numbers<float>() ); diff --git a/test/spqr_support.cpp b/test/spqr_support.cpp index 81e63b6a5..79c2c12fc 100644 --- a/test/spqr_support.cpp +++ b/test/spqr_support.cpp @@ -57,7 +57,7 @@ template<typename Scalar> void test_spqr_scalar() refX = dA.colPivHouseholderQr().solve(b); VERIFY(x.isApprox(refX,test_precision<Scalar>())); } -void test_spqr_support() +EIGEN_DECLARE_TEST(spqr_support) { CALL_SUBTEST_1(test_spqr_scalar<double>()); CALL_SUBTEST_2(test_spqr_scalar<std::complex<double> >()); diff --git a/test/stable_norm.cpp b/test/stable_norm.cpp index 255cae9b3..ee5f91674 100644 --- a/test/stable_norm.cpp +++ b/test/stable_norm.cpp @@ -220,7 +220,7 @@ void test_hypot() VERIFY((numext::isnan)(numext::hypot(a,nan))); } -void test_stable_norm() +EIGEN_DECLARE_TEST(stable_norm) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_3( test_hypot<double>() ); diff --git a/test/stddeque.cpp b/test/stddeque.cpp index b511c4e61..0a6aa2572 100644 --- a/test/stddeque.cpp +++ b/test/stddeque.cpp @@ -100,7 +100,7 @@ void check_stddeque_quaternion(const QuaternionType&) VERIFY_IS_APPROX(v.back(), x); } -void test_stddeque() +EIGEN_DECLARE_TEST(stddeque) { // some non vectorizable fixed sizes CALL_SUBTEST_1(check_stddeque_matrix(Vector2f())); diff --git a/test/stddeque_overload.cpp b/test/stddeque_overload.cpp index 0541bc1bd..eebe93d81 100644 --- a/test/stddeque_overload.cpp +++ b/test/stddeque_overload.cpp @@ -128,7 +128,7 @@ void check_stddeque_quaternion(const QuaternionType&) } } -void test_stddeque_overload() +EIGEN_DECLARE_TEST(stddeque_overload) { // some non vectorizable fixed sizes CALL_SUBTEST_1(check_stddeque_matrix(Vector2f())); diff --git a/test/stdlist.cpp b/test/stdlist.cpp index 23cbe9039..c9e5b7286 100644 --- a/test/stdlist.cpp +++ b/test/stdlist.cpp @@ -100,7 +100,7 @@ void check_stdlist_quaternion(const QuaternionType&) VERIFY_IS_APPROX(v.back(), x); } -void test_stdlist() +EIGEN_DECLARE_TEST(stdlist) { // some non vectorizable fixed sizes CALL_SUBTEST_1(check_stdlist_matrix(Vector2f())); diff --git a/test/stdlist_overload.cpp b/test/stdlist_overload.cpp index 386124ad4..93b6fc9ed 100644 --- a/test/stdlist_overload.cpp +++ b/test/stdlist_overload.cpp @@ -162,7 +162,7 @@ void check_stdlist_quaternion(const QuaternionType&) } } -void test_stdlist_overload() +EIGEN_DECLARE_TEST(stdlist_overload) { // some non vectorizable fixed sizes CALL_SUBTEST_1(check_stdlist_matrix(Vector2f())); diff --git a/test/stdvector.cpp b/test/stdvector.cpp index cf3646870..e2b7bd061 100644 --- a/test/stdvector.cpp +++ b/test/stdvector.cpp @@ -117,7 +117,7 @@ void check_stdvector_quaternion(const QuaternionType&) } } -void test_stdvector() +EIGEN_DECLARE_TEST(stdvector) { // some non vectorizable fixed sizes CALL_SUBTEST_1(check_stdvector_matrix(Vector2f())); diff --git a/test/stdvector_overload.cpp b/test/stdvector_overload.cpp index 0c86ce8a4..5c042a64c 100644 --- a/test/stdvector_overload.cpp +++ b/test/stdvector_overload.cpp @@ -131,7 +131,7 @@ void check_stdvector_quaternion(const QuaternionType&) } } -void test_stdvector_overload() +EIGEN_DECLARE_TEST(stdvector_overload) { // some non vectorizable fixed sizes CALL_SUBTEST_1(check_stdvector_matrix(Vector2f())); diff --git a/test/superlu_support.cpp b/test/superlu_support.cpp index 98a7bc5c8..55450c868 100644 --- a/test/superlu_support.cpp +++ b/test/superlu_support.cpp @@ -12,7 +12,7 @@ #include <Eigen/SuperLUSupport> -void test_superlu_support() +EIGEN_DECLARE_TEST(superlu_support) { SuperLU<SparseMatrix<double> > superlu_double_colmajor; SuperLU<SparseMatrix<std::complex<double> > > superlu_cplxdouble_colmajor; diff --git a/test/swap.cpp b/test/swap.cpp index a294da719..5b259d3ec 100644 --- a/test/swap.cpp +++ b/test/swap.cpp @@ -83,7 +83,7 @@ template<typename MatrixType> void swap(const MatrixType& m) } } -void test_swap() +EIGEN_DECLARE_TEST(swap) { int s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE); CALL_SUBTEST_1( swap(Matrix3f()) ); // fixed size, no vectorization diff --git a/test/symbolic_index.cpp b/test/symbolic_index.cpp index 4c079857b..cf89b9fbe 100644 --- a/test/symbolic_index.cpp +++ b/test/symbolic_index.cpp @@ -113,7 +113,7 @@ void check_symbolic_index() #endif } -void test_symbolic_index() +EIGEN_DECLARE_TEST(symbolic_index) { CALL_SUBTEST_1( check_symbolic_index() ); CALL_SUBTEST_2( check_symbolic_index() ); diff --git a/test/triangular.cpp b/test/triangular.cpp index d50342ccc..73b6fc46b 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -220,7 +220,7 @@ void bug_159() EIGEN_UNUSED_VARIABLE(m) } -void test_triangular() +EIGEN_DECLARE_TEST(triangular) { int maxsize = (std::min)(EIGEN_TEST_MAX_SIZE,20); for(int i = 0; i < g_repeat ; i++) diff --git a/test/umeyama.cpp b/test/umeyama.cpp index 2e8092434..1590a0a81 100644 --- a/test/umeyama.cpp +++ b/test/umeyama.cpp @@ -155,7 +155,7 @@ void run_fixed_size_test(int num_elements) VERIFY(error < Scalar(16)*std::numeric_limits<Scalar>::epsilon()); } -void test_umeyama() +EIGEN_DECLARE_TEST(umeyama) { for (int i=0; i<g_repeat; ++i) { diff --git a/test/umfpack_support.cpp b/test/umfpack_support.cpp index 0378801f4..d8f2a6f80 100644 --- a/test/umfpack_support.cpp +++ b/test/umfpack_support.cpp @@ -24,7 +24,7 @@ template<typename T1, typename T2> void test_umfpack_support_T() check_sparse_square_determinant(umfpack_rowmajor); } -void test_umfpack_support() +EIGEN_DECLARE_TEST(umfpack_support) { CALL_SUBTEST_1((test_umfpack_support_T<double, int>())); CALL_SUBTEST_2((test_umfpack_support_T<std::complex<double>, int>())); diff --git a/test/unalignedassert.cpp b/test/unalignedassert.cpp index 731a08977..120cc42bb 100644 --- a/test/unalignedassert.cpp +++ b/test/unalignedassert.cpp @@ -174,7 +174,7 @@ void unalignedassert() #endif } -void test_unalignedassert() +EIGEN_DECLARE_TEST(unalignedassert) { CALL_SUBTEST(unalignedassert()); } diff --git a/test/unalignedcount.cpp b/test/unalignedcount.cpp index d6ffeafdf..069fc1bb9 100644 --- a/test/unalignedcount.cpp +++ b/test/unalignedcount.cpp @@ -28,7 +28,7 @@ static int nb_storeu; #include "main.h" -void test_unalignedcount() +EIGEN_DECLARE_TEST(unalignedcount) { #if defined(EIGEN_VECTORIZE_AVX) VectorXf a(40), b(40); diff --git a/test/upperbidiagonalization.cpp b/test/upperbidiagonalization.cpp index 27a747875..945c99959 100644 --- a/test/upperbidiagonalization.cpp +++ b/test/upperbidiagonalization.cpp @@ -29,7 +29,7 @@ template<typename MatrixType> void upperbidiag(const MatrixType& m) VERIFY_IS_APPROX(a.adjoint(),d); } -void test_upperbidiagonalization() +EIGEN_DECLARE_TEST(upperbidiagonalization) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( upperbidiag(MatrixXf(3,3)) ); diff --git a/test/vectorization_logic.cpp b/test/vectorization_logic.cpp index 37e7495f5..01b55e192 100644 --- a/test/vectorization_logic.cpp +++ b/test/vectorization_logic.cpp @@ -386,7 +386,7 @@ template<typename Scalar> struct vectorization_logic_half<Scalar,false> static void run() {} }; -void test_vectorization_logic() +EIGEN_DECLARE_TEST(vectorization_logic) { #ifdef EIGEN_VECTORIZE diff --git a/test/vectorwiseop.cpp b/test/vectorwiseop.cpp index a099d17c8..2d7ddbed1 100644 --- a/test/vectorwiseop.cpp +++ b/test/vectorwiseop.cpp @@ -237,7 +237,7 @@ template<typename MatrixType> void vectorwiseop_matrix(const MatrixType& m) VERIFY_EVALUATION_COUNT( m2 = (m1.rowwise() - m1.colwise().sum()/RealScalar(m1.rows())), (MatrixType::RowsAtCompileTime!=1 ? 1 : 0) ); } -void test_vectorwiseop() +EIGEN_DECLARE_TEST(vectorwiseop) { CALL_SUBTEST_1( vectorwiseop_array(Array22cd()) ); CALL_SUBTEST_2( vectorwiseop_array(Array<double, 3, 2>()) ); diff --git a/test/visitor.cpp b/test/visitor.cpp index 7f4efab97..de938fc95 100644 --- a/test/visitor.cpp +++ b/test/visitor.cpp @@ -113,7 +113,7 @@ template<typename VectorType> void vectorVisitor(const VectorType& w) VERIFY(eigen_maxidx == (std::min)(idx0,idx2)); } -void test_visitor() +EIGEN_DECLARE_TEST(visitor) { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( matrixVisitor(Matrix<float, 1, 1>()) ); diff --git a/test/zerosized.cpp b/test/zerosized.cpp index 477ff0070..edd1f6925 100644 --- a/test/zerosized.cpp +++ b/test/zerosized.cpp @@ -81,7 +81,7 @@ template<typename VectorType> void zeroSizedVector() } } -void test_zerosized() +EIGEN_DECLARE_TEST(zerosized) { zeroSizedMatrix<Matrix2d>(); zeroSizedMatrix<Matrix3i>(); |