This is an archive of the discontinued LLVM Phabricator instance.

[Polly][CMake] Skip unit-tests in lit if gtest is not available
ClosedPublic

Authored by philip.pfaffe on Jun 9 2017, 5:25 AM.

Details

Summary

There is a bug in the current lit configurations for the unittests. If gtest is not available, the site-config for the unit tests won't be generated. Because lit recurses through the test directory, the lit configuration for the unit tests will be discovered nevertheless, leading to a fatal error in lit.

This patch semi-gracefully skips the unittests if gtest is not available. As a result, running lit now prints this: warning: test suite 'Polly-Unit' contained no test.

If people think that this is too annoying, the alternative would be to pick apart the test directory, so that the lit testsuite discovery will always only find one configuration. In fact, both of these things could be combined. While it's certainly nice that running a single lit command runs all the tests, I suppose people use the check-polly make target over lit most of the time, so the difference might not be noticed.

Diff Detail

Repository
rL LLVM

Event Timeline

philip.pfaffe created this revision.Jun 9 2017, 5:25 AM
grosser edited edge metadata.Jun 13 2017, 5:06 AM

I am fine with this "solution". Let's see what Michael says.

grosser accepted this revision.Jun 13 2017, 5:06 AM
This revision is now accepted and ready to land.Jun 13 2017, 5:06 AM

@Meinersbur : Do you happen to have any final comments on this or can this be committed?

Michael is still on vacation. I think we should just commit it as is. Michael can do a post-commit review or update if he feels like. Thanks Philip for working on this!

This revision was automatically updated to reflect the committed changes.