This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Add test directory for scan-build
ClosedPublic

Authored by dcoughlin on Nov 3 2019, 5:10 PM.

Details

Summary

The static analyzer's scan-build script is critical infrastructure but
is not well tested. To start to address this, add a new test directory under
tests/Analysis for scan-build lit tests and seed it with several tests. The
goal is that future scan-build changes will be accompanied by corresponding
tests.

Diff Detail

Event Timeline

dcoughlin created this revision.Nov 3 2019, 5:10 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 3 2019, 5:10 PM
NoQ accepted this revision.Nov 3 2019, 6:54 PM

Woohoo, that's much more tests than i made in D55683!

Let's hope it works on Windows :/

clang/test/Analysis/scan-build/plist_html_output.test
18–19

Clever!

This revision is now accepted and ready to land.Nov 3 2019, 6:54 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Nov 5 2019, 12:21 PM

If CLANG_INSTALL_SCANBUILD=NO, then this tries to run scan-build from PATH, where it might not exist. Does this need some lit feature to check if scan-build is being copied to the bin dir by the build system?

thakis added a comment.Nov 6 2019, 8:30 AM

Also, you probably need to make clang/test/CMakeLists.txt depend on the install target, to make sure scan-build is in bin/.

NoQ reopened this revision.Feb 3 2020, 8:29 AM

I'll try to re-land this. I heard there were a lot more issues than just honoring CLANG_INSTALL_SCANBUILD=NO (which i'll do my best to test before pushing), so i'll monitor the buildbots carefully and try to unbreak everything quickly.

This revision is now accepted and ready to land.Feb 3 2020, 8:29 AM
This revision was automatically updated to reflect the committed changes.