How to Analyze a Project AND its Unit Test


i have a Project here:

Sonar Lint works fine here:

so, now:
i add a UNIT Test, using unity,
description here:

so, the Project is here:

the Test Runner is here:

in the Moment the

File only builds the Main Application but not the Test Runner.

how to build the Test Runner also, and also build-wrap an analyze it ?


Hello @franz-ms-muc,

Sorry for the late reply.
Are you still facing the issue?
We analyze the files that are built by the command wrapped with build-wrapper and indexed by the sonar-scanner.
To analyze the source and test file, the command provided to build wrapper should cleanly build both of them. you can combine the two in one script and wrap it.

You can look at the generated JSON file to see the compilation command captured by build-wrapper.
Let me know if you have further questions,

how can i FIRST build the App,
then Build the Tests ?

it is 2 Build Commands.
how to do ?

so to make it more clear:

i must issue a build in the Main Folder,
and a build in the Unit Tests Folder ?

how can this be done ?

it is calling the Script 2 times in different Folders ?

Hello @franz-ms-muc,

I’m not sure I understand the issue you are facing.

Let’s try to follow your example:

In this case, if you want to analyze both source and test I would create a script that runs both. Let’s say that call build and test.

Then instead of calling:
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} build

i would call:
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} ``` bash

Does that answer your question?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.