1// REQUIRES: shell
2// RUN: sed 's/placeholder_for_f/f/' %s > %t.cpp
3// RUN: clang-tidy -checks=-*,modernize-use-override %t.cpp -- -std=c++11 | FileCheck -check-prefix=CHECK-SANITY %s
4// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -- -std=c++11 2>&1 | FileCheck %s
5// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -quiet -- -std=c++11 2>&1 | FileCheck -check-prefix=CHECK-QUIET %s
6// RUN: mkdir -p %T/compilation-database-test/
7// RUN: echo '[{"directory": "%T", "command": "clang++ -o test.o -std=c++11 %t.cpp", "file": "%t.cpp"}]' > %T/compilation-database-test/compile_commands.json
8// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -path %T/compilation-database-test 2>&1 | FileCheck -check-prefix=CHECK %s
9struct A {
10 virtual void f() {}
11 virtual void g() {}
12};
13// CHECK-NOT: warning:
14// CHECK-QUIET-NOT: warning:
15struct B : public A {
16 void placeholder_for_f() {}
17// CHECK-SANITY: [[@LINE-1]]:8: warning: annotate this
18// CHECK: [[@LINE-2]]:8: warning: annotate this
19// CHECK-QUIET: [[@LINE-3]]:8: warning: annotate this
20 void g() {}
21// CHECK-SANITY: [[@LINE-1]]:8: warning: annotate this
22// CHECK-NOT: warning:
23// CHECK-QUIET-NOT: warning:
24};
25// CHECK-SANITY-NOT: Suppressed
26// CHECK-QUIET-NOT: Suppressed
27

source code of clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp