about summary refs log tree commit diff homepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit.cfg19
-rw-r--r--test/lit.site.cfg.in9
-rw-r--r--test/regression/2007-08-08-free-zero.c4
3 files changed, 28 insertions, 4 deletions
diff --git a/test/lit.cfg b/test/lit.cfg
index 23696138..3d00da53 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -3,6 +3,15 @@
 # Configuration file for the 'lit' test runner.
 
 import os
+import sys
+import re
+import platform
+
+try:
+   import lit.util
+   import lit.formats
+except ImportError:
+   pass
 
 # name: The name of this test suite.
 config.name = 'KLEE'
@@ -66,8 +75,14 @@ for name in subs:
 
 # Get KLEE and Kleaver specific parameters passed on llvm-lit cmd line
 # e.g. llvm-lit --param klee_opts=--help
-klee_extra_params = lit.params.get('klee_opts',"")
-kleaver_extra_params = lit.params.get('kleaver_opts',"")
+try:
+  lit.params
+except AttributeError:
+  klee_extra_params = lit_config.params.get('klee_opts',"")
+  kleaver_extra_params = lit_config.params.get('kleaver_opts',"")
+else:
+  klee_extra_params = lit.params.get('klee_opts',"")
+  kleaver_extra_params = lit.params.get('kleaver_opts',"")
 
 if len(klee_extra_params) != 0:
     print("Passing extra KLEE command line args: {0}".format(klee_extra_params))
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 6fc3d49c..14ba94e6 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -22,4 +22,11 @@ config.have_selinux = True if @HAVE_SELINUX@ == 1 else False
 config.target_triple = "@TARGET_TRIPLE@"
 
 # Let the main config do the real work.
-lit.load_config(config, "@KLEE_SOURCE_DIR@/test/lit.cfg")
+try:
+  lit
+except NameError:
+  # Use lit_config class
+  lit_config.load_config(config, "@KLEE_SOURCE_DIR@/test/lit.cfg")
+else:
+  # Use old lit class
+  lit.load_config(config, "@KLEE_SOURCE_DIR@/test/lit.cfg")
diff --git a/test/regression/2007-08-08-free-zero.c b/test/regression/2007-08-08-free-zero.c
index 964889a1..935b04fd 100644
--- a/test/regression/2007-08-08-free-zero.c
+++ b/test/regression/2007-08-08-free-zero.c
@@ -1,6 +1,8 @@
 // RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc
 // RUN: %klee %t1.bc
-// RUN: ls klee-last | not grep *.err
+// RUN: ls %T/klee-last | not grep *.err
+
+#include <stdlib.h>
 
 int main() {
   free(0);