mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-10 02:39:03 +08:00
Simplify handling and non-splitted tests and include split_test_helper.h instead of re-generating it. This also allows us to modify it without breaking existing build folder.
This commit is contained in:
parent
901c7d31f0
commit
add5757488
@ -295,14 +295,9 @@ macro(ei_add_test testname)
|
|||||||
"${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
|
"${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
|
||||||
add_dependencies(${testname} ${testname}_${suffix})
|
add_dependencies(${testname} ${testname}_${suffix})
|
||||||
endforeach(suffix)
|
endforeach(suffix)
|
||||||
else(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
|
else()
|
||||||
set(symbols_to_enable_all_parts "")
|
ei_add_test_internal(${testname} ${testname} "${ARGV1} -DEIGEN_TEST_PART_ALL=1" "${ARGV2}")
|
||||||
foreach(suffix ${suffixes})
|
endif()
|
||||||
set(symbols_to_enable_all_parts
|
|
||||||
"${symbols_to_enable_all_parts} -DEIGEN_TEST_PART_${suffix}=1")
|
|
||||||
endforeach(suffix)
|
|
||||||
ei_add_test_internal(${testname} ${testname} "${ARGV1} ${symbols_to_enable_all_parts}" "${ARGV2}")
|
|
||||||
endif(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
|
|
||||||
endmacro(ei_add_test)
|
endmacro(ei_add_test)
|
||||||
|
|
||||||
macro(ei_add_test_sycl testname)
|
macro(ei_add_test_sycl testname)
|
||||||
|
11
scripts/eigen_gen_split_test_help.cmake
Normal file
11
scripts/eigen_gen_split_test_help.cmake
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!cmake -P
|
||||||
|
file(WRITE split_test_helper.h "")
|
||||||
|
foreach(i RANGE 1 999)
|
||||||
|
file(APPEND split_test_helper.h
|
||||||
|
"#if defined(EIGEN_TEST_PART_${i}) || defined(EIGEN_TEST_PART_ALL)\n"
|
||||||
|
"#define CALL_SUBTEST_${i}(FUNC) CALL_SUBTEST(FUNC)\n"
|
||||||
|
"#else\n"
|
||||||
|
"#define CALL_SUBTEST_${i}(FUNC)\n"
|
||||||
|
"#endif\n\n"
|
||||||
|
)
|
||||||
|
endforeach()
|
@ -1,16 +1,7 @@
|
|||||||
# generate split test header file only if it does not yet exist
|
# The file split_test_helper.h was generated at first run,
|
||||||
# in order to prevent a rebuild every time cmake is configured
|
# it is now included in test/
|
||||||
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h "")
|
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
||||||
foreach(i RANGE 1 999)
|
|
||||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h
|
|
||||||
"#if defined(EIGEN_TEST_PART_${i}) || defined(EIGEN_TEST_PART_ALL)\n"
|
|
||||||
"#define CALL_SUBTEST_${i}(FUNC) CALL_SUBTEST(FUNC)\n"
|
|
||||||
"#else\n"
|
|
||||||
"#define CALL_SUBTEST_${i}(FUNC)\n"
|
|
||||||
"#endif\n\n"
|
|
||||||
)
|
|
||||||
endforeach()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# check if we have a Fortran compiler
|
# check if we have a Fortran compiler
|
||||||
|
5994
test/split_test_helper.h
Normal file
5994
test/split_test_helper.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,7 @@
|
|||||||
# generate split test header file only if it does not yet exist
|
# The file split_test_helper.h was generated at first run,
|
||||||
# in order to prevent a rebuild every time cmake is configured
|
# it is now included in test/
|
||||||
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h "")
|
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
||||||
foreach(i RANGE 1 999)
|
|
||||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h
|
|
||||||
"#if defined(EIGEN_TEST_PART_${i}) || defined(EIGEN_TEST_PART_ALL)\n"
|
|
||||||
"#define CALL_SUBTEST_${i}(FUNC) CALL_SUBTEST(FUNC)\n"
|
|
||||||
"#else\n"
|
|
||||||
"#define CALL_SUBTEST_${i}(FUNC)\n"
|
|
||||||
"#endif\n\n"
|
|
||||||
)
|
|
||||||
endforeach()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Unsupported")
|
set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Unsupported")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user