This is an archive of the discontinued LLVM Phabricator instance.

[lldb/Test] Disallow using substituted binaries in shell test.
ClosedPublic

Authored by JDevlieghere on Jan 23 2020, 12:56 PM.

Details

Summary

Explicitly disallow using lldb instead of %lldb in the shell tests. This is a clever trick that is used by Swift to achieve the same results.

For example, this would've caught the use of lldb in PT_LOAD-overlap-PT_TLS.yaml:

FAIL: lldb-shell :: ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml (50 of 305)
******************** TEST 'lldb-shell :: ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml' FAILED ********************
Script:
--
: 'RUN: at line 3';   /Volumes/Jonas/llvm/build-ra/bin/yaml2obj /Volumes/Jonas/llvm/llvm-project/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml > /Volumes/Jonas/llvm/build-ra/tools/lldb/test/ObjectFile/ELF/Output/PT_LOAD-overlap-PT_TLS.yaml.tmp
: 'RUN: at line 4';   /Volumes/Jonas/llvm/build-ra/bin/lldb-test object-file /Volumes/Jonas/llvm/build-ra/tools/lldb/test/ObjectFile/ELF/Output/PT_LOAD-overlap-PT_TLS.yaml.tmp | /Volumes/Jonas/llvm/build-ra/bin/FileCheck /Volumes/Jonas/llvm/llvm-project/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml
: 'RUN: at line 5';
    echo '*** Do not use 'lldb' in tests; use '%''lldb'. ***' &&
    exit 1 && echo
  /Volumes/Jonas/llvm/build-ra/tools/lldb/test/ObjectFile/ELF/Output/PT_LOAD-overlap-PT_TLS.yaml.tmp -o "image lookup -a 0x1000" -b | /Volumes/Jonas/llvm/build-ra/bin/FileCheck --check-prefix=LOOKUP /Volumes/Jonas/llvm/llvm-project/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml
--
Exit Code: 1

Command Output (stdout):
--
*** Do not use lldb in tests; use %lldb. ***

Diff Detail

Event Timeline

JDevlieghere created this revision.Jan 23 2020, 12:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2020, 12:56 PM
Herald added a subscriber: teemperor. · View Herald Transcript
JDevlieghere edited the summary of this revision. (Show Details)Jan 23 2020, 12:57 PM
compnerd accepted this revision.Jan 23 2020, 2:18 PM
compnerd added a subscriber: compnerd.
compnerd added inline comments.
lldb/test/Shell/helper/toolchain.py
24

Wow, that took a couple of reads to figure out what was being formatted where. I wish that there was a nicer way to write that.

This revision is now accepted and ready to land.Jan 23 2020, 2:18 PM
JDevlieghere marked 2 inline comments as done.Jan 23 2020, 2:22 PM
JDevlieghere added inline comments.
lldb/test/Shell/helper/toolchain.py
24

Yeah...

This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.