| … | … | @@ -72,14 +72,6 @@ include(Summary) |
| 72 | 72 | # =================================================================== |
| 73 | 73 | # Check for existance of various required, optional packages. |
| 74 | 74 | |
| 75 | | # ---------------------------------------------------------- |
| 76 | | # Needed for unit tests |
| 77 | | |
| 78 | | FIND_PACKAGE(Cxxtest) |
| 79 | | IF (NOT CXXTEST_FOUND) |
| 80 | | MESSAGE(STATUS "CxxTest missing: needed for unit tests.") |
| 81 | | ENDIF (NOT CXXTEST_FOUND) |
| 82 | | |
| 83 | 75 | # ---------------------------------------------------------- |
| 84 | 76 | # Guile Python and Cython |
| 85 | 77 | |
| … | … | @@ -114,36 +106,10 @@ INCLUDE(OpenCogCython) |
| 114 | 106 | ADD_SUBDIRECTORY(cmake) |
| 115 | 107 | ADD_SUBDIRECTORY(opencog) |
| 116 | 108 | |
| 117 | | IF (CXXTEST_FOUND) |
| 118 | | ADD_CUSTOM_TARGET(tests) |
| 119 | | ADD_SUBDIRECTORY(tests EXCLUDE_FROM_ALL) |
| 120 | | IF (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 121 | | # doing coverage stuff while running tests if this is the Coverage build |
| 122 | | ADD_CUSTOM_TARGET(check |
| 123 | | # TODO lcov should be found by cmake first |
| 124 | | # TODO set it up so that we can pick to run coverage per test, or |
| 125 | | # combined across all tests (the latter is MUCH faster). Use a define? |
| 126 | | # There is coverage specific stuff in AddCxxTest.cmake now... |
| 127 | | WORKING_DIRECTORY tests |
| 128 | | COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS) |
| 129 | | |
| 130 | | # This script combines the coverage analysis of each test, |
| 131 | | # then creates html in tests/lcov |
| 132 | | # Note: this should now be run separately... |
| 133 | | #COMMAND ${PROJECT_SOURCE_DIR}/scripts/combine_lcov.sh |
| 134 | | COMMENT "Running tests with coverage..." |
| 135 | | ) |
| 136 | | ELSE (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 137 | | # Coverage is disabled; test normally |
| 138 | | ADD_CUSTOM_TARGET(check |
| 139 | | DEPENDS tests |
| 140 | | WORKING_DIRECTORY tests |
| 141 | | COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS) |
| 142 | | COMMENT "Running tests..." |
| 143 | | ) |
| 144 | | ENDIF (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 145 | | |
| 146 | | ENDIF (CXXTEST_FOUND) |
| 109 | # ---------------------------------------------------------- |
| 110 | # Unit tests |
| 111 | INCLUDE(OpenCogTestOptions) |
| 112 | OPENCOG_SETUP_TESTING() |
| 147 | 113 | |
| 148 | 114 | ADD_CUSTOM_TARGET(cscope |
| 149 | 115 | COMMAND find opencog examples tests -name '*.cc' -o -name '*.h' -o -name '*.cxxtest' -o -name '*.scm' > ${CMAKE_SOURCE_DIR}/cscope.files |