From 843fb11999c2dcc016a5d0bd34237d9fd8bdeb74 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 13 Feb 2026 11:55:06 +0100 Subject: pkg/codesearch: test that compile_commands.json is loaded --- pkg/codesearch/testdata/source0.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg/codesearch/testdata') 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 -- cgit mrf-deployment