[PATCH] D31423: Add LIT_USE_INTERNAL_SHELL to compiler-rt tests

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 08:50:41 PDT 2017


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

I am working on improving our internal bot infrastructure. One thing that is unique to the ps4 is that we want to run the posix tests, but have to execute them on windows.

We currently have a local hack to use a shell on windows, but it is pretty much impossible to get all all the tools to play nice with all the heuristics for what is a path and what is a command line option.

This adds support LIT_USE_INTERNAL_SHELL and I will then try to fix the tests that fail with it but adding the missing features.

Is there a way to share this code with llvm? clang also has it duplicated.


https://reviews.llvm.org/D31423

Files:
  compiler-rt/test/lit.common.cfg


Index: compiler-rt/test/lit.common.cfg
===================================================================
--- compiler-rt/test/lit.common.cfg
+++ compiler-rt/test/lit.common.cfg
@@ -11,8 +11,19 @@
 import lit.formats
 import lit.util
 
-# Setup test format. Use bash on Unix and the lit shell on Windows.
-execute_external = (not sys.platform in ['win32'])
+
+# Choose between lit's internal shell pipeline runner and a real shell.  If
+# LIT_USE_INTERNAL_SHELL is in the environment, we use that as an override.
+use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
+if use_lit_shell:
+    # 0 is external, "" is default, and everything else is internal.
+    execute_external = (use_lit_shell == "0")
+else:
+    # Otherwise we default to internal on Windows and external elsewhere, as
+    # bash on Windows is usually very slow.
+    execute_external = (not sys.platform in ['win32'])
+
+# Setup test format.
 config.test_format = lit.formats.ShTest(execute_external)
 if execute_external:
   config.available_features.add('shell')


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31423.93248.patch
Type: text/x-patch
Size: 1041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170328/bae31d51/attachment-0001.bin>


More information about the llvm-commits mailing list