mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix usage of EIGEN_SPLIT_LARGE_TESTS=ON: some unit tests, such as indexed_view have to be split unconditionally.
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user