Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#Run through each source
foreach(testSrc ${UNITTEST_SOURCES})
#Extract the filename without an extension (NAME_WE)
get_filename_component(testName ${testSrc} NAME_WE)
#Add compile target
add_executable(${testName} ${testSrc})
#link to Boost libraries AND your targets and dependencies
target_link_libraries(${testName}
RelaxSE_lib
RelaxSE_type
RelaxSE_IO
RelaxSE_common
#test_utils
${LAPACK_LIBRARIES}
${BLAS_LIBRARIES})
#I like to move testing binaries into a testBin directory
set_target_properties(${testName} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/testBin)
#Finally add it to test execution -
#Notice the WORKING_DIRECTORY and COMMAND
add_test(NAME ${testName}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testBin
COMMAND ${CMAKE_BINARY_DIR}/testBin/${testName} )
endforeach(testSrc)
macro(add_runtest _name)
add_test(
NAME ${_name}
COMMAND python3 ${CMAKE_SOURCE_DIR}/test/${_name}/test --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/${_name} --verbose --log=${CMAKE_BINARY_DIR}/test/${_name}/runtest.stderr.log)
#if(NOT "${_labels}" STREQUAL "")
set_tests_properties(${_name} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/${_name})
#endif()
endmacro()
add_runtest(CuO_20204)
add_runtest(CuO_20204_spin)
add_runtest(CuO_20240)
add_runtest(CuO_02204)
add_runtest(CuO_00800_HS)
add_runtest(CuO_00800_LS)
if(NOT ENABLE_NOGEN)
add_runtest(CuO_02240)
add_runtest(CuO_30405)
add_runtest(CuO_03450_nodet2)
add_runtest(CuO_03450_nodet3)
add_runtest(CuO_03450_nocontraction)
add_runtest(CuO_03450_allcontraction)
add_runtest(CuO_03450)
add_runtest(CuO_12423)
add_runtest(CuO_CAS+S)
add_runtest(CuO_DDCI)
add_test(NAME prop
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test/CuO_DDCI
COMMAND ${CMAKE_BINARY_DIR}/prop.x )
endif()
if(ENABLE_MPI)
add_runtest(CuO_03450_bigbatch_MPIload)
add_runtest(CuO_03450_bigbatch_noMPIload)
add_runtest(CuO_03450_smallbatch_MPIload)
add_runtest(CuO_03450_smallbatch_noMPIload)
endif()
if(ENABLE_DEV)
add_test(
NAME prop_CuO_02204
COMMAND python3 ${CMAKE_SOURCE_DIR}/test/CuO_02204/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/CuO_02204 --verbose --log=${CMAKE_BINARY_DIR}/test/CuO_02204/runtest.stderr.logprop)
set_tests_properties(prop_CuO_02204 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/CuO_02204)
add_test(
NAME prop_CuO_03450
COMMAND python3 ${CMAKE_SOURCE_DIR}/test/CuO_03450/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/CuO_03450 --verbose --log=${CMAKE_BINARY_DIR}/test/CuO_03450/runtest.stderr.logprop)
set_tests_properties(prop_CuO_03450 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/CuO_03450)