[PATCH] D40522: Make check-compiler-rt subtarget respect LLVM_LIT_TOOLS_DIR

Greg Bedwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 14:15:39 PST 2017


gbedwell created this revision.
Herald added a subscriber: dberris.

We ran into some strange test failures on a Windows machine that didn't have *nix style commands on the path, but was setting a path to the gnuwin32 tools via LLVM_LIT_TOOLS_DIR.  Both the check-compiler-rt and check-lit tests weren't taking notice of this option.

This patch takes care of the compiler-rt part (see https://reviews.llvm.org/D40520 for the check-lit part).


https://reviews.llvm.org/D40522

Files:
  test/lit.common.cfg
  test/lit.common.configured.in


Index: test/lit.common.configured.in
===================================================================
--- test/lit.common.configured.in
+++ test/lit.common.configured.in
@@ -18,6 +18,7 @@
 set_default("compiler_rt_obj_root", "@COMPILER_RT_BINARY_DIR@")
 set_default("llvm_tools_dir", "@LLVM_TOOLS_DIR@")
 set_default("llvm_shlib_dir", "@LLVM_LIBRARY_OUTPUT_INTDIR@")
+set_default("lit_tools_dir", "@LLVM_LIT_TOOLS_DIR@")
 set_default("gold_executable", "@GOLD_EXECUTABLE@")
 set_default("clang", "@COMPILER_RT_RESOLVED_TEST_COMPILER@")
 set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@")
Index: test/lit.common.cfg
===================================================================
--- test/lit.common.cfg
+++ test/lit.common.cfg
@@ -75,10 +75,19 @@
   if name in config.environment:
     del config.environment[name]
 
+path = config.environment['PATH']
+
 # Tweak PATH to include llvm tools dir.
 if (not config.llvm_tools_dir) or (not os.path.exists(config.llvm_tools_dir)):
   lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % config.llvm_tools_dir)
-path = os.path.pathsep.join((config.llvm_tools_dir, config.environment['PATH']))
+path = os.path.pathsep.join((config.llvm_tools_dir, path))
+
+# Tweak PATH to include lit tools dir if specified.
+if config.lit_tools_dir:
+  if not os.path.exists(config.lit_tools_dir):
+    lit_config.fatal("Invalid lit_tools_dir config attribute: %r" % config.lit_tools_dir)
+  path = os.path.pathsep.join((config.lit_tools_dir, path))
+
 config.environment['PATH'] = path
 
 # Help MSVS link.exe find the standard libraries.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40522.124466.patch
Type: text/x-patch
Size: 1596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171127/d85c5c5c/attachment.bin>


More information about the llvm-commits mailing list