[clang] 39573da - Revert "[analyzer] Add test directory for scan-build."

Volodymyr Sapsai via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 14:04:45 PST 2019


Author: Volodymyr Sapsai
Date: 2019-11-05T14:03:36-08:00
New Revision: 39573daa76f23b93bda1437157cf78fb3d1003e2

URL: https://github.com/llvm/llvm-project/commit/39573daa76f23b93bda1437157cf78fb3d1003e2
DIFF: https://github.com/llvm/llvm-project/commit/39573daa76f23b93bda1437157cf78fb3d1003e2.diff

LOG: Revert "[analyzer] Add test directory for scan-build."

This reverts commit 0aba69eb1a01c44185009f50cc633e3c648e9950 with
subsequent changes to test files.

It caused test failures on GreenDragon, e.g.,
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/

Added: 
    

Modified: 
    clang/test/lit.cfg.py
    llvm/utils/lit/lit/llvm/config.py

Removed: 
    clang/test/Analysis/scan-build/Inputs/multidirectory_project/directory1/file1.c
    clang/test/Analysis/scan-build/Inputs/multidirectory_project/directory2/file2.c
    clang/test/Analysis/scan-build/Inputs/single_null_dereference.c
    clang/test/Analysis/scan-build/exclude_directories.test
    clang/test/Analysis/scan-build/help.test
    clang/test/Analysis/scan-build/html_output.test
    clang/test/Analysis/scan-build/plist_html_output.test
    clang/test/Analysis/scan-build/plist_output.test


################################################################################
diff  --git a/clang/test/Analysis/scan-build/Inputs/multidirectory_project/directory1/file1.c b/clang/test/Analysis/scan-build/Inputs/multidirectory_project/directory1/file1.c
deleted file mode 100644
index 7fffb69e01a0..000000000000
--- a/clang/test/Analysis/scan-build/Inputs/multidirectory_project/directory1/file1.c
+++ /dev/null
@@ -1,9 +0,0 @@
-int main() {
-  return 0;
-}
-
-void function1(int *p) {
-  if (!p) {
-    *p = 7; // This will emit a null pointer diagnostic.
-  }
-}

diff  --git a/clang/test/Analysis/scan-build/Inputs/multidirectory_project/directory2/file2.c b/clang/test/Analysis/scan-build/Inputs/multidirectory_project/directory2/file2.c
deleted file mode 100644
index ed0e17212337..000000000000
--- a/clang/test/Analysis/scan-build/Inputs/multidirectory_project/directory2/file2.c
+++ /dev/null
@@ -1,5 +0,0 @@
-void function2(int *o) {
-  if (!o) {
-    *o = 7; // This will emit a null pointer diagnostic.
-  }
-}

diff  --git a/clang/test/Analysis/scan-build/Inputs/single_null_dereference.c b/clang/test/Analysis/scan-build/Inputs/single_null_dereference.c
deleted file mode 100644
index 21a43dfd08a5..000000000000
--- a/clang/test/Analysis/scan-build/Inputs/single_null_dereference.c
+++ /dev/null
@@ -1,5 +0,0 @@
-int main() {
-  int *p = 0;
-  *p = 7; // We expect a diagnostic about this.
-  return 0;
-}

