Closed leporia closed 6 months ago
Sorry, it seems latest GNU removed function level branch coverage feature.
Please use llvm-cov gcov
instead, which is a part of LLVM infrastructure installed in the provided server. For instance, enter the following command to check the function level branch coverage summary.
llvm-cov gcov -b -f bin
Thanks, but now it seems that I have another problem as it says "No branches" for all functions.
Actually I don't really need this feature as using lcov
and genhtml
give similar data. I was just wondering if it is required to report a similar output or is enough to describe and motivate. I'm talking specifically for Part IV subpoint c. For the other points it shouldn't be needed if I'm understanding correctly.
Function 'initialize'
Lines executed:0.00% of 6
No branches
No calls
Function 'ALIM'
Lines executed:0.00% of 2
No branches
No calls
Function 'Inhibit_Biased_Climb'
Lines executed:0.00% of 2
No branches
No calls
Function 'Non_Crossing_Biased_Climb'
Lines executed:0.00% of 14
No branches
No calls
Function 'Non_Crossing_Biased_Descend'
Lines executed:0.00% of 14
No branches
No calls
Function 'Own_Below_Threat'
Lines executed:0.00% of 2
No branches
No calls
Function 'Own_Above_Threat'
Lines executed:0.00% of 2
No branches
No calls
Function 'alt_sep_test'
Lines executed:0.00% of 24
No branches
No calls
Function 'main'
Lines executed:21.05% of 38
No branches
No calls
File 'tcas-mod-mcdc.c'
Lines executed:7.69% of 104
Branches executed:4.17% of 48
Taken at least once:2.08% of 48
No calls
Creating 'tcas-mod-mcdc.c.gcov'
Thank you for the timely question.
I found that TA upgraded haster machines to use ubuntu 22 and a new version of gcc/gcov was installed, which shows only line coverage information on each function.
Thus, you don't have to report branch coverage information per function in your HW.
Using GCOV I cannot obtain the example output showed in the assignment PDF. I only see branch coverage for the overall file and only see line coverage for each function. For example this is what I obtain by running
gcov -b -f
But on the assignment pdf it shows an output in the following format
This is both on my local machine and on the given remote machine. On my machine I'm running
gcov (GCC) 13.2.1 20240316 (Red Hat 13.2.1-7)
On the remotegcov (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
I'm up-to-date on my machine, I cannot update the GCC suite any further. Which version of GCOV was used for the example? Is it okay if my output doesn't show branch coverage? Maybe I'm missing some additional arguments to GCOV?