[lld] r237834 - [lld] Use lit's shell to run tests on Windows by default
Reid Kleckner
reid at kleckner.net
Wed May 20 13:41:46 PDT 2015
Author: rnk
Date: Wed May 20 15:41:45 2015
New Revision: 237834
URL: http://llvm.org/viewvc/llvm-project?rev=237834&view=rev
Log:
[lld] Use lit's shell to run tests on Windows by default
It's a lot faster than bash.
Also use FileCheck instead of grep to search through a binary file.
Cygwin's grep isn't working here for unknown reasons that probably
aren't worth investigating.
Modified:
lld/trunk/test/lit.cfg
lld/trunk/test/pecoff/resource.test
Modified: lld/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg?rev=237834&r1=237833&r2=237834&view=diff
==============================================================================
--- lld/trunk/test/lit.cfg (original)
+++ lld/trunk/test/lit.cfg Wed May 20 15:41:45 2015
@@ -14,12 +14,22 @@ import lit.util
# name: The name of this test suite.
config.name = 'lld'
+# 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'])
+
+
# testFormat: The test format to use to interpret tests.
#
# For now we require '&&' between commands, until they get globally killed and
# the test runner updated.
-execute_external = (platform.system() != 'Windows'
- or lit_config.getBashPath() not in [None, ""])
config.test_format = lit.formats.ShTest(execute_external)
# suffixes: A list of file extensions to treat as test files.
Modified: lld/trunk/test/pecoff/resource.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/resource.test?rev=237834&r1=237833&r2=237834&view=diff
==============================================================================
--- lld/trunk/test/pecoff/resource.test (original)
+++ lld/trunk/test/pecoff/resource.test Wed May 20 15:41:45 2015
@@ -6,7 +6,9 @@
# RUN: -- %t.obj %p/Inputs/resource.res
# Check if the binary contains UTF-16LE string "Hello" copied from resource.res.
-# RUN: cat %t.exe | grep 'H.e.l.l.o'
+# RUN: FileCheck --check-prefix=EXE %s < %t.exe
+
+EXE: {{H.e.l.l.o}}
# RUN: lld -flavor link /out:%t.exe /subsystem:console /entry:start /opt:noref \
# RUN: /manifest:embed -- %t.obj %p/Inputs/resource.res
More information about the llvm-commits
mailing list