[include-fixer] Add a test for the full round trip through libclang and the plugin.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 17 Nov 2016 15:23:06 +0000 (15:23 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 17 Nov 2016 15:23:06 +0000 (15:23 +0000)
llvm-svn: 287230

clang-tools-extra/test/include-fixer/yamldb_plugin.cpp [new file with mode: 0644]

diff --git a/clang-tools-extra/test/include-fixer/yamldb_plugin.cpp b/clang-tools-extra/test/include-fixer/yamldb_plugin.cpp
new file mode 100644 (file)
index 0000000..5ec9f89
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: c-index-test -test-load-source-reparse 2 all %s -Xclang -add-plugin -Xclang clang-include-fixer -fspell-checking -Xclang -plugin-arg-clang-include-fixer -Xclang -input=%p/Inputs/fake_yaml_db.yaml 2>&1 | FileCheck %s
+
+foo f;
+
+// CHECK: yamldb_plugin.cpp:3:1: error: unknown type name 'foo'; did you mean 'foo'?
+// CHECK: Number FIX-ITs = 1
+// CHECK: FIX-IT: Replace [3:1 - 3:4] with "foo"
+// CHECK: yamldb_plugin.cpp:3:1: note: Add '#include "foo.h"' to provide the missing declaration [clang-include-fixer]
+// CHECK: Number FIX-ITs = 1
+// CHECK: FIX-IT: Replace [3:1 - 3:4] with "#include "foo.h"