cmake: Add build target build-tests to build all test dependencies. (#2558)
authorMathias Preiner <mathias.preiner@gmail.com>
Mon, 1 Oct 2018 22:53:30 +0000 (15:53 -0700)
committerGitHub <noreply@github.com>
Mon, 1 Oct 2018 22:53:30 +0000 (15:53 -0700)
CMakeLists.txt
test/CMakeLists.txt
test/java/CMakeLists.txt
test/regress/CMakeLists.txt
test/system/CMakeLists.txt
test/unit/CMakeLists.txt

index 4f17db83bdcd8f830de8aae3e21b990e4ccb00da..a42406dad75087f331dfd451b6ebf3f89c566e30 100644 (file)
@@ -277,7 +277,9 @@ if(ENABLE_COVERAGE)
     NAME coverage
     EXECUTABLE
       ctest -j${CTEST_NTHREADS} -LE "example"
-        --output-on-failure $(ARGS) || exit 0)
+        --output-on-failure $(ARGS) || exit 0
+    DEPENDS
+      build-tests)
 endif()
 
 if(ENABLE_DEBUG_CONTEXT_MM)
index a79e96c6503113d2d8e29a939a0b9ea57ecdc481..f601e5247ec2dcc03f2db4e1a6525ef411758d26 100644 (file)
@@ -4,6 +4,8 @@
 # > regression tests of levels 0 and 1
 # > system tests
 
+add_custom_target(build-tests)
+
 # Note: Do not add custom targets for running tests (regress, systemtests,
 # units) as dependencies to other run targets. This will result in executing
 # tests multiple times. For example, if check would depend on regress it would
@@ -12,7 +14,9 @@
 # Dependencies of check are added in the corresponding subdirectories.
 add_custom_target(check
   COMMAND
-    ctest --output-on-failure -LE "regress[2-4]" -j${CTEST_NTHREADS} $(ARGS))
+    ctest --output-on-failure -LE "regress[2-4]" -j${CTEST_NTHREADS} $(ARGS)
+  DEPENDS
+    build-tests)
 
 #-----------------------------------------------------------------------------#
 # Add subdirectories
index b6f0d035a2576a9fd9ac3e1aa8a41682a39a5b5c..169013b8437ab83cd73a422bb7e508c3e338cdcd 100644 (file)
@@ -18,7 +18,7 @@ add_jar(build-javatests
   OUTPUT_NAME javatests
 )
 add_dependencies(build-javatests cvc4jar)
-add_dependencies(check build-javatests)
+add_dependencies(build-tests build-javatests)
 
 # Add java tests to ctest
 set(classpath "${CMAKE_CURRENT_BINARY_DIR}/javatests.jar")
index 79b706fdb6c99080bab64a8cf9f2c7bc7a89648b..ecd98ddc2e8317d977c534a2c2b23e3991825aa6 100644 (file)
@@ -2080,10 +2080,7 @@ get_target_property(path_to_cvc4 cvc4-bin RUNTIME_OUTPUT_DIRECTORY)
 set(run_regress_script ${CMAKE_CURRENT_LIST_DIR}/run_regression.py)
 
 add_custom_target(build-regress DEPENDS cvc4-bin)
-add_dependencies(check build-regress)
-if(ENABLE_COVERAGE)
-  add_dependencies(coverage build-regress)
-endif()
+add_dependencies(build-tests build-regress)
 
 add_custom_target(regress
   COMMAND
index 36e6c4a37330a7f62ec6fbbde652e7ff601c17e2..9d0d8424a7c1313fc402c9a30a9babc8cb41fa83 100644 (file)
@@ -8,10 +8,7 @@ include_directories(${CMAKE_BINARY_DIR}/src)
 # > system tests
 
 add_custom_target(build-systemtests)
-add_dependencies(check build-systemtests)
-if(ENABLE_COVERAGE)
-  add_dependencies(coverage build-systemtests)
-endif()
+add_dependencies(build-tests build-systemtests)
 
 add_custom_target(systemtests
   COMMAND ctest --output-on-failure -L "system" -j${CTEST_NTHREADS} $(ARGS)
index d362870c1bef125ccebe07ded880bcbb70846e1c..aa9248e6cf8f33458b385ae54c73c58ec47aedf1 100644 (file)
@@ -14,10 +14,7 @@ include_directories(${CMAKE_BINARY_DIR}/src)
 # > unit tests
 
 add_custom_target(build-units)
-add_dependencies(check build-units)
-if(ENABLE_COVERAGE)
-  add_dependencies(coverage build-units)
-endif()
+add_dependencies(build-tests build-units)
 
 add_custom_target(units
   COMMAND ctest --output-on-failure -L "unit" -j${CTEST_NTHREADS} $(ARGS)