OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-cogserver commits / 5ebdf13

Remove cxxtest boilerplate
5ebdf134961579cef979ec04f2ae8cc68b4096ef
by Linas Vepstas <linasvepstas@gmail.com> · 2025-12-19T02:51:41.000Z

Changed files (1) +4 -38

CMakeLists.txt +4 -38
……@@ -106,14 +106,6 @@ ELSE (JSONCPP_FOUND)
106106ENDIF (JSONCPP_FOUND)
107107
108108
109# ----------------------------------------------------------
110# Needed for unit tests
111
112FIND_PACKAGE(Cxxtest)
113IF (NOT CXXTEST_FOUND)
114 MESSAGE(STATUS "CxxTest missing: needed for unit tests.")
115ENDIF (NOT CXXTEST_FOUND)
116
117109# ----------------------------------------------------------
118110# Guile Python and Cython
119111
……@@ -161,36 +153,10 @@ ADD_CUSTOM_TARGET(examples
161153 COMMENT "Building examples"
162154)
163155
164IF (CXXTEST_FOUND)
165 ENABLE_TESTING()
166 ADD_CUSTOM_TARGET(tests)
167 ADD_SUBDIRECTORY(tests EXCLUDE_FROM_ALL)
168 IF (CMAKE_BUILD_TYPE STREQUAL "Coverage")
169 # doing coverage stuff while running tests if this is the Coverage build
170 ADD_CUSTOM_TARGET(check
171 # TODO lcov should be found by cmake first
172 # TODO set it up so that we can pick to run coverage per test, or
173 # combined across all tests (the latter is MUCH faster). Use a define?
174 # There is coverage specific stuff in AddCxxTest.cmake now...
175 WORKING_DIRECTORY tests
176 COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS)
177
178 # This script combines the coverage analysis of each test,
179 # then creates html in tests/lcov
180 # Note: this should now be run separately...
181 #COMMAND ${PROJECT_SOURCE_DIR}/scripts/combine_lcov.sh
182 COMMENT "Running tests with coverage..."
183 )
184 ELSE (CMAKE_BUILD_TYPE STREQUAL "Coverage")
185 # If this is a build with coverage enabled then test normally
186 ADD_CUSTOM_TARGET(check
187 DEPENDS tests
188 WORKING_DIRECTORY tests
189 COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure $(ARGS)
190 COMMENT "Running tests..."
191 )
192 ENDIF (CMAKE_BUILD_TYPE STREQUAL "Coverage")
193ENDIF (CXXTEST_FOUND)
156# ----------------------------------------------------------
157# Unit tests
158INCLUDE(OpenCogTestOptions)
159OPENCOG_SETUP_TESTING()
194160
195161ADD_CUSTOM_TARGET(cscope
196162 COMMAND find opencog examples tests -name '*.cc' -o -name '*.h' -o -name '*.cxxtest' -o -name '*.scm' > ${CMAKE_SOURCE_DIR}/cscope.files