1// RUN: clang-tidy -dump-config | FileCheck %s
2// RUN: clang-tidy -dump-config -use-color | FileCheck -check-prefix=CHECK-CONFIG-COLOR %s
3// RUN: clang-tidy -dump-config -use-color=false | FileCheck -check-prefix=CHECK-CONFIG-NO-COLOR %s
4// RUN: clang-tidy -config='UseColor: true' -dump-config | FileCheck -check-prefix=CHECK-CONFIG-COLOR %s
5// RUN: clang-tidy -config='UseColor: false' -dump-config | FileCheck -check-prefix=CHECK-CONFIG-NO-COLOR %s
6// RUN: clang-tidy -help | FileCheck -check-prefix=CHECK-OPT-PRESENT %s
7
8// RUN: clang-tidy -checks='-*, modernize-use-override' -use-color=false %s -- -std=c++11 | FileCheck -check-prefix=CHECK-NO-COLOR %s
9// RUN: clang-tidy -checks='-*, modernize-use-override' %s -- -std=c++11 | FileCheck -check-prefix=CHECK-NO-COLOR %s
10// RUN: clang-tidy -checks='-*, modernize-use-override' -use-color %s -- -std=c++11 | FileCheck -check-prefix=CHECK-COLOR %s
11
12// CHECK-NOT: UseColor
13// CHECK-CONFIG-NO-COLOR: UseColor: false
14// CHECK-CONFIG-COLOR: UseColor: true
15// CHECK-OPT-PRESENT: --use-color
16
17class Base {
18public:
19 virtual ~Base() = 0;
20};
21
22class Delivered : public Base {
23public:
24 virtual ~Delivered() = default;
25 // CHECK-NO-COLOR: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
26 // CHECK-COLOR: {{.\[0;1;35m}}warning: {{.\[0m}}{{.\[1m}}prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
27};
28

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