platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.81k stars 787 forks source link

`pio run -t compiledb` does not generate compilation database for tests #4934

Open UtkarshVerma opened 2 months ago

UtkarshVerma commented 2 months ago

What kind of issue is this?

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Arch Linux

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.14

Description of problem

I use pio run -t compiledb to generate a compilation database that clangd can utilise. However, I noticed that the generated database does not include the path to unity.h and hence I get linter errors in my editor (neovim) whenever I try to include unity.h.

image

Steps to Reproduce

  1. pio run -t compiledb

Actual Results

Compilation database only generated for project root.

Expected Results

Compilation database should also be generated for tests.

ivankravets commented 2 months ago

Could try to add Unity to lib_deps as described here https://registry.platformio.org/libraries/throwtheswitch/Unity/installation ?