From 2cfdfe0ddc88c8ec9619c37fd207778dcf2824e2 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Sun, 12 Jan 2014 19:47:12 +0000 Subject: Add LLVM tool directory to PATH when running tests with llvm-lit. This is needed because the helper tool 'not' is used by some tests --- test/Makefile | 1 + test/lit.cfg | 9 ++++++++- test/lit.site.cfg.in | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index 75e05dda..b2cc0210 100644 --- a/test/Makefile +++ b/test/Makefile @@ -114,4 +114,5 @@ lit.site.cfg: site.exp @sed -e "s#@KLEE_SOURCE_DIR@#$(PROJ_SRC_ROOT)#g" \ -e "s#@KLEE_BINARY_DIR@#$(PROJ_OBJ_ROOT)#g" \ -e "s#@KLEE_TOOLS_DIR@#$(ToolDir)#g" \ + -e "s#@LLVM_TOOLS_DIR@#$(LLVMToolDir)#g" \ $(PROJ_SRC_DIR)/lit.site.cfg.in > $@ diff --git a/test/lit.cfg b/test/lit.cfg index c2144d43..e8dca065 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -22,12 +22,19 @@ klee_obj_root = getattr(config, 'klee_obj_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: klee_tools_dir = getattr(config, 'klee_tools_dir', None) if not klee_tools_dir: lit.fatal('No KLEE tools dir set!') - path = os.path.pathsep.join((klee_tools_dir, config.environment['PATH'])) + + # Check LLVM tool directory + llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) + if not llvm_tools_dir: + lit.fatal('No LLVM tool directory set!') + + path = os.path.pathsep.join((klee_tools_dir, config.environment['PATH'], llvm_tools_dir)) config.environment['PATH'] = path # Propogate 'HOME' through the environment. diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in index ec92b32d..f47d63b8 100644 --- a/test/lit.site.cfg.in +++ b/test/lit.site.cfg.in @@ -3,6 +3,7 @@ config.klee_src_root = "@KLEE_SOURCE_DIR@" config.klee_obj_root = "@KLEE_BINARY_DIR@" config.klee_tools_dir = "@KLEE_TOOLS_DIR@" +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" # Let the main config do the real work. lit.load_config(config, "@KLEE_SOURCE_DIR@/test/lit.cfg") -- cgit 1.4.1