Sonarqube cfamily analysis without project or solution file

Thanks :slight_smile:
Have a great week,

I will open another topic about C# analysing about unittest details, I think offically its not supported.
But I could make a generic test format execution report and use that in the tests maybe sonarqube takes it. Or is it wasting my time?

I already attached to a existing topic of it listed here
test execution format question c#

I have another question about the source code analysis.

I see that a header file contains a defintion for a function named

uint16_t analog_ophaal();

Remove this unused function.See Rule

But in a other file named adc.c
This function is implemented and used.

So then this code smell is a false positive ?

@Abbas
I have another question related to the test source files.
currently I get

16:40:35.132 INFO: Parsing C:\Jenkins\workspace\OPS_MISRA\trunk\SonarQube_Test_Execution_report.xml

16:40:35.149 INFO: Imported test execution data for 0 files

16:40:35.149 INFO: Test execution data ignored for 1 unknown files, including:

tests/test/test_buzzer.c

I think the issue is that i have a root folder with

 root/source
 root/test/test

Sonar scanner I supply with

-Dsonar.source = source
-Dsonar.tests=/test/test/

Maybe it must be sonar.tests=test/test I have to look for it.
But I think the test files dont needs to be misra analyzed but they need to be part of the source somehow to find leads to test report.xml and the tests right?

Something is going wrong here for me :stuck_out_tongue:

edit:
nevermind I got it working lol
Except this is a static generic file with using static forced paths to the code files but it works :slight_smile:

I changed it to
Sonar scanner I supply with

-Dsonar.source = source,test/test
-Dsonar.tests=test/test/

the test xml is

<testExecutions version="1">
  <file path="test/test/test_buzzer.c">
     <testCase name="test_buzzer_on" duration="500">
      <skipped message="short message">other</skipped>
    </testCase>
  </file>  
  <file path="test/test/test_rs232.c">
     <testCase name="test_good_ascu_status_transmit_pending_rs232_transmit_txif_flag_false_and_transmit_shift_register_trmt_false_result" duration="2000"></testCase>
  </file>  
</testExecutions>

but now is my problem that my current generated junit report is named as this xml

<testsuite name="test_buzzer" tests="1" failures="0" skipped="0" time="0.067357">
    <testcase name="test_buzzer_on" />
  </testsuite>

Some how .c is missing and the full path to the testname
Thats some dev work todo to generate a test generic execution format dynamic.

What also is a little bit a bummer is that I cant see tests under a test file
like this I can see

And I can click on it to see the complete source file but not the testcases ?
While the test execution xml contains skipped, failed, tags so the information is there.
why sonarqube cannot render it?