about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2017-01-18 11:02:52 +0000
committerGitHub <noreply@github.com>2017-01-18 11:02:52 +0000
commitb149dfa242753004d8fb00c4aa55e340d56c0d43 (patch)
treeb0a925e1de936f9b19369c18780a7492eb163f48
parentaedbca881945da47005835a405188041b40ae7cc (diff)
parent1fce0acbf4498595e3901a6f7fdbe429587e3ef0 (diff)
downloadklee-b149dfa242753004d8fb00c4aa55e340d56c0d43.tar.gz
Merge pull request #546 from delcypher/cmake_rename_test_targets
[CMake] Rename "integrationtests" to "systemtests", removed some undocumented targets and other build changes
-rwxr-xr-x.travis/klee.sh2
-rw-r--r--CMakeLists.txt27
-rw-r--r--Makefile.rules41
-rw-r--r--README-CMake.md4
-rw-r--r--test/CMakeLists.txt4
-rw-r--r--test/Makefile14
-rw-r--r--tools/klee-stats/CMakeLists.txt2
-rw-r--r--tools/ktest-tool/CMakeLists.txt2
8 files changed, 36 insertions, 60 deletions
diff --git a/.travis/klee.sh b/.travis/klee.sh
index 7ecfe78a..09fb175a 100755
--- a/.travis/klee.sh
+++ b/.travis/klee.sh
@@ -191,7 +191,7 @@ fi
 # lit tests
 ###############################################################################
 if [ "X${USE_CMAKE}" == "X1" ]; then
-  make integrationtests
+  make systemtests
 else
   # Note can't use ``make check`` because llvm-lit is not available
   cd test
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e860f3e2..80224283 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,11 @@ if (POLICY CMP0042)
   cmake_policy(SET CMP0042 NEW)
 endif()
 
+if (POLICY CMP0037)
+  # Disallow reserved target names
+  cmake_policy(SET CMP0037 NEW)
+endif()
+
 # This overrides the default flags for the different CMAKE_BUILD_TYPEs
 set(CMAKE_USER_MAKE_RULES_OVERRIDE_C
   "${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flags_override.cmake")
@@ -699,26 +704,28 @@ if ((NOT LIT_TOOL) OR (NOT EXISTS "${LIT_TOOL}"))
     message(STATUS "Using lit: ${LIT_TOOL}")
   endif()
 
-  option(ENABLE_UNIT_TESTS "Enable unittests" ON)
+  # Add global test target
+  add_custom_target(check
+    COMMENT "Running tests"
+  )
+
+  option(ENABLE_UNIT_TESTS "Enable unit tests" ON)
   if (ENABLE_UNIT_TESTS)
     message(STATUS "Unit tests enabled")
     add_subdirectory(unittests)
+    add_dependencies(check unittests)
   else()
     message(STATUS "Unit tests disabled")
   endif()
-  option(ENABLE_INTEGRATION_TESTS "Enable integration tests" ON)
-  if (ENABLE_INTEGRATION_TESTS)
-    message(STATUS "Integration tests enabled")
+  option(ENABLE_SYSTEM_TESTS "Enable system tests" ON)
+  if (ENABLE_SYSTEM_TESTS)
+    message(STATUS "System tests enabled")
     add_subdirectory(test)
+    add_dependencies(check systemtests)
   else()
-    message(STATUS "Integration tests disabled")
+    message(STATUS "System tests disabled")
   endif()
 
-  # Add global test target
-  add_custom_target(check
-    DEPENDS unittests integrationtests
-    COMMENT "Running tests"
-  )
 else()
   message(STATUS "Testing disabled")
 endif()
diff --git a/Makefile.rules b/Makefile.rules
index 20e19e26..d74b1c42 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -21,10 +21,10 @@
 #--------------------------------------------------------------------
 RecursiveTargets := all clean clean-all install uninstall install-bytecode \
                     unitcheck
-LocalTargets     := all-local clean-local clean-all-local check-local \
+LocalTargets     := all-local clean-local clean-all-local systemtests-local \
                     install-local printvars uninstall-local \
 		    install-bytecode-local
-TopLevelTargets  := check dist dist-check dist-clean dist-gzip dist-bzip2 \
+TopLevelTargets  := check systemtests dist dist-check dist-clean dist-gzip dist-bzip2 \
                     dist-zip unittests
 UserTargets      := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
 InternalTargets  := preconditions distdir dist-hook
@@ -1856,14 +1856,19 @@ endif
 endif
 
 ###############################################################################
+# Global target to run all tests
+###############################################################################
+check:: systemtests unittests
+
+###############################################################################
 # CHECK: Running the test suite
 ###############################################################################
 
