================
@@ -0,0 +1,25 @@
+# Test that clangd-indexer respects CompileFlags
+
+# RUN: rm -rf %t.dir && mkdir -p %t.dir
+# RUN: split-file %s %t.dir
+
+# By default config is disabled, so the .clangd file's CompileFlags.Add is not
+# applied and the #error below must fire.
+# RUN: clangd-indexer %t.dir/test.cpp 2>&1 | FileCheck --check-prefix=DISABLED 
%s
+# DISABLED: error: "FROM_CLANGD_FILE not defined - .clangd file was not 
applied"
+
+# With config enabled, the .clangd file's CompileFlags.Add should define
+# FROM_CLANGD_FILE, so the #error below must not fire.
+# RUN: clangd-indexer --enable-config %t.dir/test.cpp 2>&1 \
----------------
HighCommander4 wrote:

another nit: it doesn't hurt to separate the indexer's stdout (which contains 
the index contents) from the stderr (which contains status / diagnostic 
messages), so that the former (which is binary data) is not passed through 
`FileCheck`

See how the test I've pushed does it.

https://github.com/llvm/llvm-project/pull/214951
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to