[test] Fix plugin tests
authorDon Hinton <hintonda@gmail.com>
Sun, 2 Jun 2019 15:53:43 +0000 (15:53 +0000)
committerDon Hinton <hintonda@gmail.com>
Sun, 2 Jun 2019 15:53:43 +0000 (15:53 +0000)
commitccbda6b0003b49d030f668c7f27dedca6d11ebda
tree4cae4366de6115f95b4c76590e7ef023d7e9857f
parent71a39bcf68c3fd8b578c66fca8ad044793ad18e5
[test] Fix plugin tests

Recommit of r361790 that was temporarily reverted in r361793 due to bot breakage.

Summary:
The following changes were required to fix these tests:

1) Change LLVM_ENABLE_PLUGINS to an option and move it to
   llvm/CMakeLists.txt with an appropriate default -- which matches
   the original default behavior.

2) Move the plugins directory from clang/test/Analysis
   clang/lib/Analysis.  It's not enough to add an exclude to the
   lit.local.cfg file because add_lit_testsuites recurses the tree and
   automatically adds the appropriate `check-` targets, which don't
   make sense for the plugins because they aren't tests and don't
   have `RUN` statements.

   Here's a list of the `clang-check-anlysis*` targets with this
   change:

```
  $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis
  check-clang-analysis
  check-clang-analysis-checkers
  check-clang-analysis-copypaste
  check-clang-analysis-diagnostics
  check-clang-analysis-engine
  check-clang-analysis-exploration_order
  check-clang-analysis-html_diagnostics
  check-clang-analysis-html_diagnostics-relevant_lines
  check-clang-analysis-inlining
  check-clang-analysis-objc
  check-clang-analysis-unified-sources
  check-clang-analysis-z3
```

3) Simplify the logic and only include the subdirectories under
   clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.

Reviewed By: NoQ

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D62445

llvm-svn: 362328
17 files changed:
clang/lib/Analysis/CMakeLists.txt
clang/lib/Analysis/plugins/CMakeLists.txt [new file with mode: 0644]
clang/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt [moved from clang/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt with 51% similarity]
clang/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp [moved from clang/test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp with 100% similarity]
clang/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports [moved from clang/test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports with 100% similarity]
clang/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt [moved from clang/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt with 50% similarity]
clang/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp [moved from clang/test/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp with 100% similarity]
clang/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports [moved from clang/test/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports with 100% similarity]
clang/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt [new file with mode: 0644]
clang/lib/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp [moved from clang/test/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp with 100% similarity]
clang/lib/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports [moved from clang/test/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports with 100% similarity]
clang/test/Analysis/lit.local.cfg
clang/test/Analysis/plugins/CMakeLists.txt [deleted file]
clang/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt [deleted file]
clang/test/CMakeLists.txt
llvm/CMakeLists.txt
llvm/cmake/modules/HandleLLVMOptions.cmake