1
linux/tools/testing/kunit
Brendan Jackman e4835f1da4 kunit: tool: Build compile_commands.json
compile_commands.json is used by clangd[1] to provide code navigation
and completion functionality to editors. See [2] for an example
configuration that includes this functionality for VSCode.

It can currently be built manually when using kunit.py, by running:

  ./scripts/clang-tools/gen_compile_commands.py -d .kunit

With this change however, it's built automatically so you don't need to
manually keep it up to date.

Unlike the manual approach, having make build the compile_commands.json
means that it appears in the build output tree instead of at the root of
the source tree, so you'll need to add --compile-commands-dir=.kunit to
your clangd args for it to be found. This might turn out to be pretty
annoying, I'm not sure yet. If so maybe we can later add some hackery to
kunit.py to work around it.

[1] https://clangd.llvm.org/
[2] https://github.com/FlorentRevest/linux-kernel-vscode

Signed-off-by: Brendan Jackman <jackmanb@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2024-09-12 09:52:36 -06:00
..
configs linux_kselftest-kunit-fixes-6.9-rc2 2024-03-29 15:35:12 -07:00
qemu_configs RISC-V: drop SOC_VIRT for ARCH_VIRT 2024-04-10 11:37:50 +01:00
test_data kunit: tool: add test for parsing attributes 2023-12-18 13:21:15 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kunit_config.py kunit: tool: fix pre-existing mypy --strict errors and update run_checks.py 2023-03-17 12:28:30 -06:00
kunit_json.py kunit: tool: misc cleanups 2022-05-16 13:22:36 -06:00
kunit_kernel.py kunit: tool: Build compile_commands.json 2024-09-12 09:52:36 -06:00
kunit_parser.py kunit: tool: fix parsing of test attributes 2023-12-18 13:21:15 -07:00
kunit_printer.py kunit: tool: add subscripts for type annotations where appropriate 2023-03-17 12:28:18 -06:00
kunit_tool_test.py kunit: tool: add test for parsing attributes 2023-12-18 13:21:15 -07:00
kunit.py kunit: tool: Add command line interface to filter and report attributes 2023-07-26 13:29:21 -06:00
mypy.ini kunit: tool: undo type subscripts for subprocess.Popen 2023-05-08 08:39:41 -06:00
qemu_config.py kunit: tool: Add support for overriding the QEMU serial port 2023-04-05 12:51:06 -06:00
run_checks.py kunit: tool: undo type subscripts for subprocess.Popen 2023-05-08 08:39:41 -06:00