-check::
+systemtests::
 	$(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
 	  if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
 	    $(EchoCmd) Running test suite ; \
-	    $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
+	    $(MAKE) -C $(PROJ_OBJ_ROOT)/test systemtests-local \
 	      TESTSUITE=$(TESTSUITE) ; \
 	  else \
 	    $(EchoCmd) No Makefile in test directory ; \
@@ -1872,32 +1877,6 @@ check::
 	  $(EchoCmd) No test directory ; \
 	fi
 
-check-lit:: check
-
-check-dg::
-	$(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
-	  if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
-	    $(EchoCmd) Running test suite ; \
-	    $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
-	  else \
-	    $(EchoCmd) No Makefile in test directory ; \
-	  fi ; \
-	else \
-	  $(EchoCmd) No test directory ; \
-	fi
-
-check-all::
-	$(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
-	  if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
-	    $(EchoCmd) Running test suite ; \
-	    $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
-	  else \
-	    $(EchoCmd) No Makefile in test directory ; \
-	  fi ; \
-	else \
-	  $(EchoCmd) No test directory ; \
-	fi
-
 ###############################################################################
 # UNITTESTS: Running the unittests test suite
 ###############################################################################
@@ -2001,7 +1980,7 @@ dist-check:: $(DistTarGZip)
 	  ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
 	    --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
 	  $(MAKE) all && \
-	  $(MAKE) check && \
+	  $(MAKE) systemtests && \
 	  $(MAKE) unittests && \
 	  $(MAKE) install && \
 	  $(MAKE) uninstall && \
diff --git a/README-CMake.md b/README-CMake.md
index 991694cd..896ddda6 100644
--- a/README-CMake.md
+++ b/README-CMake.md
@@ -10,7 +10,7 @@ its autoconf/Makefile based build system.
 * `docs` - Build documentation
 * `edit_cache` - Show cmake/ccmake/cmake-gui interface for chaning configure options.
 * `help` - Show list of top level targets
-* `integrationtests` - Run integration tests
+* `systemtests` - Run system tests
 * `unittests` - Build and run unittests
 
 ## Useful CMake variables
@@ -36,7 +36,7 @@ cmake -DCMAKE_BUILD_TYPE=Release /path/to/klee/src
 
 * `ENABLE_DOXYGEN` (BOOLEAN) - Enable building doxygen documentation.
 
-* `ENABLE_INTEGRATION_TESTS` (BOOLEAN) - Enable KLEE integration tests.
+* `ENABLE_SYSTEM_TESTS` (BOOLEAN) - Enable KLEE system tests.
 
 * `ENABLE_KLEE_ASSERTS` (BOOLEAN) - Enable assertions when building KLEE.
 
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0ae78faf..9f565444 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -126,10 +126,10 @@ configure_file(lit.site.cfg.in
   @ONLY
 )
 
-add_custom_target(integrationtests
+add_custom_target(systemtests
   COMMAND "${LIT_TOOL}" ${LIT_ARGS} "${CMAKE_CURRENT_BINARY_DIR}"
   DEPENDS klee kleaver kleeRuntest
-  COMMENT "Running integration tests"
+  COMMENT "Running system tests"
   ${ADD_CUSTOM_COMMAND_USES_TERMINAL_ARG}
 )
 
diff --git a/test/Makefile b/test/Makefile
index ed7ba197..c96ae889 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -13,7 +13,7 @@ DIRS   =
 #
 # Make llvm-lit the default for testing
 #
-all:: check-local
+all:: systemtests-local
 
 # Include other test rules
 include Makefile.tests
@@ -45,17 +45,7 @@ endif
 # Potential support in the future for multiple test suites
 LIT_ALL_TESTSUITES := $(LIT_TESTSUITE)
 
-check-local:: lit.site.cfg
-	$(Verb) $(MAKE) -s clean
-	$(Verb) ( $(ULIMIT) \
-	          $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_TESTSUITE) )
-	$(Verb) klee_last_path=$$(find . -name klee-last | head -1); \
-	 if [ ! -z "$$klee_last_path" ]; then \
-	  echo "error: one of the tests failed to use --output-dir, found: $$klee_last_path"; \
-	  exit 1; \
-	fi
-
-check-local-all:: lit.site.cfg
+systemtests-local:: lit.site.cfg
 	$(Verb) ( $(ULIMIT) \
 	          $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_ALL_TESTSUITES) )
 
diff --git a/tools/klee-stats/CMakeLists.txt b/tools/klee-stats/CMakeLists.txt
index c742f430..e5f21162 100644
--- a/tools/klee-stats/CMakeLists.txt
+++ b/tools/klee-stats/CMakeLists.txt
@@ -9,5 +9,5 @@
 install(PROGRAMS klee-stats DESTINATION bin)
 
 # Copy into the build directory's binary directory
-# so integration tests can find it
+# so system tests can find it
 configure_file(klee-stats "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/klee-stats" COPYONLY)
diff --git a/tools/ktest-tool/CMakeLists.txt b/tools/ktest-tool/CMakeLists.txt
index 76e31ac0..dbb00e91 100644
--- a/tools/ktest-tool/CMakeLists.txt
+++ b/tools/ktest-tool/CMakeLists.txt
@@ -9,5 +9,5 @@
 install(PROGRAMS ktest-tool DESTINATION bin)
 
 # Copy into the build directory's binary directory
-# so integration tests can find it
+# so system tests can find it
 configure_file(ktest-tool "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ktest-tool" COPYONLY)