This is an archive of the discontinued LLVM Phabricator instance.

[cmake][lit] Add check-lit CMake target
AbandonedPublic

Authored by modocache on Sep 27 2016, 6:06 PM.

Details

Summary

Use add_lit_testsuite to add a check-lit CMake target, which runs lit's
test suite. Unlike LLVM's test/lit.cfg, lit's lit.cfg does not include logic
to configure a PATH that includes not and FileCheck, so the CMake
target specifies that as an argument.

Running lit's tests results in several "Output" directories being
generated within the lit tests directory. Add these to a .gitignore
to prevent them from being added to source control.

Diff Detail

Event Timeline

modocache updated this revision to Diff 72746.Sep 27 2016, 6:06 PM
modocache retitled this revision from to [cmake][lit] Add lit-check CMake target.
modocache updated this object.
modocache updated this revision to Diff 72748.Sep 27 2016, 6:07 PM

Oops, wrong target name in commit title. Fixed.

modocache retitled this revision from [cmake][lit] Add lit-check CMake target to [cmake][lit] Add check-lit CMake target.Sep 27 2016, 6:08 PM

I could have sworn I'd already committed (or reviewed?) a patch to make this happen.

Running lit's tests results in several "Output" directories being
generated within the lit tests directory. Add these to a .gitignore
to prevent them from being added to source control.

It'd be better to rework the tests so that they dump their output in %T, rather than in the build directory. Having builds that don't modify the source directory is a good goal, and I'd rather see us move toward that rather than away from it.

I could have sworn I'd already committed (or reviewed?) a patch to make this happen.

Ohh, turns out that it was r257221, but that got reverted for some reason?

Running lit's tests results in several "Output" directories being
generated within the lit tests directory. Add these to a .gitignore
to prevent them from being added to source control.

It'd be better to rework the tests so that they dump their output in %T, rather than in the build directory. Having builds that don't modify the source directory is a good goal, and I'd rather see us move toward that rather than away from it.

Oops, I meant: s/in the build directory/in the source directory/

r257221 solved this problem by copying all the tests to the build directory, FWIW.

beanz edited edge metadata.Sep 28 2016, 9:50 AM
beanz added a subscriber: delcypher.

@jroelofs, thanks for digging out that patch. I thought we had tried to do this recently and something went wrong.

The revert in rL257268 said that the tests were not working correctly under windows and the lit per-test timeout tests failed on the bots.

Not sure if @delcypher has looked at this anymore since January, but his input might be useful here.

delcypher added a comment.EditedOct 3 2016, 7:35 AM

@jroelofs, thanks for digging out that patch. I thought we had tried to do this recently and something went wrong.

The revert in rL257268 said that the tests were not working correctly under windows and the lit per-test timeout tests failed on the bots.

Not sure if @delcypher has looked at this anymore since January, but his input might be useful here.

Yes I reverted the patch for the reasons stated above and I haven't found time to look into the issue since. @modocache you should probably take a look at old patch and see if there are any ideas you want to take from it. I think copying the tests to build directory and running there is cleaner. I really don't want build files ending up in the source tree.

I think the lit per-test timeouts were probably fixed by later patch in rL257616 but I never investigated re-running on the build bots.

Awesome, thanks @delcypher, will do! One question: is there a way I can test on the Windows buildbots before committing a change? Alternatively, I could prepare a Windows environment and try building and running the tests there, but it would be great if I could do a test run on the actual bots.

@modocache, sadly we do not have pre-commit testing on LLVM.

modocache planned changes to this revision.Nov 3 2016, 4:55 PM

I still need to double-check this works on Windows, sorry for the delay!

modocache abandoned this revision.Jul 25 2017, 10:30 PM

Abandoning this in favor of D35880, which un-reverts @delcypher's previous work.