This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Quietly source lit-lldb-init
ClosedPublic

Authored by kastiglione on Aug 25 2022, 11:55 AM.

Details

Summary

Improve utility of FileCheck output when a shell test fails.

The conflict is from:

  1. On failure, FileCheck prints 5 lines of context
  2. Shell tests first source lit-lldb-init, having the effect of printing its contents

If a FileCheck failure happens at the beginning of the input, then the
context shown is the lit-lldb-init, as it's over 5 lines and is the first
thing printed. As the init contents are fairly static, and presumably
uninteresting to most test failures, it seems reasonable to not print it.

Unfortunately it's not possible to use the --source-quietly flag in the lldb
invocation, because it will quiet all other --source flags on the command
line, making many tests fail.

This fix is a level of indirection, where a new sibling file named
lit-lldb-init-quiet is created, and its static contents are:

command source -C --silent-run true lit-lldb-init

This achieves the result of loading lit-lldb-init quietly. The -C flag
loads the path relatively.

Diff Detail

Event Timeline

kastiglione created this revision.Aug 25 2022, 11:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2022, 11:55 AM
Herald added a subscriber: mgorny. · View Herald Transcript
kastiglione requested review of this revision.Aug 25 2022, 11:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2022, 11:55 AM
This revision is now accepted and ready to land.Aug 25 2022, 1:03 PM
This revision was automatically updated to reflect the committed changes.