summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
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/CMakeLists.txt
parent79e866c5150a1d8e4d613f1673bfbf33eb157653 (diff)
cmake: Fix test target dependency issues. (#2540)
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt33
1 files changed, 16 insertions, 17 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 44cf5a651..b85ecf9e7 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,4 +1,20 @@
#-----------------------------------------------------------------------------#
+# Add target 'check', builds and runs
+# > unit tests
+# > regression tests of levels 0 and 1
+# > system 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
+# first run the command of the regress target (i.e., run all regression tests)
+# and afterwards run the command specified for the check target.
+# 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))
+
+#-----------------------------------------------------------------------------#
# Add subdirectories
add_subdirectory(regress)
@@ -11,20 +27,3 @@ endif()
if(ENABLE_UNIT_TESTING)
add_subdirectory(unit EXCLUDE_FROM_ALL)
endif()
-
-#-----------------------------------------------------------------------------#
-# Add target 'check', builds and runs
-# > unit tests
-# > regression tests of levels 0 and 1
-# > system tests
-
-add_custom_target(check
- COMMAND
- ctest --output-on-failure -LE "regress[2-4]" -j${CTEST_NTHREADS} $(ARGS)
- DEPENDS regress systemtests)
-if(BUILD_BINDINGS_JAVA)
- add_dependencies(check cvc4javatests)
-endif()
-if(ENABLE_UNIT_TESTING)
- add_dependencies(check units)
-endif()
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback