[clang-tools-extra] r347760 - [clang-tidy] Added a test -export-fixes with relative paths.

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 28 06:43:26 PST 2018


Author: ibiryukov
Date: Wed Nov 28 06:43:26 2018
New Revision: 347760

URL: http://llvm.org/viewvc/llvm-project?rev=347760&view=rev
Log:
[clang-tidy] Added a test -export-fixes with relative paths.

Summary: A test for D51864.

Reviewers: ioeric, steveire

Reviewed By: steveire

Subscribers: xazax.hun, cfe-commits

Differential Revision: https://reviews.llvm.org/D51865

Added:
    clang-tools-extra/trunk/test/clang-tidy/export-relpath.cpp

Added: clang-tools-extra/trunk/test/clang-tidy/export-relpath.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/export-relpath.cpp?rev=347760&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/export-relpath.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/export-relpath.cpp Wed Nov 28 06:43:26 2018
@@ -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 '




More information about the cfe-commits mailing list