This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE347760: [clang-tidy] Added a test -export-fixes with 
relative paths. (authored by ibiryukov, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D51865?vs=164688&id=175682#toc

Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D51865/new/

https://reviews.llvm.org/D51865

Files:
  test/clang-tidy/export-relpath.cpp


Index: test/clang-tidy/export-relpath.cpp
===================================================================
--- test/clang-tidy/export-relpath.cpp
+++ test/clang-tidy/export-relpath.cpp
@@ -0,0 +1,19 @@
+// RUN: rm -rf %T/clang-tidy/export-relpath
+// RUN: mkdir -p %T/clang-tidy/export-relpath/subdir
+// RUN: cp %s %T/clang-tidy/export-relpath/subdir/source.cpp
+// RUN: echo '[{ "directory": "%T/clang-tidy/export-relpath/subdir", 
"command": "clang++ source.cpp", "file": 
"%T/clang-tidy/export-relpath/subdir/source.cpp"}]' > 
%T/clang-tidy/export-relpath/subdir/compile_commands.json
+//
+// Check that running clang-tidy in './subdir' and storing results
+// in './fixes.yaml' works as expected.
+//
+// RUN: cd %T/clang-tidy/export-relpath
+// RUN: clang-tidy -p subdir subdir/source.cpp 
-checks='-*,google-explicit-constructor,llvm-namespace-comment' 
-export-fixes=./fixes.yaml
+// RUN: FileCheck -input-file=%T/clang-tidy/export-relpath/fixes.yaml 
-check-prefix=CHECK-YAML %s
+
+namespace i {
+void f(); // So that the namespace isn't empty.
+}
+// CHECK-YAML: ReplacementText: ' // namespace i'
+
+class A { A(int i); };
+// CHECK-YAML: ReplacementText: 'explicit '


Index: test/clang-tidy/export-relpath.cpp
===================================================================
--- test/clang-tidy/export-relpath.cpp
+++ test/clang-tidy/export-relpath.cpp
@@ -0,0 +1,19 @@
+// RUN: rm -rf %T/clang-tidy/export-relpath
+// RUN: mkdir -p %T/clang-tidy/export-relpath/subdir
+// RUN: cp %s %T/clang-tidy/export-relpath/subdir/source.cpp
+// RUN: echo '[{ "directory": "%T/clang-tidy/export-relpath/subdir", "command": "clang++ source.cpp", "file": "%T/clang-tidy/export-relpath/subdir/source.cpp"}]' > %T/clang-tidy/export-relpath/subdir/compile_commands.json
+//
+// Check that running clang-tidy in './subdir' and storing results
+// in './fixes.yaml' works as expected.
+//
+// RUN: cd %T/clang-tidy/export-relpath
+// RUN: clang-tidy -p subdir subdir/source.cpp -checks='-*,google-explicit-constructor,llvm-namespace-comment' -export-fixes=./fixes.yaml
+// RUN: FileCheck -input-file=%T/clang-tidy/export-relpath/fixes.yaml -check-prefix=CHECK-YAML %s
+
+namespace i {
+void f(); // So that the namespace isn't empty.
+}
+// CHECK-YAML: ReplacementText: ' // namespace i'
+
+class A { A(int i); };
+// CHECK-YAML: ReplacementText: 'explicit '
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to