diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-04 10:31:23 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-04 10:31:23 +0000 |
commit | fb98b74f8e20c56776c7f1147c755d8bd01ee8a7 (patch) | |
tree | d4359ae08dac6ea2a50980e4eb08c5cf53be914d /clang-tools-extra/test/clang-tidy/fix.cpp | |
parent | bb72e6c804c9abd5dcd0b3777e2a494497ed05b7 (diff) | |
download | bcm5719-llvm-fb98b74f8e20c56776c7f1147c755d8bd01ee8a7.tar.gz bcm5719-llvm-fb98b74f8e20c56776c7f1147c755d8bd01ee8a7.zip |
[clang-tidy] Add an option to export suggested fixes into a file.
Allows gathering fixes and applying them with clang-apply-fixes.
Differential Revision: http://reviews.llvm.org/D5176
llvm-svn: 217139
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/fix.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/fix.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang-tools-extra/test/clang-tidy/fix.cpp b/clang-tools-extra/test/clang-tidy/fix.cpp index f82ed0b1670..80b215d82b8 100644 --- a/clang-tools-extra/test/clang-tidy/fix.cpp +++ b/clang-tools-extra/test/clang-tidy/fix.cpp @@ -1,14 +1,17 @@ // RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp -// RUN: clang-tidy %t.cpp -checks='-*,google-explicit-constructor,llvm-namespace-comment' -fix -- > %t.msg 2>&1 +// RUN: clang-tidy %t.cpp -checks='-*,google-explicit-constructor,llvm-namespace-comment' -fix -export-fixes=%t.yaml -- > %t.msg 2>&1 // RUN: FileCheck -input-file=%t.cpp %s // RUN: FileCheck -input-file=%t.msg -check-prefix=CHECK-MESSAGES %s +// RUN: FileCheck -input-file=%t.yaml -check-prefix=CHECK-YAML %s namespace i { } // CHECK: } // namespace i // CHECK-MESSAGES: note: FIX-IT applied suggested code changes +// CHECK-YAML: ReplacementText: ' // namespace i' class A { A(int i); }; // CHECK: class A { explicit A(int i); }; // CHECK-MESSAGES: note: FIX-IT applied suggested code changes // CHECK-MESSAGES: clang-tidy applied 2 of 2 suggested fixes. +// CHECK-YAML: ReplacementText: 'explicit ' |