diff  --git a/clang/test/Analysis/scan-build/exclude_directories.test b/clang/test/Analysis/scan-build/exclude_directories.test
deleted file mode 100644
index 3db68d635763..000000000000
--- a/clang/test/Analysis/scan-build/exclude_directories.test
+++ /dev/null
@@ -1,36 +0,0 @@
-REQUIRES: system-darwin
-
-RUN: rm -rf %t.output_dir && mkdir %t.output_dir
-RUN: %scan-build -o %t.output_dir %clang \
-RUN:     %S/Inputs/multidirectory_project/directory1/file1.c \
-RUN:     %S/Inputs/multidirectory_project/directory2/file2.c \
-RUN:     | FileCheck %s -check-prefix CHECK-NO-EXCLUDE
-
-// The purpose of this test is to ensure that the --exclude command line option
-// actually excludes reports from inside the specified directories.
-
-
-// First, let's make sure that without --exclude issues in both
-// directory1 and directory2 are found.
-CHECK-NO-EXCLUDE: scan-build: 2 bugs found.
-
-
-// Only one issue should be found when directory1 is excluded.
-RUN: rm -rf %t.output_dir && mkdir %t.output_dir
-RUN: %scan-build -o %t.output_dir --exclude directory1 %clang \
-RUN:     %S/Inputs/multidirectory_project/directory1/file1.c \
-RUN:     %S/Inputs/multidirectory_project/directory2/file2.c \
-RUN:     | FileCheck %s -check-prefix CHECK-EXCLUDE1
-
-CHECK-EXCLUDE1: scan-build: 1 bug found.
-
-
-// When both directories are excluded, no issues should be reported.
-RUN: rm -rf %t.output_dir && mkdir %t.output_dir
-RUN: %scan-build -o %t.output_dir --exclude directory1 --exclude directory2 %clang \
-RUN:     %S/Inputs/multidirectory_project/directory1/file1.c \
-RUN:     %S/Inputs/multidirectory_project/directory2/file2.c \
-RUN:     | FileCheck %s -check-prefix CHECK-EXCLUDE-BOTH
-
-CHECK-EXCLUDE-BOTH: scan-build: 0 bugs found.
-

diff  --git a/clang/test/Analysis/scan-build/help.test b/clang/test/Analysis/scan-build/help.test
deleted file mode 100644
index ce4696e0380d..000000000000
--- a/clang/test/Analysis/scan-build/help.test
+++ /dev/null
@@ -1,19 +0,0 @@
-REQUIRES: system-darwin
-
-RUN: %scan-build -h | FileCheck %s
-RUN: %scan-build --help | FileCheck %s
-
-Test for help output from scan-build.
-
-
-CHECK: USAGE: scan-build [options] <build command> [build options]
-
-...
-
-CHECK: AVAILABLE CHECKERS:
-...
-CHECK:    optin.performance.GCDAntipattern
-...
-
-
-

diff  --git a/clang/test/Analysis/scan-build/html_output.test b/clang/test/Analysis/scan-build/html_output.test
deleted file mode 100644
index f2345fa06062..000000000000
--- a/clang/test/Analysis/scan-build/html_output.test
+++ /dev/null
@@ -1,32 +0,0 @@
-REQUIRES: system-darwin
-
-RUN: rm -rf %t.output_dir && mkdir %t.output_dir
-RUN: %scan-build -o %t.output_dir %clang %S/Inputs/single_null_dereference.c \
-RUN:     | FileCheck %s -check-prefix CHECK-STDOUT
-
-// Test html output
-
-CHECK-STDOUT: scan-build: Using '{{.*}}' for static analysis
-CHECK-STDOUT: scan-build: 1 bug found.
-CHECK-STDOUT: scan-build: Run 'scan-view {{.*}}' to examine bug reports.
-
-// We expect an index file, a file for the report, and sibling support files.
-RUN: ls %t.output_dir/*/ | FileCheck %s -check-prefix CHECK-FILENAMES
-
-CHECK-FILENAMES: index.html
-CHECK-FILENAMES: report-{{.*}}.html
-CHECK-FILENAMES: scanview.css
-CHECK-FILENAMES: sorttable.js
-
-
-// The index should have a link to the report for the single issue.
-RUN: cat %T/html_output_dir/*/index.html \
-RUN:     | FileCheck %s -check-prefix CHECK-INDEX-HTML
-
-CHECK-INDEX-HTML: <!-- REPORTBUG id="report-{{.*}}.html" -->
-
-// The report should describe the issue.
-RUN: cat %t.output_dir/*/report-*.html \
-RUN:     | FileCheck %s -check-prefix CHECK-REPORT-HTML
-
-CHECK-REPORT-HTML: <!-- BUGTYPE Dereference of null pointer -->

diff  --git a/clang/test/Analysis/scan-build/plist_html_output.test b/clang/test/Analysis/scan-build/plist_html_output.test
deleted file mode 100644
index feefa25617d3..000000000000
--- a/clang/test/Analysis/scan-build/plist_html_output.test
+++ /dev/null
@@ -1,22 +0,0 @@
-REQUIRES: system-darwin
-
-RUN: rm -rf %t.output_dir && mkdir %t.output_dir
-RUN: %scan-build -plist-html -o %t.output_dir %clang %S/Inputs/single_null_dereference.c \
-RUN:     | FileCheck %s -check-prefix CHECK-STDOUT
-
-// Test combined plist and html output with -plist-html
-
-CHECK-STDOUT: scan-build: Using '{{.*}}' for static analysis
-CHECK-STDOUT: scan-build: Analysis run complete.
-CHECK-STDOUT: scan-build: Analysis results (plist files) deposited in '{{.*}}'
-CHECK-STDOUT: scan-build: 1 bug found.
-CHECK-STDOUT: scan-build: Run 'scan-view {{.*}}' to examine bug reports.
-
-// We expect both html files and the plist files.
-RUN: ls %t.output_dir/*/ | FileCheck %s -check-prefix CHECK-FILENAMES
-
-CHECK-FILENAMES: index.html
-CHECK-FILENAMES-DAG: report-{{.*}}.html
-CHECK-FILENAMES-DAG: report-{{.*}}.plist
-CHECK-FILENAMES: scanview.css
-CHECK-FILENAMES: sorttable.js

