about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rwxr-xr-xscripts/build/run-tests.sh6
-rw-r--r--test/CMakeLists.txt3
-rw-r--r--test/lit.cfg10
3 files changed, 14 insertions, 5 deletions
diff --git a/scripts/build/run-tests.sh b/scripts/build/run-tests.sh
index 927cf160..48337f40 100755
--- a/scripts/build/run-tests.sh
+++ b/scripts/build/run-tests.sh
@@ -37,6 +37,12 @@ run_tests() {
   # TODO change to pinpoint specific directory
   cd "${build_dir}"
 
+  # Remove klee from PATH
+  export PATH=${PATH%":/home/klee/klee_build/bin"}
+  if which klee; then
+    return 1 # should not happen
+  fi
+
   ###############################################################################
   # Unit tests
   ###############################################################################
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2ff9b0eb..2a968333 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -71,6 +71,9 @@ if (NOT EXISTS "${LLVM_TOOLS_BINARY_DIR}/not")
   set(DOWNLOAD_NOT_SOURCE TRUE)
 endif()
 
+# Do not build FileCheck and not to ${KLEE_TOOLS_DIR} as it will not be in lit's PATH.
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${KLEE_TOOLS_DIR}/testtools)
+
 if (DOWNLOAD_FILECHECK_SOURCE)
   if (${LLVM_VERSION_MAJOR} GREATER 3)
     set(FILECHECK_SRC_URL "https://raw.githubusercontent.com/llvm/llvm-project/release/${LLVM_VERSION_MAJOR}.x/llvm/utils/FileCheck/FileCheck.cpp")
diff --git a/test/lit.cfg b/test/lit.cfg
index 6a02daee..a195a1dc 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -35,21 +35,21 @@ klee_src_root = getattr(config, 'klee_src_root', None)
 if klee_obj_root is not None:
   config.test_exec_root = os.path.join(klee_obj_root, 'test')
 
-# Tweak the PATH to include the tool dir.
-if klee_obj_root is not None:
+  # Check KLEE tools directory
   klee_tools_dir = getattr(config, 'klee_tools_dir', None)
   if not klee_tools_dir:
     lit_config.fatal('No KLEE tools dir set!')
 
-  # Check LLVM tool directory
+  # Check LLVM tools directory
   llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
   if not llvm_tools_dir:
-    lit_config.fatal('No LLVM tool directory set!')
+    lit_config.fatal('No LLVM tools directory set!')
 
+  # Add LLVM tools and FileCheck with not to PATH
   path = os.path.pathsep.join(
     (
+      os.path.join(klee_tools_dir, "testtools"),
       llvm_tools_dir,
-      klee_tools_dir,
       config.environment['PATH']
     )
   )