| … | … | @@ -92,14 +92,6 @@ ELSE (ROCKSDB_FOUND) |
| 92 | 92 | MESSAGE(FATAL_ERROR "RocksDB was not found.") |
| 93 | 93 | ENDIF (ROCKSDB_FOUND) |
| 94 | 94 | |
| 95 | | # ---------------------------------------------------------- |
| 96 | | # Needed for unit tests |
| 97 | | |
| 98 | | FIND_PACKAGE(Cxxtest) |
| 99 | | IF (NOT CXXTEST_FOUND) |
| 100 | | MESSAGE(STATUS "CxxTest missing: needed for unit tests.") |
| 101 | | ENDIF (NOT CXXTEST_FOUND) |
| 102 | | |
| 103 | 95 | # ---------------------------------------------------------- |
| 104 | 96 | # Guile Python and Cython |
| 105 | 97 | |
| … | … | @@ -138,51 +130,12 @@ INCLUDE(OpenCogCython) |
| 138 | 130 | ADD_SUBDIRECTORY(cmake) |
| 139 | 131 | ADD_SUBDIRECTORY(opencog) |
| 140 | 132 | |
| 141 | | IF (CXXTEST_FOUND) |
| 142 | | ENABLE_TESTING() |
| 143 | | ADD_CUSTOM_TARGET(tests) |
| 144 | | ADD_SUBDIRECTORY(tests EXCLUDE_FROM_ALL) |
| 145 | | IF (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 146 | | # doing coverage stuff while running tests if this is the Coverage build |
| 147 | | ADD_CUSTOM_TARGET(check |
| 148 | | # TODO lcov should be found by cmake first |
| 149 | | # TODO set it up so that we can pick to run coverage per test, or |
| 150 | | # combined across all tests (the latter is MUCH faster). Use a define? |
| 151 | | # There is coverage specific stuff in AddCxxTest.cmake now... |
| 152 | | WORKING_DIRECTORY tests |
| 153 | | COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS) |
| 154 | | |
| 155 | | # This script combines the coverage analysis of each test, |
| 156 | | # then creates html in tests/lcov |
| 157 | | # Note: this should now be run separately... |
| 158 | | #COMMAND ${PROJECT_SOURCE_DIR}/scripts/combine_lcov.sh |
| 159 | | COMMENT "Running tests with coverage..." |
| 160 | | ) |
| 161 | | ELSE (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 162 | | # Coverage is disabled; test normally |
| 163 | | ADD_CUSTOM_TARGET(check |
| 164 | | DEPENDS tests |
| 165 | | WORKING_DIRECTORY tests |
| 166 | | COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS) |
| 167 | | COMMENT "Running tests..." |
| 168 | | ) |
| 169 | | ENDIF (CMAKE_BUILD_TYPE STREQUAL "Coverage") |
| 170 | | |
| 171 | | ADD_CUSTOM_TARGET(test_mono |
| 172 | | DEPENDS tests |
| 173 | | WORKING_DIRECTORY tests/persist/monospace |
| 174 | | COMMAND ${CMAKE_CTEST_COMMAND} $(ARGS) |
| 175 | | COMMENT "Running Monospace tests..." |
| 176 | | ) |
| 177 | | |
| 178 | | ADD_CUSTOM_TARGET(test_multi |
| 179 | | DEPENDS tests |
| 180 | | WORKING_DIRECTORY tests/persist/rocks |
| 181 | | COMMAND ${CMAKE_CTEST_COMMAND} $(ARGS) |
| 182 | | COMMENT "Running Multispace tests..." |
| 183 | | ) |
| 184 | | |
| 185 | | ENDIF (CXXTEST_FOUND) |
| 133 | INCLUDE(OpenCogTestOptions) |
| 134 | OPENCOG_SETUP_TESTING() |
| 135 | OPENCOG_ADD_TEST_TARGET(test_mono |
| 136 | tests/persist/monospace "Running Monospace tests...") |
| 137 | OPENCOG_ADD_TEST_TARGET(test_multi |
| 138 | tests/persist/rocks "Running Multispace tests...") |
| 186 | 139 | |
| 187 | 140 | ADD_CUSTOM_TARGET(cscope |
| 188 | 141 | COMMAND find opencog examples tests -name '*.cc' -o -name '*.h' -o -name '*.cxxtest' -o -name '*.scm' > ${CMAKE_SOURCE_DIR}/cscope.files |
| … | … | @@ -242,7 +195,6 @@ FIND_PACKAGE(Doxygen) |
| 242 | 195 | # =================================================================== |
| 243 | 196 | # Show a summary of what we found, what we will do. |
| 244 | 197 | |
| 245 | | SUMMARY_ADD("AtomSpace-Rocks" "AtomSpace RocksDB Backend" HAVE_ROCKSDB) |
| 246 | 198 | SUMMARY_ADD("Cython" "Cython (python) bindings" HAVE_CYTHON) |
| 247 | 199 | SUMMARY_ADD("Doxygen" "Code documentation" DOXYGEN_FOUND) |
| 248 | 200 | SUMMARY_ADD("Unit tests" "Unit tests" CXXTEST_FOUND) |