[lit] Report line number for failed RUN command
authorJoel E. Denny <jdenny.ornl@gmail.com>
Tue, 24 Apr 2018 18:43:25 +0000 (18:43 +0000)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Tue, 24 Apr 2018 18:43:25 +0000 (18:43 +0000)
commit8a475307bd2fdc1a414d7f0d72c6d1a40e831b3d
treec137bd5bc6f7a94466d179043dd3bc1f014d3f5d
parent080436fd0f0a14f3b39a25242f4bb6bee8f741af
[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
16 files changed:
llvm/docs/CommandGuide/lit.rst
llvm/utils/lit/lit/TestRunner.py
llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/basic.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/line-continuation.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/lit.local.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/basic.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/line-continuation.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/lit.local.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-run-at-line/lit.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-shell/colon-error.txt [new file with mode: 0644]
llvm/utils/lit/tests/max-failures.py
llvm/utils/lit/tests/shtest-format.py
llvm/utils/lit/tests/shtest-output-printing.py
llvm/utils/lit/tests/shtest-run-at-line.py [new file with mode: 0644]
llvm/utils/lit/tests/shtest-shell.py
llvm/utils/lit/tests/unit/TestRunner.py