[PATCH] D40520: Make check-lit tests respect LLVM_LIT_TOOLS_DIR

Greg Bedwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 10:06:03 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL319329: Make check-lit tests respect LLVM_LIT_TOOLS_DIR (authored by gbedwell).

Changed prior to commit:
  https://reviews.llvm.org/D40520?vs=124464&id=124775#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40520

Files:
  llvm/trunk/utils/lit/tests/lit.cfg
  llvm/trunk/utils/lit/tests/lit.site.cfg.in
  llvm/trunk/utils/lit/tests/shtest-format.py


Index: llvm/trunk/utils/lit/tests/lit.site.cfg.in
===================================================================
--- llvm/trunk/utils/lit/tests/lit.site.cfg.in
+++ llvm/trunk/utils/lit/tests/lit.site.cfg.in
@@ -2,6 +2,7 @@
 
 import sys
 
+config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.llvm_src_root = "@LLVM_SOURCE_DIR@"
 config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
Index: llvm/trunk/utils/lit/tests/shtest-format.py
===================================================================
--- llvm/trunk/utils/lit/tests/shtest-format.py
+++ llvm/trunk/utils/lit/tests/shtest-format.py
@@ -16,7 +16,7 @@
 # CHECK-NEXT: line 2: failed test output on stdout
 # CHECK: Command Output (stderr):
 # CHECK-NEXT: --
-# CHECK-NEXT: cat: does-not-exist: No such file or directory
+# CHECK-NEXT: cat{{(\.exe)?}}: does-not-exist: No such file or directory
 # CHECK: --
 
 # CHECK: FAIL: shtest-format :: external_shell/fail_with_bad_encoding.txt
Index: llvm/trunk/utils/lit/tests/lit.cfg
===================================================================
--- llvm/trunk/utils/lit/tests/lit.cfg
+++ llvm/trunk/utils/lit/tests/lit.cfg
@@ -64,7 +64,10 @@
 if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
     config.available_features.add('windows')
 
-# Add llvm tools directory if this config is being loaded indirectly
-if getattr(config, 'llvm_tools_dir', None) is not None:
-    path = os.path.pathsep.join((config.llvm_tools_dir, config.environment['PATH']))
-    config.environment['PATH'] = path
+# Add llvm and lit tools directories if this config is being loaded indirectly.
+path = config.environment['PATH']
+for attribute in ('llvm_tools_dir', 'lit_tools_dir'):
+    directory = getattr(config, attribute, None)
+    if directory:
+        path = os.path.pathsep.join((directory, path))
+config.environment['PATH'] = path


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40520.124775.patch
Type: text/x-patch
Size: 1898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171129/fe0600c8/attachment.bin>


More information about the llvm-commits mailing list