Hello @isaactorz,
A header file is not analyzed by itself, but because it is included from another file. In the case of a header-only library, this other file can be a unit test file that exercises the header. In that case, the test file should be included as part of sonar.sources
, not sonar.tests
, which is not supported for C or C++ (see more details).
If you don’t specify sonar.sources
, it will default to your project root, and include the test files. As soon as you specify it, you must ensure that test files are part of it.
If the previous comment does not solve your issue, we will need to see your compile_commands.json
file, to better understand the structure of your project.