| … | … | @@ -108,14 +108,6 @@ ELSE (COGSERVER_FOUND) |
| 108 | 108 | MESSAGE(STATUS "CogServer missing: needed for unit tests.") |
| 109 | 109 | ENDIF (COGSERVER_FOUND) |
| 110 | 110 | |
| 111 | | # ---------------------------------------------------------- |
| 112 | | # Needed for unit tests |
| 113 | | |
| 114 | | FIND_PACKAGE(Cxxtest) |
| 115 | | IF (NOT CXXTEST_FOUND) |
| 116 | | MESSAGE(STATUS "CxxTest missing: needed for unit tests.") |
| 117 | | ENDIF (NOT CXXTEST_FOUND) |
| 118 | | |
| 119 | 111 | # ---------------------------------------------------------- |
| 120 | 112 | # Guile Python and Cython |
| 121 | 113 | |
| … | … | @@ -153,42 +145,11 @@ INCLUDE(OpenCogGuile) |
| 153 | 145 | |
| 154 | 146 | ADD_SUBDIRECTORY(opencog) |
| 155 | 147 | |
| 156 | | IF (CXXTEST_FOUND) |
| 157 | | ENABLE_TESTING() |
| 158 | | ADD_CUSTOM_TARGET(tests) |
| 159 | | ADD_SUBDIRECTORY(tests EXCLUDE_FROM_ALL) |
| 160 | | IF (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 161 | | # doing coverage stuff while running tests if this is the Coverage build |
| 162 | | ADD_CUSTOM_TARGET(test |
| 163 | | # TODO lcov should be found by cmake first |
| 164 | | # TODO set it up so that we can pick to run coverage per test, or |
| 165 | | # combined across all tests (the latter is MUCH faster). Use a define? |
| 166 | | # There is coverage specific stuff in AddCxxTest.cmake now... |
| 167 | | WORKING_DIRECTORY tests |
| 168 | | COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS) |
| 169 | | |
| 170 | | # This script combines the coverage analysis of each test, |
| 171 | | # then creates html in tests/lcov |
| 172 | | # Note: this should now be run separately... |
| 173 | | #COMMAND ${PROJECT_SOURCE_DIR}/scripts/combine_lcov.sh |
| 174 | | COMMENT "Running tests with coverage..." |
| 175 | | ) |
| 176 | | ELSE (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 177 | | # If this is a build with coverage disabled then test normally |
| 178 | | ADD_CUSTOM_TARGET(check |
| 179 | | DEPENDS tests |
| 180 | | WORKING_DIRECTORY tests |
| 181 | | COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS) |
| 182 | | COMMENT "Running tests..." |
| 183 | | ) |
| 184 | | ADD_CUSTOM_TARGET(test_storage |
| 185 | | DEPENDS tests |
| 186 | | WORKING_DIRECTORY tests/persist/cog-storage |
| 187 | | COMMAND ${CMAKE_CTEST_COMMAND} $(ARGS) |
| 188 | | COMMENT "Running tests..." |
| 189 | | ) |
| 190 | | ENDIF (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 191 | | ENDIF (CXXTEST_FOUND) |
| 148 | # ---------------------------------------------------------- |
| 149 | # Unit tests |
| 150 | INCLUDE(OpenCogTestOptions) |
| 151 | OPENCOG_SETUP_TESTING() |
| 152 | OPENCOG_ADD_TEST_TARGET(test_storage tests/persist/cog-storage "Running CogStorage tests...") |
| 192 | 153 | |
| 193 | 154 | ADD_CUSTOM_TARGET(cscope |
| 194 | 155 | COMMAND find opencog examples tests -name '*.cc' -o -name '*.h' -o -name '*.cxxtest' -o -name '*.scm' > ${CMAKE_SOURCE_DIR}/cscope.files |