This is an archive of the discontinued LLVM Phabricator instance.

Implement verbose mode in FlieCheck and Lit to capture whole stdin.
Needs ReviewPublic

Authored by chapuni on May 10 2016, 8:27 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This changes are aiming to capture and dump whole stdin to FileCheck.
In automated builders, we are often missing actual input, to wonder why the failure was.

  • Implement -verbose in FileCheck to dump stdin to stderr.
  • Introduce LLVM_FILECHECK to override default value of -verbose.
  • Introduce LIT_PASS_VARS in Lit, to customize variables available in the test.

How to activate this changes;

LIT_PASS_VARS=LLVM_FILECHECK LLVM_FILECHECK=-verbose bin/llvm-lit path/to/...

This patch is W-I-P. FIXME:

  • Give the description for -verbose with cl::desc().
  • Generalize LLVM_FILECHECK to accept additional options.
  • Improve the output of -verbose.
  • Add tests for -verbose itself.

Diff Detail

Repository
rL LLVM

Event Timeline

chapuni updated this revision to Diff 56715.May 10 2016, 8:27 AM
chapuni retitled this revision from to Implement verbose mode in FlieCheck and Lit to capture whole stdin..
chapuni updated this object.
chapuni set the repository for this revision to rL LLVM.
chapuni added a subscriber: llvm-commits.
filcab added a subscriber: filcab.May 13 2016, 8:30 AM

This functionality would be really good for those random bugs we only see happening in buildbots.
But I think we should only dump the buffer if there was a problem with it.

llvm/utils/FileCheck/FileCheck.cpp
1356

I'd prefer to only print out the whole buffer in case we fail.

Forgot a comment.

llvm/utils/FileCheck/FileCheck.cpp
1310

This should be LLVM_FILECHECK_OPTIONS or LLVM_FILECHECK_EXTRA_ARGS or something.

llvm/utils/lit/lit/TestingConfig.py
32

When you propose this, please split this to another commit.

Add tests for -verbose itself.

I don't see any -verbose=true tests, and the default is false. Did you forget to git add them?

Thanks @filcab.

llvm/utils/FileCheck/FileCheck.cpp
1310

I prefer LLVM_FILECHECK_OPTIONS. Thanks.

1356

I think we could catch successful cases, for example, to compare logs between +Asserts and -Asserts.

Shall we split verbose level, or add another option?

llvm/utils/lit/lit/TestingConfig.py
32

I see. I'll propose this individually.
It'd make "LIT_PRESERVES_TMP" generalized.

Add tests for -verbose itself.

I don't see any -verbose=true tests, and the default is false. Did you forget to git add them?

I just tweaked some tests in llvm/test/FileCheck not to be affected by LLVM_FILECHECK_OPTIONS.
I'll add cases for -verbose=true in the next time.

dvyukov added a subscriber: dvyukov.Jun 5 2016, 8:25 AM

In automated builders, we are often missing actual input, to wonder why the failure was.

We are always missing it. On builders and otherwise. I don't understand why printing input is not the default.