summaryrefslogtreecommitdiff
path: root/test/Index/compile_commands.json
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2012-06-30 11:27:57 +0000
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2012-06-30 11:27:57 +0000
commitdb29318326aba9e0c5c1bbba093687dccc38fc39 (patch)
tree8992987de8bd89b9bf8c621b73afe133a91655e5 /test/Index/compile_commands.json
parent82a53bd3895387fbcc98e97f5f125f9241fe41cf (diff)
downloadclang-db29318326aba9e0c5c1bbba093687dccc38fc39.tar.gz
[libclang] add CompilationDatabase support
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/compile_commands.json')
-rw-r--r--test/Index/compile_commands.json27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Index/compile_commands.json b/test/Index/compile_commands.json
new file mode 100644
index 0000000000..89d9f0dd52
--- /dev/null
+++ b/test/Index/compile_commands.json
@@ -0,0 +1,27 @@
+[
+{
+ "directory": "/home/john.doe/MyProject",
+ "command": "clang++ -o project.o -c /home/john.doe/MyProject/project.cpp",
+ "file": "/home/john.doe/MyProject/project.cpp"
+},
+{
+ "directory": "/home/john.doe/MyProjectA",
+ "command": "clang++ -o project2.o -c /home/john.doe/MyProject/project2.cpp",
+ "file": "/home/john.doe/MyProject/project2.cpp"
+},
+{
+ "directory": "/home/john.doe/MyProjectB",
+ "command": "clang++ -DFEATURE=1 -o project2-feature.o -c /home/john.doe/MyProject/project2.cpp",
+ "file": "/home/john.doe/MyProject/project2.cpp"
+}
+]
+# RUN: c-index-test -compilation-db %s
+# RUN: c-index-test -compilation-db lookup file_does_not_exists.cpp %s | FileCheck -check-prefix=FILE-NOT-FOUND %s
+# FILE-NOT-FOUND: file file_does_not_exists.cpp not found in compilation db
+
+# RUN: c-index-test -compilation-db lookup /home/john.doe/MyProject/project.cpp %s | FileCheck -check-prefix=FILE-1-CMD %s
+# FILE-1-CMD: workdir:'/home/john.doe/MyProject' cmdline:'clang++ -o project.o -c /home/john.doe/MyProject/project.cpp'
+
+# RUN: c-index-test -compilation-db lookup /home/john.doe/MyProject/project2.cpp %s | FileCheck -check-prefix=FILE-2-CMD %s
+# FILE-2-CMD: workdir:'/home/john.doe/MyProjectA' cmdline:'clang++ -o project2.o -c /home/john.doe/MyProject/project2.cpp'
+# FILE-2-CMD: workdir:'/home/john.doe/MyProjectB' cmdline:'clang++ -DFEATURE=1 -o project2-feature.o -c /home/john.doe/MyProject/project2.cpp'