Blank Coverage Report when source files are not in the src folder of the project

45 views
Skip to first unread message

Pranoti Joshi

unread,
Jun 25, 2025, 5:17:40 AMJun 25
to ThrowTheSwitch Forums
Hello All,

I am trying to create the coverage report for the executed tests.
The report is generated properly if I place the source files under the src folder.

However I am referring the source files from the software project folder by configuring the path in the yml file. In this case I can execute the tests and can see the coverage on the command prompt. But the html coverage report remains blank when I execute 
ceedling utils:gcov

The paths are as follows:

Software project source files:
SWCB5\CB5SW2803\bsp\src\adc

Ceedling Project files
SWCB5\unit_test_cb5IE\build\artifacts\gcov

I tried manually creating the gcov files in the gcov folder and then run 
ceedling utils:gcov
but still the report remains blank

Following is the coverage in project.yml file.

:gcov:
  :html_report_type: detailed
  :html_report: true
  :gcovr:
    :html_medium_threshold: 75
    :html_high_threshold: 90
    :use_legacy_output: false
    :additional_options:
      - --txt-metric=branch
      - --sort-key=uncovered-percent


Can anyone suggest the right way to resolve the paths to view the coverage report?
I do not want to move the source files every time to the src folder. Since we would be testing the code which can be present in different folders.

Below is the Ceedling version I have:

 Ceedling:: 0.31.1
      Unity:: 2.5.4
      CMock:: 2.5.4
 CException:: 1.3.4

Mathieu Dinel

unread,
Jun 25, 2025, 7:22:48 AMJun 25
to ThrowTheSwitch Forums
Hi,
I remember facing this problem (a few years ago ? Time flies....) We use src/ and test/ but in a non standard way. we have a big repo and we split sources with many project.yml files (in src/subfolders) to parallelize our CI/CD pipeline. the test files are outside of the scope of project.yml files.
Here is an example of what works for me:
:project:
  :build_root: &buildRoot ./artifacts/build
:gcov:
  :gcovr:
    :object_directory: *buildRoot
    :report_include: "^src" #because we do use src/ but the test files are outside, in tests/ adjust to your project.

we invoke ceedling from the project root and inject the current project.yml through ceedling environment vars

Yahya Aouled Amer

unread,
Jun 25, 2025, 5:38:02 PMJun 25
to ThrowTheSwitch Forums
Can you update your ceedling version to the last version?
I think this will add many other fields in the yml file.
There is some fields that you need to uncomment for the cov report to be generated

Pranoti Joshi

unread,
Jun 26, 2025, 5:34:48 AMJun 26
to ThrowTheSwitch Forums
Hello Yahya. Can you please let me know which part will have to be uncommented?? I will update the ceedling version.

Yahya Aouled Amer

unread,
Jun 27, 2025, 2:28:48 PMJun 27
to ThrowTheSwitch Forums
I'll check my ceedling project configuration and get back to you asap

Yahya Aouled Amer

unread,
Jun 28, 2025, 8:08:07 AMJun 28
to ThrowTheSwitch Forums
You need to uncomment -gcov under plugins 
you check my project here  yahyayozo/cLog: A small log module in C language
run ceedling gcov:all to generate the coverage report
don't forget to update ceedling to the latest version
Reply all
Reply to author
Forward
0 new messages