blob: 21d27c7da516c581258769d21e6bcb1345996db1 (
plain)
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
|
include(ProcessorCount)
ProcessorCount(PROCESSORS)
if (NOT PROCESSORS EQUAL 0)
math(EXPR JOBS "${PROCESSORS} * 2")
set(CTEST_BUILD_FLAGS -j${JOBS})
endif()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_BUILD_FLAGS})
add_subdirectory(unit)
if (HAVE_BOOST_PYTHON)
set(TEST_PYTHON_FLAGS "--python")
endif()
macro(add_ledger_harness_tests _class)
if (PYTHONINTERP_FOUND)
file(GLOB ${_class}_TESTS *.test)
foreach(TestFile ${${_class}_TESTS})
get_filename_component(TestFile_Name ${TestFile} NAME_WE)
string(FIND ${TestFile_Name} "_py" TestFile_IsPythonTest)
if ((TestFile_IsPythonTest EQUAL -1) OR HAVE_BOOST_PYTHON)
add_test(NAME ${_class}Test_${TestFile_Name}
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/RegressTests.py
$<TARGET_FILE:ledger> ${PROJECT_SOURCE_DIR}
${TestFile} ${TEST_PYTHON_FLAGS})
set_target_properties(check
PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
endif()
endforeach()
endif()
endmacro(add_ledger_harness_tests _class)
add_subdirectory(manual)
add_subdirectory(baseline)
add_subdirectory(regress)
# jww (2014-04-17): This is temporary until we find a fix.
#if (PYTHONINTERP_FOUND)
# set(_class DocTests)
# file(GLOB ${_class}_TESTS ${PROJECT_SOURCE_DIR}/doc/*.texi)
# foreach(TestFile ${${_class}_TESTS})
# get_filename_component(TestFile_Name ${TestFile} NAME_WE)
# add_test(NAME ${_class}Test_${TestFile_Name}
# COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/DocTests.py
# --ledger $<TARGET_FILE:ledger> --file ${TestFile})
# set_target_properties(check PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
# endforeach()
#endif()
### CMakeLists.txt ends here
|