This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Improve reporting when running the lit test suite
ClosedPublic

Authored by ldionne on Oct 12 2018, 1:30 PM.

Details

Summary

Running the test suite with -a will now properly show all the executed
commands. The reports also include the environment under which the test
is being executed, which is helpful for reproducing issues.

Diff Detail

Repository
rL LLVM

Event Timeline

ldionne created this revision.Oct 12 2018, 1:30 PM

Could you elaborate as to why this is needed/beneficial? Most of the information this patch adds to reports is already displayed to the user during the initial configuration.

libcxx/utils/libcxx/test/format.py
210 ↗(On Diff #169485)

The relevant environment variables should be printed once at the start of the run. IDK why we need to display them again here. I think it only adds noise.

The same goes for the compile command. We should dump all the relevant compile flags at the start of the run during initial configuration.

214 ↗(On Diff #169485)

How is printing the name of the temporary executable file here helpful?

EricWF requested changes to this revision.Oct 12 2018, 9:45 PM

Setting "Requested Changes" to move this from my TODO review queue.

This revision now requires changes to proceed.Oct 12 2018, 9:45 PM

Could you elaborate as to why this is needed/beneficial? Most of the information this patch adds to reports is already displayed to the user during the initial configuration.

This is useful whenever you try to see why a test is passing when you think it should fail. In my case, I was trying to figure out what was different between two lit invocations: a test was failing on a CI but it was passing on my local machine (i.e. I couldn't reproduce the failure). I tried adding -a thinking "this is going to tell me all I need to know", but it didn't. So instead I had to make the test fail artificially, look at what the command-line was (because that is printed when the test fails), and try to reproduce that way. Much better would be to just run the test under -a, which is advertised by lit as dumping everything.

There is some amount of crap in what's printed, e.g. temporary executable files, etc. These can be edited manually when working on a reproduction. Also note that you should not normally use -a when running lit (and I don't think people usually do that). You use -a when you really want to see what's going on, and this patch gives you that information.

EricWF accepted this revision.Oct 17 2018, 8:47 AM

LGTM without the environment. If we need more information about the ENV we can print it once, during the initial configuration of the test suite.

This revision is now accepted and ready to land.Oct 17 2018, 8:47 AM
This revision was automatically updated to reflect the committed changes.

Committed without the environment.