Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

Ceedling Gcov 0% coverage report

Open vatsalnaikgit opened this issue 4 years ago • 14 comments

I am using Mac OS 12.0.1 ,

`-------------------------- GCOV: OVERALL TEST SUMMARY

TESTED: 14 PASSED: 14 FAILED: 0 IGNORED: 0


GCOV: CODE COVERAGE SUMMARY

test_file.c Lines executed:0.00% of 236 test_file.c Branches executed:0.00% of 398 test_file.c Taken at least once:0.00% of 398 test_file.c No calls `

vatsalnaikgit avatar Nov 19 '21 22:11 vatsalnaikgit

My first guess would be that you mocked too much :)

Letme avatar Nov 20 '21 08:11 Letme

Haha, I have tested the code in linux vm, and it does work but it just doesn’t show coverage in mac.

vatsalnaikgit avatar Nov 20 '21 19:11 vatsalnaikgit

So there is a difference in how you run the gcov? It has verbosity option to get more details

Letme avatar Nov 21 '21 00:11 Letme

Yes, I have recently switched to Mac OS, and not able to run gcov on this.

vatsalnaikgit avatar Nov 21 '21 22:11 vatsalnaikgit

If you can't spot the difference maybe you can paste some logs with verbosity[4] before gcov command.

Letme avatar Nov 22 '21 00:11 Letme

I am having the same issue here.

I tried this in Windows and on my Jenkins server on Ubuntu 20.04, Using verbosity[4] I see nothing out of the ordinary. gcovr_log.txt

MichaelBMiner avatar Dec 07 '21 19:12 MichaelBMiner

@MichaelBMiner I do not think you are. Be careful because you need to define gcov_compiler and gcov_linker and stuff to get --coverage information. What author is saying is that coverage is working on Linux VM, but not on mac. So while this could be gcc difference (maybe mac is using clang to compile) a full verbose log along with project.yml would be really helpful in finding something different.

Letme avatar Dec 07 '21 20:12 Letme

@Letme I attached a log above. Here is the yml file. The file name is different but I create a symlink between this an project.yml, then remove my project.yml link. pneumatic_project.txt

MichaelBMiner avatar Mar 15 '22 14:03 MichaelBMiner

See your log it has:

---------------------------
GCOV: CODE COVERAGE SUMMARY
---------------------------
> Shell executed command:
'gcov.exe -n -p -b -o "build/gcov/out" "keazxx_temp.c"'
> Produced output:
File '../libraries/keazxxlib/source/keazxx_temp.c'
Lines executed:89.66% of 29
Branches executed:100.00% of 6
Taken at least once:50.00% of 6
Calls executed:71.43% of 7

keazxx_temp.c Lines executed:89.66% of 29
keazxx_temp.c Branches executed:100.00% of 6
keazxx_temp.c Taken at least once:50.00% of 6
keazxx_temp.c Calls executed:71.43% of 7

How is this the same as the issue where Ceedling Gcov reports 0% in coverage report?

The attached log file does not seem complete and from gut feeling it is also missing any coverage generation information for the GCC (-fprofile-arcs -ftest-coverage). Also attached project.yml file seems incomplete and it is missing sections for gcov_compiler and gcov_linker. Also the ceedling command you ran is missing from the log, so I do not know if you called it with gcov:all or if you also called utils:gcov (could be some old interface, but it will help active maintainers with debugging). However your issue is not the current issue described initially in this ticket and that initial ticket seems unexplored and valid.

Letme avatar Mar 15 '22 19:03 Letme

I run with ceedling verbosity[4] clobber gcov:all utils:gcov > ceedling.txt The project.yml is taken from a different project which correctly build reports. I have not set the gcov_compiler and gcov_linker in that project either. ceedling.txt

A full log is provided.

MichaelBMiner avatar Mar 15 '22 19:03 MichaelBMiner

But this log also correctly describes the reports in the log file - so I am not sure what you are missing or trying to tell us is wrong. The test fails, so I assume it maybe stopped executing the commands (utils:gcov is not run?)

Letme avatar Mar 15 '22 20:03 Letme

No tests fail. In fact everything works. But when I open the files GcovCoverageCobertura.xml, GcovCoverageResults.css, and GcovCoverageResults.html nothing is displayed. The data is not filled in. GcovCoverageCobertura.xml.txt GcovCoverageResults.css.txt GcovCoverageResults.html.txt

MichaelBMiner avatar Mar 15 '22 20:03 MichaelBMiner

solution provided under https://github.com/ThrowTheSwitch/Ceedling/issues/447 ticket.

Keyur452 avatar Sep 15 '22 12:09 Keyur452

@vatsalnaikgit could be closed ?

vengelhardt avatar Sep 19 '25 14:09 vengelhardt