]> granicus.if.org Git - clang/commitdiff
Revert [test] Fix plugin tests
authorDon Hinton <hintonda@gmail.com>
Tue, 28 May 2019 06:38:16 +0000 (06:38 +0000)
committerDon Hinton <hintonda@gmail.com>
Tue, 28 May 2019 06:38:16 +0000 (06:38 +0000)
This reverts r361790 (git commit fe5eaab2b5b4523886bd63aebcfea8cfce586fa1)

It's causing buildbot breakage, so reverting while I investigate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361793 91177308-0d34-0410-b5e6-96231b3b80d8

15 files changed:
lib/Analysis/CMakeLists.txt
lib/Analysis/plugins/CMakeLists.txt [deleted file]
lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt [deleted file]
test/Analysis/lit.local.cfg
test/Analysis/plugins/CMakeLists.txt [new file with mode: 0644]
test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt [moved from lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt with 51% similarity]
test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp [moved from lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp with 100% similarity]
test/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports [moved from lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports with 100% similarity]
test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt [moved from lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt with 50% similarity]
test/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp [moved from lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp with 100% similarity]
test/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports [moved from lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports with 100% similarity]
test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt [new file with mode: 0644]
test/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp [moved from lib/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp with 100% similarity]
test/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports [moved from lib/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports with 100% similarity]
test/CMakeLists.txt

index 92717143467d5044362943166449a1211eedc4f6..940a3dfe6f60d69c568c5435e32fac61718e0d5d 100644 (file)
@@ -34,5 +34,3 @@ add_clang_library(clangAnalysis
   clangBasic
   clangLex
   )
-
-add_subdirectory(plugins)
diff --git a/lib/Analysis/plugins/CMakeLists.txt b/lib/Analysis/plugins/CMakeLists.txt
deleted file mode 100644 (file)
index f7dbc93..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-if(LLVM_ENABLE_PLUGINS)
-  add_subdirectory(SampleAnalyzer)
-  add_subdirectory(CheckerDependencyHandling)
-  add_subdirectory(CheckerOptionHandling)
-endif()
diff --git a/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt b/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
deleted file mode 100644 (file)
index 639a97f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports)
-add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp PLUGIN_TOOL clang)
-
-target_link_libraries(SampleAnalyzerPlugin PRIVATE
-  clangAnalysis
-  clangAST
-  clangStaticAnalyzerCore
-  clangStaticAnalyzerFrontend
-  LLVMSupport
-  )
index 84f7569152c9f7e77135dc4865a731ca09ccba4d..b77cae8ecebecde652cba2cb068c9a5c7a3c65a6 100644 (file)
@@ -18,5 +18,7 @@ config.substitutions.append(('%diff_plist',
 config.substitutions.append(('%diff_sarif',
     '''diff -U1 -w -I ".*file:.*%basename_t" -I '"version":' -I "2\.0\.0\-csd\.[0-9]*\.beta\."'''))
 
+config.excludes.add('plugins')
+
 if not config.root.clang_staticanalyzer:
     config.unsupported = True
diff --git a/test/Analysis/plugins/CMakeLists.txt b/test/Analysis/plugins/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8d4333f
--- /dev/null
@@ -0,0 +1,12 @@
+add_subdirectory(SampleAnalyzer)
+add_subdirectory(CheckerDependencyHandling)
+add_subdirectory(CheckerOptionHandling)
+
+set(CLANG_ANALYZER_PLUGIN_DEPS
+  SampleAnalyzerPlugin
+  CheckerDependencyHandlingAnalyzerPlugin
+  CheckerOptionHandlingAnalyzerPlugin
+  )
+
+add_custom_target(clang-analyzer-plugin
+  DEPENDS ${CLANG_ANALYZER_PLUGIN_DEPS})
similarity index 51%
rename from lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
rename to test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
index 0a8ff48755f1791ac02c1559a8aa579a70d3a578..80e2cdbd3a2582f4e705ba3b9557ed230334c5e3 100644 (file)
@@ -1,10 +1,11 @@
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
 add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
 
-target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
-  clangAnalysis
-  clangAST
-  clangStaticAnalyzerCore
-  clangStaticAnalyzerFrontend
-  LLVMSupport
-  )
+if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+  target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
+    clangAnalysis
+    clangAST
+    clangStaticAnalyzerCore
+    LLVMSupport
+    )
+endif()
similarity index 50%
rename from lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
rename to test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
index 6e289933c2dd4ddbd0c59ed77217eeafae6b439e..6a1d5e852794176b5f2d2f3d5d9540b89d24b662 100644 (file)
@@ -1,10 +1,11 @@
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CheckerOptionHandlingAnalyzerPlugin.exports)
 add_llvm_library(CheckerOptionHandlingAnalyzerPlugin MODULE CheckerOptionHandling.cpp PLUGIN_TOOL clang)
 
-target_link_libraries(CheckerOptionHandlingAnalyzerPlugin PRIVATE
-  clangAnalysis
-  clangAST
-  clangStaticAnalyzerCore
-  clangStaticAnalyzerFrontend
-  LLVMSupport
-  )
+if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+  target_link_libraries(CheckerOptionHandlingAnalyzerPlugin PRIVATE
+    clangAnalysis
+    clangAST
+    clangStaticAnalyzerCore
+    LLVMSupport
+    )
+endif()
diff --git a/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt b/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7c7b2ae
--- /dev/null
@@ -0,0 +1,11 @@
+set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports)
+add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp PLUGIN_TOOL clang)
+
+if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+  target_link_libraries(SampleAnalyzerPlugin PRIVATE
+    clangAnalysis
+    clangAST
+    clangStaticAnalyzerCore
+    LLVMSupport
+    )
+endif()
index 32fe571afaad68019ed99ae80c655a95323f0965..339f637847debd16d3ddd0adda947c199e14767e 100644 (file)
@@ -126,13 +126,27 @@ if( NOT CLANG_BUILT_STANDALONE )
 endif()
 
 if (CLANG_ENABLE_STATIC_ANALYZER)
-  if (LLVM_ENABLE_PLUGINS)
-    set(CLANG_ANALYZER_PLUGIN_DEPS
-      SampleAnalyzerPlugin
-      CheckerDependencyHandlingAnalyzerPlugin
-      CheckerOptionHandlingAnalyzerPlugin
-      )
+  add_subdirectory(Analysis/plugins)
+  list(APPEND CLANG_TEST_DEPS clang-analyzer-plugin)
+
+  # check-all would launch those tests via check-clang.
+  set(EXCLUDE_FROM_ALL ON)
+
+  add_lit_testsuite(check-clang-analyzer "Running the Clang analyzer tests"
+    ${CMAKE_CURRENT_BINARY_DIR}/Analysis
+    PARAMS ${ANALYZER_TEST_PARAMS}
+    DEPENDS ${CLANG_TEST_DEPS})
+  set_target_properties(check-clang-analyzer PROPERTIES FOLDER "Clang tests")
+
+  if (LLVM_WITH_Z3)
+    add_lit_testsuite(check-clang-analyzer-z3 "Running the Clang analyzer tests, using Z3 as a solver"
+      ${CMAKE_CURRENT_BINARY_DIR}/Analysis
+      PARAMS ${ANALYZER_TEST_PARAMS_Z3}
+      DEPENDS ${CLANG_TEST_DEPS})
+    set_target_properties(check-clang-analyzer-z3 PROPERTIES FOLDER "Clang tests")
   endif()
+
+  set(EXCLUDE_FROM_ALL OFF)
 endif()
 
 add_custom_target(clang-test-depends DEPENDS ${CLANG_TEST_DEPS})