2017-02-18 05:31:31 +08:00
|
|
|
// REQUIRES: shell
|
2014-06-25 22:09:52 +08:00
|
|
|
// RUN: sed 's/placeholder_for_f/f/' %s > %t.cpp
|
2015-08-31 21:17:43 +08:00
|
|
|
// RUN: clang-tidy -checks=-*,modernize-use-override %t.cpp -- -std=c++11 | FileCheck -check-prefix=CHECK-SANITY %s
|
2015-10-22 19:31:44 +08:00
|
|
|
// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -- -std=c++11 2>&1 | FileCheck %s
|
2017-02-10 02:32:02 +08:00
|
|
|
// 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
|
2017-02-18 03:31:43 +08:00
|
|
|
// RUN: mkdir -p %T/compilation-database-test/
|
|
|
|
// RUN: echo '[{"directory": "%T", "command": "clang++ -o test.o -std=c++11 %t.cpp", "file": "%t.cpp"}]' > %T/compilation-database-test/compile_commands.json
|
|
|
|
// 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
|
2014-06-25 22:09:52 +08:00
|
|
|
struct A {
|
|
|
|
virtual void f() {}
|
|
|
|
virtual void g() {}
|
|
|
|
};
|
2014-11-20 20:05:51 +08:00
|
|
|
// CHECK-NOT: warning:
|
2017-02-10 02:32:02 +08:00
|
|
|
// CHECK-QUIET-NOT: warning:
|
2014-06-25 22:09:52 +08:00
|
|
|
struct B : public A {
|
|
|
|
void placeholder_for_f() {}
|
2015-02-28 00:50:32 +08:00
|
|
|
// CHECK-SANITY: [[@LINE-1]]:8: warning: annotate this
|
|
|
|
// CHECK: [[@LINE-2]]:8: warning: annotate this
|
2017-02-10 02:32:02 +08:00
|
|
|
// CHECK-QUIET: [[@LINE-3]]:8: warning: annotate this
|
2014-06-25 22:09:52 +08:00
|
|
|
void g() {}
|
2015-02-28 00:50:32 +08:00
|
|
|
// CHECK-SANITY: [[@LINE-1]]:8: warning: annotate this
|
2014-06-25 22:09:52 +08:00
|
|
|
// CHECK-NOT: warning:
|
2017-02-10 02:32:02 +08:00
|
|
|
// CHECK-QUIET-NOT: warning:
|
2014-06-25 22:09:52 +08:00
|
|
|
};
|
|
|
|
// CHECK-SANITY-NOT: Suppressed
|
|
|
|
// CHECK: Suppressed 1 warnings (1 due to line filter).
|
2017-02-10 02:32:02 +08:00
|
|
|
// CHECK-QUIET-NOT: Suppressed
|