This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Add ClangAnalyzerBenchmarks directory to test-suite repository
ClosedPublic

Authored by dcoughlin on Jan 12 2016, 8:59 AM.

Details

Summary

Hi All,

This patch proposes adding a new directory in the llvm test-suite repository to hold projects and build commands to detect regressions in the clang static analyzer. This directory will be used by a Green Dragon build bot (discussed in http://lists.llvm.org/pipermail/cfe-dev/2015-September/045199.html that will periodically re-analyze the projects specified in this directory to detect when analysis results change unexpectedly.

Rather than check in the source code for these projects, we propose to instead check in (1) scripts to download, cache, and build the project and (2) expected reference results in plist form from running the analyzer over the project. There are pre-existing scripts in utils/analyzer in the clang project that understand the layout of this directory (see http://reviews.llvm.org/D14345). Internally we have found this approach to be effective at discovering unintended regressions on real-world projects.

Diff Detail

Event Timeline

dcoughlin updated this revision to Diff 44594.Jan 12 2016, 8:59 AM
dcoughlin retitled this revision from to [test-suite] Add ClangAnalyzerBenchmarks directory to test-suite repository.
dcoughlin updated this object.
dcoughlin added subscribers: cfe-commits, llvm-commits.
MatzeB edited edge metadata.Jan 12 2016, 11:16 AM

Putting static-analyzer tests into the test-suite sounds good to me, the static analyzer is part of llvm so this should be fine. Though I'd like to wait a bit to hear other opinions on this matter.

As for the patch itself:

  • I'd call the directory ClangAnalyzer
  • For the external file you should provide a sha256 (or md5) sum and ideally check it in the download script, so other people can be sure that the reference results do indeed match the artifact being analyzed.
  • Why is there a subdirectory "2016-01-11-134007-41609-1" in the RefScanBuildResults directory, that name appears arbitrary for reference results.
dcoughlin updated this revision to Diff 44700.Jan 12 2016, 5:39 PM
dcoughlin edited edge metadata.

I've changed the directory name to 'ClangAnalyzer' and updated the download script to check to md5 hash of the downloaded tarball.

The inhumane directory names in the RefScanBuildResults directory are the direct output of the scan-build tool. A new and improved python reimplementation of scan-build just landed in trunk today with slightly better directory names. The directory names here will improve when the python reimplementation is ready to be used in build bot scripts.

MatzeB accepted this revision.Jan 12 2016, 5:48 PM
MatzeB edited edge metadata.

LGTM, though you should wait a week or two for other opinions before committing.

This revision is now accepted and ready to land.Jan 12 2016, 5:48 PM

Ping.

Any objections to adding a new 'ClangAnalyzer' directory to test-suite?

cmatthews edited edge metadata.Jan 19 2016, 2:17 PM
cmatthews added a subscriber: cmatthews.

LGTM too.

dcoughlin closed this revision.Jan 20 2016, 1:02 PM

Committed in r258336.