summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2018-09-26 15:34:58 -0700
committerAina Niemetz <aina.niemetz@gmail.com>2018-09-26 15:34:58 -0700
commitbd866bbf75606663315c15ce4f28862e99b70cbd (patch)
tree8ef70ba013d0408072c2d73548c56a6881bf5457 /test/unit
parent79e866c5150a1d8e4d613f1673bfbf33eb157653 (diff)
cmake: Fix test target dependency issues. (#2540)
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/CMakeLists.txt14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 3d1007929..4bcb97c8e 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -7,8 +7,15 @@ include_directories(${CMAKE_BINARY_DIR}/src)
# Add target 'units', builds and runs
# > unit tests
+add_custom_target(build-units)
+add_dependencies(check build-units)
+if(ENABLE_COVERAGE)
+ add_dependencies(coverage build-units)
+endif()
+
add_custom_target(units
- COMMAND ctest --output-on-failure -L "unit" -j${CTEST_NTHREADS} $(ARGS))
+ COMMAND ctest --output-on-failure -L "unit" -j${CTEST_NTHREADS} $(ARGS)
+ DEPENDS build-units)
set(CVC4_CXXTEST_FLAGS_BLACK
-D__BUILDING_CVC4LIB_UNIT_TEST -D__BUILDING_CVC4PARSERLIB_UNIT_TEST
@@ -46,7 +53,7 @@ macro(cvc4_add_unit_test is_white name output_dir)
# 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})
+ add_dependencies(build-units ${name})
# Generate into bin/test/unit/<output_dir>.
set(test_bin_dir ${CMAKE_BINARY_DIR}/bin/test/unit/${output_dir})
set_target_properties(${name}
@@ -62,9 +69,6 @@ macro(cvc4_add_unit_test is_white name output_dir)
endif()
add_test(${test_name} ${test_bin_dir}/${name})
set_tests_properties(${test_name} PROPERTIES LABELS "unit")
- if(ENABLE_COVERAGE)
- add_dependencies(coverage ${name})
- endif()
endmacro()
macro(cvc4_add_unit_test_black name output_dir)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback