aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2018-07-16 18:35:05 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2018-07-16 18:35:05 +0200
commit901c7d31f026cce75816cf5d954e42f22f6f5691 (patch)
treed26121d4db05fe257cd4d1ca6206f78d35f07436 /cmake
parentf2b52f9946720927fdb086da6e6d85dbed7a848d (diff)
Fix usage of EIGEN_SPLIT_LARGE_TESTS=ON: some unit tests, such as indexed_view have to be split unconditionally.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/EigenTesting.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
index 58f3697d3..5ad57ad6c 100644
--- a/cmake/EigenTesting.cmake
+++ b/cmake/EigenTesting.cmake
@@ -108,7 +108,7 @@ macro(ei_add_test_internal testname testname_with_suffix)
add_test(${testname_with_suffix} "${targetname}")
- # Specify target and test labels accoirding to EIGEN_CURRENT_SUBPROJECT
+ # Specify target and test labels according to EIGEN_CURRENT_SUBPROJECT
get_property(current_subproject GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT)
if ((current_subproject) AND (NOT (current_subproject STREQUAL "")))
set_property(TARGET ${targetname} PROPERTY LABELS "Build${current_subproject}")
@@ -276,12 +276,19 @@ macro(ei_add_test testname)
endif()
file(READ "${filename}" test_source)
- set(parts 0)
string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+|EIGEN_SUFFIXES(;[0-9]+)+"
occurrences "${test_source}")
string(REGEX REPLACE "CALL_SUBTEST_|EIGEN_TEST_PART_|EIGEN_SUFFIXES" "" suffixes "${occurrences}")
list(REMOVE_DUPLICATES suffixes)
- if(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
+ set(explicit_suffixes "")
+ if( (NOT EIGEN_SPLIT_LARGE_TESTS) AND suffixes)
+ # Check whether we have EIGEN_TEST_PART_* statements, in which case we likely must enforce splitting.
+ # For instance, indexed_view activate a different c++ version for each part.
+ string(REGEX MATCHALL "EIGEN_TEST_PART_[0-9]+" occurrences "${test_source}")
+ string(REGEX REPLACE "EIGEN_TEST_PART_" "" explicit_suffixes "${occurrences}")
+ list(REMOVE_DUPLICATES explicit_suffixes)
+ endif()
+ if( (EIGEN_SPLIT_LARGE_TESTS AND suffixes) OR explicit_suffixes)
add_custom_target(${testname})
foreach(suffix ${suffixes})
ei_add_test_internal(${testname} ${testname}_${suffix}