include_directories(${PROJECT_SOURCE_DIR}/src/include)
include_directories(${CMAKE_BINARY_DIR}/src)
+add_custom_target(systemtests COMMAND ctest --output-on-failure -L "system" $(ARGS))
+
set(CVC4_SYSTEM_TEST_FLAGS
-D__BUILDING_CVC4_SYSTEM_TEST -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS)
target_compile_definitions(${name} PRIVATE ${CVC4_SYSTEM_TEST_FLAGS})
add_test(system/${name} ${CMAKE_CURRENT_BINARY_DIR}/${name})
set_tests_properties(system/${name} PROPERTIES LABELS "system")
+ add_dependencies(systemtests ${name})
+ if(ENABLE_COVERAGE)
+ add_dependencies(coverage ${name})
+ endif()
endmacro()
cvc4_add_system_test(boilerplate)
cvc4_add_system_test(statistics)
cvc4_add_system_test(two_smt_engines)
#TODO java test (needs bindings)
-
-add_custom_target(systemtests COMMAND ctest --output-on-failure -L "system" $(ARGS))
-if(ENABLE_UNIT_TESTING)
- include_directories(.)
- include_directories(${PROJECT_SOURCE_DIR}/src)
- include_directories(${PROJECT_SOURCE_DIR}/src/include)
- include_directories(${CMAKE_BINARY_DIR}/src)
+include_directories(.)
+include_directories(${PROJECT_SOURCE_DIR}/src)
+include_directories(${PROJECT_SOURCE_DIR}/src/include)
+include_directories(${CMAKE_BINARY_DIR}/src)
- set(CVC4_CXXTEST_FLAGS_BLACK
- -D__BUILDING_CVC4LIB_UNIT_TEST -D__BUILDING_CVC4PARSERLIB_UNIT_TEST
- -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS)
- set(CVC4_CXXTEST_FLAGS_WHITE -fno-access-control ${CVC4_CXXTEST_FLAGS_BLACK})
+add_custom_target(units COMMAND ctest -L "unit" $(ARGS))
- macro(cvc4_add_unit_test is_white name)
- cxxtest_add_test(${name} ${name}.cpp ${CMAKE_CURRENT_LIST_DIR}/${name}.h)
- set_tests_properties(${name} PROPERTIES LABELS "unit")
- target_link_libraries(${name} main)
- target_compile_definitions(${name} PRIVATE ${CVC4_CXXTEST_FLAGS_BLACK})
- if(${is_white})
- target_compile_options(${name} PRIVATE -fno-access-control)
- endif()
- # Disable the Wsuggest-override warnings for the unit tests. CxxTest generates
- # code that does not properly add the override keyword to runTest().
- target_compile_options(${name} PRIVATE -Wno-suggest-override)
- endmacro()
+set(CVC4_CXXTEST_FLAGS_BLACK
+ -D__BUILDING_CVC4LIB_UNIT_TEST -D__BUILDING_CVC4PARSERLIB_UNIT_TEST
+ -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS)
+set(CVC4_CXXTEST_FLAGS_WHITE -fno-access-control ${CVC4_CXXTEST_FLAGS_BLACK})
- macro(cvc4_add_unit_test_black name)
- cvc4_add_unit_test(FALSE ${name})
- endmacro()
- macro(cvc4_add_unit_test_white name)
- cvc4_add_unit_test(TRUE ${name})
- endmacro()
+macro(cvc4_add_unit_test is_white name)
+ cxxtest_add_test(${name} ${name}.cpp ${CMAKE_CURRENT_LIST_DIR}/${name}.h)
+ set_tests_properties(${name} PROPERTIES LABELS "unit")
+ target_link_libraries(${name} main)
+ target_compile_definitions(${name} PRIVATE ${CVC4_CXXTEST_FLAGS_BLACK})
+ if(${is_white})
+ target_compile_options(${name} PRIVATE -fno-access-control)
+ endif()
+ # Disable the Wsuggest-override warnings for the unit tests. CxxTest generates
+ # code that does not properly add the override keyword to runTest().
+ target_compile_options(${name} PRIVATE -Wno-suggest-override)
+ add_dependencies(units ${name})
+ if(ENABLE_COVERAGE)
+ add_dependencies(coverage ${name})
+ endif()
+endmacro()
- add_subdirectory(base)
- add_subdirectory(context)
- add_subdirectory(expr)
- add_subdirectory(main)
- add_subdirectory(parser)
- add_subdirectory(prop)
- add_subdirectory(theory)
- add_subdirectory(util)
+macro(cvc4_add_unit_test_black name)
+ cvc4_add_unit_test(FALSE ${name})
+endmacro()
+macro(cvc4_add_unit_test_white name)
+ cvc4_add_unit_test(TRUE ${name})
+endmacro()
- add_custom_target(units COMMAND ctest -L "unit" $(ARGS))
-endif()
+add_subdirectory(base)
+add_subdirectory(context)
+add_subdirectory(expr)
+add_subdirectory(main)
+add_subdirectory(parser)
+add_subdirectory(prop)
+add_subdirectory(theory)
+add_subdirectory(util)