Page MenuHomePhabricator

[CMake][CTE] Add "check-clang-extra-..." targets to test only a particular Clang extra tool
ClosedPublic

Authored by whisperity on Jul 20 2020, 8:17 AM.

Details

Summary

Create targets check-clang-tools-clang-tidy, check-clang-tools-clang-query similar to how check-clang-sema, check-clang-parser, etc. are auto-generated from the directory structure.

This allows running only a particular sub-tool's tests, not having to wait through the entire check-clang-tools's execution.

Diff Detail

Event Timeline

whisperity created this revision.Jul 20 2020, 8:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2020, 8:17 AM

Thank you, this would be very helpful.

@lebedev.ri If you have an idea on who's competent in accepting this change, please update the reviewers field, I'm in the dark here.

Also, should the commands be called check-clang-tools-clang-tidy or check-clang-extra-clang-tidy instead?

whisperity retitled this revision from [CMake][CTE] Add "check-clang-tools-..." targets to test only a particular Clang extra tool to [CMake][CTE] Add "check-clang-extra-..." targets to test only a particular Clang extra tool.
whisperity added reviewers: chandlerc, alexfh.

After using this for a while, it feels more natural and more obvious that these are the CTE targets, not the "clang/tools" test targets.

Ping. Can this go in? Still using this on a local fork, and still feels nice to be able to specify just a single tool.

lebedev.ri accepted this revision.Sep 24 2020, 10:04 AM

LGTM, please feel free to land this as-is.

This revision is now accepted and ready to land.Sep 24 2020, 10:04 AM

Just a follow up on this point, dependencies are a little messed up here. Running any of the check-clang-extra<...> results in all clang-tools-extra targets being built.
Not ideal if you just want to test a small change to one tools and potentially having to rebuild all extra-tools
Is this an artefact of how check-clang-tools also depends on all clang-tools-extra targets.

Is this an artefact of how check-clang-tools also depends on all clang-tools-extra targets.

Yes, this was not changed in this patch. Fixing that will require a lot more CMake magic which I did not have sufficient time to do so. We'd need to refactor the code which generates the initial targets for the subprojects, etc.
So yeah, the new build entry-point only gives you the benefit of not running the tests. Build list is equal to the normal check-clang-tools target.