diff  --git a/clang/test/Analysis/scan-build/plist_output.test b/clang/test/Analysis/scan-build/plist_output.test
deleted file mode 100644
index ffef11656317..000000000000
--- a/clang/test/Analysis/scan-build/plist_output.test
+++ /dev/null
@@ -1,22 +0,0 @@
-REQUIRES: system-darwin
-
-RUN: rm -rf %t.output_dir && mkdir %t.output_dir
-RUN: %scan-build -plist -o %t.output_dir %clang %S/Inputs/single_null_dereference.c \
-RUN:     | FileCheck %s -check-prefix CHECK-STDOUT
-
-// Test plist output
-
-CHECK-STDOUT: scan-build: Using '{{.*}}' for static analysis
-CHECK-STDOUT: scan-build: Analysis run complete.
-CHECK-STDOUT: scan-build: Analysis results (plist files) deposited in '{{.*}}'
-
-// We expect a single plist file
-RUN: ls %t.output_dir/*/ | FileCheck %s -check-prefix CHECK-FILENAMES
-
-CHECK-FILENAMES: report-{{.*}}.plist
-
-// The report should describe the issue.
-RUN: cat %t.output_dir/*/report-*.plist \
-RUN:     | FileCheck %s -check-prefix CHECK-REPORT-PLIST-CONTENTS
-
-CHECK-REPORT-PLIST-CONTENTS: <key>type</key><string>Dereference of null pointer</string>

diff  --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 88803466b8bf..1ffb6d094d72 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -62,7 +62,7 @@
 
 tools = [
     'c-index-test', 'clang-
diff ', 'clang-format', 'clang-tblgen', 'opt', 'llvm-ifs',
-    'scan-build', ToolSubst('%clang_extdef_map', command=FindTool(
+    ToolSubst('%clang_extdef_map', command=FindTool(
         'clang-extdef-mapping'), unresolved='ignore'),
 ]
 

diff  --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py
index cb5b4337ba71..b0432995df14 100644
--- a/llvm/utils/lit/lit/llvm/config.py
+++ b/llvm/utils/lit/lit/llvm/config.py
@@ -411,7 +411,6 @@ def use_clang(self, additional_tool_dirs=[], additional_flags=[], required=True)
             ToolSubst('%clang_cpp', command=self.config.clang, extra_args=['--driver-mode=cpp']+additional_flags),
             ToolSubst('%clang_cl', command=self.config.clang, extra_args=['--driver-mode=cl']+additional_flags),
             ToolSubst('%clangxx', command=self.config.clang, extra_args=['--driver-mode=g++']+additional_flags),
-            ToolSubst('%scan-build', command='scan-build'),
             ]
         self.add_tool_substitutions(tool_substitutions)
 


        


More information about the cfe-commits mailing list