summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit/tests/unit
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny.ornl@gmail.com>2018-04-24 18:43:25 +0000
committerJoel E. Denny <jdenny.ornl@gmail.com>2018-04-24 18:43:25 +0000
commit8a475307bd2fdc1a414d7f0d72c6d1a40e831b3d (patch)
treec137bd5bc6f7a94466d179043dd3bc1f014d3f5d /llvm/utils/lit/tests/unit
parent080436fd0f0a14f3b39a25242f4bb6bee8f741af (diff)
downloadbcm5719-llvm-8a475307bd2fdc1a414d7f0d72c6d1a40e831b3d.tar.gz
bcm5719-llvm-8a475307bd2fdc1a414d7f0d72c6d1a40e831b3d.zip
[lit] Report line number for failed RUN command
When debugging test failures with -vv (or -v in the case of the internal shell), this makes it easier to locate the RUN line that failed. For example, clang's test/Driver/linux-ld.c has 892 total RUN lines, and clang's test/Driver/arm-cortex-cpus.c has 424 RUN lines after concatenation for line continuations. When reading the generated shell script, this also makes it easier to locate the RUN line that produced each command. To support reporting RUN line numbers in the case of the internal shell, this patch extends the internal shell to support the null command, ":", except pipelines are not supported. Reviewed By: asmith, delcypher Differential Revision: https://reviews.llvm.org/D44598 llvm-svn: 330755
Diffstat (limited to 'llvm/utils/lit/tests/unit')
-rw-r--r--llvm/utils/lit/tests/unit/TestRunner.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/lit/tests/unit/TestRunner.py b/llvm/utils/lit/tests/unit/TestRunner.py
index 874bf275d4e..b3988b0c197 100644
--- a/llvm/utils/lit/tests/unit/TestRunner.py
+++ b/llvm/utils/lit/tests/unit/TestRunner.py
@@ -47,7 +47,7 @@ class TestIntegratedTestKeywordParser(unittest.TestCase):
@staticmethod
def make_parsers():
- def custom_parse(line_number, line, output):
+ def custom_parse(line_number, line, output, keyword):
if output is None:
output = []
output += [part for part in line.split(' ') if part.strip()]
@@ -99,8 +99,8 @@ class TestIntegratedTestKeywordParser(unittest.TestCase):
cmd_parser = self.get_parser(parsers, 'MY_RUN:')
value = cmd_parser.getValue()
self.assertEqual(len(value), 2) # there are only two run lines
- self.assertEqual(value[0].strip(), 'baz')
- self.assertEqual(value[1].strip(), 'foo bar')
+ self.assertEqual(value[0].strip(), ": 'MY_RUN: at line 4'; baz")
+ self.assertEqual(value[1].strip(), ": 'MY_RUN: at line 7'; foo bar")
def test_custom(self):
parsers = self.make_parsers()
OpenPOWER on IntegriCloud