| … | … | @@ -102,12 +102,8 @@ ELSE (SENSORY_FOUND) |
| 102 | 102 | ENDIF (SENSORY_FOUND) |
| 103 | 103 | |
| 104 | 104 | # ---------------------------------------------------------- |
| 105 | | # Needed for unit tests |
| 106 | | |
| 107 | | FIND_PACKAGE(Cxxtest) |
| 108 | | IF (NOT CXXTEST_FOUND) |
| 109 | | MESSAGE(STATUS "CxxTest missing: needed for unit tests.") |
| 110 | | ENDIF (NOT CXXTEST_FOUND) |
| 105 | # Unit tests |
| 106 | INCLUDE(OpenCogTestOptions) |
| 111 | 107 | |
| 112 | 108 | # ---------------------------------------------------------- |
| 113 | 109 | # Guile Python and Cython |
| … | … | @@ -203,36 +199,7 @@ INCLUDE("${ATOMSPACE_DATA_DIR}/cmake/OpenCogCython.cmake") |
| 203 | 199 | # ADD_SUBDIRECTORY(lib) |
| 204 | 200 | ADD_SUBDIRECTORY(opencog) |
| 205 | 201 | |
| 206 | | IF (CXXTEST_FOUND) |
| 207 | | ADD_CUSTOM_TARGET(tests) |
| 208 | | ADD_SUBDIRECTORY(tests EXCLUDE_FROM_ALL) |
| 209 | | IF (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 210 | | # doing coverage stuff while running tests if this is the Coverage build |
| 211 | | ADD_CUSTOM_TARGET(check |
| 212 | | # TODO lcov should be found by cmake first |
| 213 | | # TODO set it up so that we can pick to run coverage per test, or |
| 214 | | # combined across all tests (the latter is MUCH faster). Use a define? |
| 215 | | # There is coverage specific stuff in AddCxxTest.cmake now... |
| 216 | | WORKING_DIRECTORY tests |
| 217 | | COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS) |
| 218 | | |
| 219 | | # This script combines the coverage analysis of each test, |
| 220 | | # then creates html in tests/lcov |
| 221 | | # Note: this should now be run separately... |
| 222 | | #COMMAND ${PROJECT_SOURCE_DIR}/scripts/combine_lcov.sh |
| 223 | | COMMENT "Running tests with coverage..." |
| 224 | | ) |
| 225 | | ELSE (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 226 | | # Coverage is disabled; test normally |
| 227 | | ADD_CUSTOM_TARGET(check |
| 228 | | DEPENDS tests |
| 229 | | WORKING_DIRECTORY tests |
| 230 | | COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS) |
| 231 | | COMMENT "Running tests..." |
| 232 | | ) |
| 233 | | ENDIF (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 234 | | |
| 235 | | ENDIF (CXXTEST_FOUND) |
| 202 | OPENCOG_SETUP_TESTING() |
| 236 | 203 | |
| 237 | 204 | ADD_CUSTOM_TARGET(cscope |
| 238 | 205 | COMMAND find opencog examples tests -name '*.cc' -o -name '*.h' -o -name '*.cxxtest' -o -name '*.scm' > ${CMAKE_SOURCE_DIR}/cscope.files |