1// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
2// RUN: clang-tidy %t.cpp -checks='-*,google-explicit-constructor,llvm-namespace-comment' -fix -export-fixes=%t.yaml -- > %t.msg 2>&1
3// RUN: FileCheck -input-file=%t.cpp %s
4// RUN: FileCheck -input-file=%t.msg -check-prefix=CHECK-MESSAGES %s
5// RUN: FileCheck -input-file=%t.yaml -check-prefix=CHECK-YAML %s
6
7namespace i {
8void f(); // So that the namespace isn't empty.
9}
10// CHECK: } // namespace i
11// CHECK-MESSAGES: note: FIX-IT applied suggested code changes
12// CHECK-YAML: ReplacementText: ' // namespace i'
13
14class A { A(int i); };
15// CHECK: class A { explicit A(int i); };
16// CHECK-MESSAGES: note: FIX-IT applied suggested code changes
17// CHECK-MESSAGES: clang-tidy applied 2 of 2 suggested fixes.
18// CHECK-YAML: ReplacementText: 'explicit '
19

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