| 1 |
RUN: rm -rf %t.output_dir && mkdir %t.output_dir |
| 2 |
RUN: %scan-build -o %t.output_dir %clang -S \ |
| 3 |
RUN: %S/Inputs/multidirectory_project/directory1/file1.c \ |
| 4 |
RUN: %S/Inputs/multidirectory_project/directory2/file2.c \ |
| 5 |
RUN: | FileCheck %s -check-prefix CHECK-NO-EXCLUDE |
| 6 |
|
| 7 |
// The purpose of this test is to ensure that the --exclude command line option |
| 8 |
// actually excludes reports from inside the specified directories. |
| 9 |
|
| 10 |
|
| 11 |
// First, let's make sure that without --exclude issues in both |
| 12 |
// directory1 and directory2 are found. |
| 13 |
CHECK-NO-EXCLUDE: scan-build: 2 bugs found. |
| 14 |
|
| 15 |
|
| 16 |
// Only one issue should be found when directory1 is excluded. |
| 17 |
RUN: rm -rf %t.output_dir && mkdir %t.output_dir |
| 18 |
RUN: %scan-build -o %t.output_dir --exclude directory1 %clang -S \ |
| 19 |
RUN: %S/Inputs/multidirectory_project/directory1/file1.c \ |
| 20 |
RUN: %S/Inputs/multidirectory_project/directory2/file2.c \ |
| 21 |
RUN: | FileCheck %s -check-prefix CHECK-EXCLUDE1 |
| 22 |
|
| 23 |
CHECK-EXCLUDE1: scan-build: 1 bug found. |
| 24 |
|
| 25 |
|
| 26 |
// When both directories are excluded, no issues should be reported. |
| 27 |
RUN: rm -rf %t.output_dir && mkdir %t.output_dir |
| 28 |
RUN: %scan-build -o %t.output_dir --exclude directory1 --exclude directory2 %clang -S \ |
| 29 |
RUN: %S/Inputs/multidirectory_project/directory1/file1.c \ |
| 30 |
RUN: %S/Inputs/multidirectory_project/directory2/file2.c \ |
| 31 |
RUN: | FileCheck %s -check-prefix CHECK-EXCLUDE-BOTH |
| 32 |
|
| 33 |
CHECK-EXCLUDE-BOTH: scan-build: 0 bugs found. |
| 34 |
|