diff options
Diffstat (limited to 'clang-tools-extra/test/include-fixer')
-rw-r--r-- | clang-tools-extra/test/include-fixer/commandline_options.cpp | 6 | ||||
-rw-r--r-- | clang-tools-extra/test/include-fixer/multiple_fixes.cpp | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/clang-tools-extra/test/include-fixer/commandline_options.cpp b/clang-tools-extra/test/include-fixer/commandline_options.cpp index a9d054984d9..85c7e26bd7d 100644 --- a/clang-tools-extra/test/include-fixer/commandline_options.cpp +++ b/clang-tools-extra/test/include-fixer/commandline_options.cpp @@ -1,9 +1,9 @@ // REQUIRES: shell // RUN: echo "foo f;" > %t.cpp // RUN: clang-include-fixer -db=fixed -input='foo= "foo.h","bar.h"' -output-headers %t.cpp -- | FileCheck %s -// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"}]}' %t.cpp | FileCheck %s -check-prefix=CHECK-CODE -// RUN: cat %t.cpp | not clang-include-fixer -stdin -insert-header='{QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"},{Header: "\"foo2.h\"", QualifiedName: "foo"}]}' %t.cpp -// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "a:foo"},{Header: "\"foo.h\"", QualifiedName: "b:foo"}]}' %t.cpp +// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{FilePath: %t.cpp, QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"}]}' %t.cpp | FileCheck %s -check-prefix=CHECK-CODE +// RUN: cat %t.cpp | not clang-include-fixer -stdin -insert-header='{FilePath: %t.cpp, QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "foo"},{Header: "\"foo2.h\"", QualifiedName: "foo"}]}' %t.cpp +// RUN: cat %t.cpp | clang-include-fixer -stdin -insert-header='{FilePath: %t.cpp, QuerySymbolInfos: [{RawIdentifier: foo, Range: {Offset: 0, Length: 3}}], HeaderInfos: [{Header: "\"foo.h\"", QualifiedName: "a:foo"},{Header: "\"foo.h\"", QualifiedName: "b:foo"}]}' %t.cpp // // CHECK: "HeaderInfos": [ // CHECK-NEXT: {"Header": "\"foo.h\"", diff --git a/clang-tools-extra/test/include-fixer/multiple_fixes.cpp b/clang-tools-extra/test/include-fixer/multiple_fixes.cpp new file mode 100644 index 00000000000..35a73b4a0af --- /dev/null +++ b/clang-tools-extra/test/include-fixer/multiple_fixes.cpp @@ -0,0 +1,13 @@ +// REQUIRES: shell +// RUN: sed -e 's#//.*$##' %s > %t.cpp +// RUN: mkdir -p %T/include-fixer/multiple-fixes +// RUN: echo 'foo f;' > %T/include-fixer/multiple-fixes/foo.cpp +// RUN: echo 'bar b;' > %T/include-fixer/multiple-fixes/bar.cpp +// RUN: clang-include-fixer -db=fixed -input='foo= "foo.h";bar= "bar.h"' %T/include-fixer/multiple-fixes/*.cpp -- +// RUN: FileCheck -input-file=%T/include-fixer/multiple-fixes/bar.cpp %s -check-prefix=CHECK-BAR +// RUN: FileCheck -input-file=%T/include-fixer/multiple-fixes/foo.cpp %s -check-prefix=CHECK-FOO +// +// CHECK-FOO: #include "foo.h" +// CHECK-FOO: foo f; +// CHECK-BAR: #include "bar.h" +// CHECK-BAR: bar b; |