[llvm-commits] [llvm] r169441 - in /llvm/trunk: test/tools/llvm-lit/ test/tools/llvm-lit/chain.c utils/lit/lit/TestRunner.py
Richard Smith
richard-llvm at metafoo.co.uk
Wed Dec 5 14:54:26 PST 2012
Author: rsmith
Date: Wed Dec 5 16:54:26 2012
New Revision: 169441
URL: http://llvm.org/viewvc/llvm-project?rev=169441&view=rev
Log:
PR10867. lit would interpret
RUN: a
RUN: b || true
as "a && (b || true)" in Tcl mode, and as "(a && b) || true" in sh mode.
Everyone seems to (quite reasonably) write tests assuming the Tcl behavior,
so use that in sh mode too.
Added:
llvm/trunk/test/tools/llvm-lit/
llvm/trunk/test/tools/llvm-lit/chain.c
Modified:
llvm/trunk/utils/lit/lit/TestRunner.py
Added: llvm/trunk/test/tools/llvm-lit/chain.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-lit/chain.c?rev=169441&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-lit/chain.c (added)
+++ llvm/trunk/test/tools/llvm-lit/chain.c Wed Dec 5 16:54:26 2012
@@ -0,0 +1,9 @@
+// This test should fail. lit used to interpret this as:
+// (false && false) || true
+// instead of the intended
+// false && (false || true
+//
+// RUN: false
+// RUN: false || true
+//
+// XFAIL: *
Modified: llvm/trunk/utils/lit/lit/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=169441&r1=169440&r2=169441&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py (original)
+++ llvm/trunk/utils/lit/lit/TestRunner.py Wed Dec 5 16:54:26 2012
@@ -241,11 +241,16 @@
return exitCode
def executeScriptInternal(test, litConfig, tmpBase, commands, cwd):
- ln = ' &&\n'.join(commands)
- try:
- cmd = ShUtil.ShParser(ln, litConfig.isWindows).parse()
- except:
- return (Test.FAIL, "shell parser error on: %r" % ln)
+ cmds = []
+ for ln in commands:
+ try:
+ cmds.append(ShUtil.ShParser(ln, litConfig.isWindows).parse())
+ except:
+ return (Test.FAIL, "shell parser error on: %r" % ln)
+
+ cmd = cmds[0]
+ for c in cmds[1:]:
+ cmd = ShUtil.Seq(cmd, '&&', c)
results = []
try:
More information about the llvm-commits
mailing list