about summary refs log tree commit diff homepage
path: root/test/lit.cfg
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2014-02-09 15:23:17 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2014-02-09 15:23:17 +0000
commit3c24ce15982948b911bb7910f6ab4481aced8818 (patch)
treebb3e62c51e04e6b3385dfc2cd57d42e5328d75ae /test/lit.cfg
parentf629a6d1ec51b39334c78bce354b3efb245c35b3 (diff)
parentaa9c2410b3fea708fbd6f62f346c9c864a96598e (diff)
downloadklee-3c24ce15982948b911bb7910f6ab4481aced8818.tar.gz
Merge pull request #100 from delcypher/pass-param-llvm-lit
Allow passing arbitrary command line flags to klee and kleaver when running llvm-lit
Diffstat (limited to 'test/lit.cfg')
-rw-r--r--test/lit.cfg21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/lit.cfg b/test/lit.cfg
index fcfbb7b0..23696138 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -64,10 +64,23 @@ for name in subs:
         lit.fatal('{0} is not set'.format(name))
     config.substitutions.append( ('%' + name, value))
 
-# Set absolute paths for KLEE's tools
-subs = [ ('%kleaver', 'kleaver'), ('%klee','klee') ]
-for s,basename in subs:
-    config.substitutions.append( (s, os.path.join(klee_tools_dir, basename) ) )
+# 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',"")
+
+if len(klee_extra_params) != 0:
+    print("Passing extra KLEE command line args: {0}".format(klee_extra_params))
+if len(kleaver_extra_params) != 0:
+    print("Passing extra Kleaver command line args: {0}".format(kleaver_extra_params))
+
+# Set absolute paths and extra cmdline args for KLEE's tools
+subs = [ ('%kleaver', 'kleaver', kleaver_extra_params), ('%klee','klee', klee_extra_params) ]
+for s,basename,extra_args in subs:
+    config.substitutions.append( ( s,
+                                   "{0} {1}".format( os.path.join(klee_tools_dir, basename), extra_args )
+                                 )
+                               )
 
 
 # LLVM < 3.0 doesn't Support %T directive