aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/codesearch/testdata/source0.c
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2026-02-13 11:55:06 +0100
committerDmitry Vyukov <dvyukov@google.com>2026-02-13 15:23:36 +0000
commit843fb11999c2dcc016a5d0bd34237d9fd8bdeb74 (patch)
tree8912267a4d8a835b4078c8dbbeefe7302d6c8660 /pkg/codesearch/testdata/source0.c
parent6a673c5037dce5b85634cac4fabcc3fa5d33bb43 (diff)
pkg/codesearch: test that compile_commands.json is loaded
Diffstat (limited to 'pkg/codesearch/testdata/source0.c')
-rw-r--r--pkg/codesearch/testdata/source0.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/codesearch/testdata/source0.c b/pkg/codesearch/testdata/source0.c
index 9482908c9..4d90dddbf 100644
--- a/pkg/codesearch/testdata/source0.c
+++ b/pkg/codesearch/testdata/source0.c
@@ -44,3 +44,10 @@ int field_refs(struct some_struct* p, union some_union* u)
u->s.x = 2;
return p->x;
}
+
+// compile_commands.json we create for tests defines KBUILD_BASENAME.
+// If it's not defined, compile_commands.json is not properly loaded.
+// This is supposed to fail builds, if that happens.
+#ifndef KBUILD_BASENAME
+#error "compile_commands.json is not loaded"
+#endif