-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request to Implement the lcov "-t" option. #39
Comments
Sure, I never heard back from the guy on the other issue, but it sounds like this is a commonly used feature. In that case here's what I'm going to do:
So you'll be able to do:
This is super easy and I could probably do it tomorrow. It's all just simple JSON manipulation.
However, once I do that, you would be able to use Does that sound okay? |
Sure that sounds wonderful. Will you be able to support the “-t” option as well? Or does that complicate things?
Thanks.
From: Bryan Gillespie <[email protected]>
Sent: Monday, March 16, 2020 9:48 PM
To: RPGillespie6/fastcov <[email protected]>
Cc: Author <[email protected]>
Subject: Re: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
EXTERNAL
Sure, I never heard back from the guy on the other issue, but it sounds like this is a commonly used feature.
In that case here's what I'm going to do:
1. I'm going to add support for this to fastcov's native json format first
So you'll be able to do:
$ fastcov -t Test1 ... -o report1.json
$ fastcov -t Test1 ... -o report2.json
$ fastcov -t Test1 ... -o report3.json
$ fastcov -a report1.json report2.json report3.json --lcov -o test1.info
$ fastcov -t Test2 ... -o report1.json
$ fastcov -t Test2 ... -o report1.json
$ fastcov -t Test2 ... -o report1.json
$ fastcov -a report1.json report2.json report3.json --lcov -o test2.info
This is super easy and I could probably do it tomorrow. It's all just simple JSON manipulation.
1. I'll add support for parsing/combining .info files second. This is slightly more complicated since currently fastcov can only serialize info format, it can't parse it.
However, once I do that, you would be able to use -a in conjunction with .info files as well as .json files.
Does that sound okay?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRPGillespie6%2Ffastcov%2Fissues%2F39%23issuecomment-599835893&data=02%7C01%7C7C6be08498836544d4605108d7ca153fe6%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637200064941976583&sdata=qXjYU8XbYAm8bna6BXDibHLKSZvsEsRLybGjFtU0cK0%3D&reserved=0>, or unsubscribe<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJ2Z67RWM2UJBXCNKSW6AZ3RH3JFTANCNFSM4LMZPUMA&data=02%7C01%7CBob.Huemmer%40sas.com%7C6be08498836544d4605108d7ca153fe6%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637200064941976583&sdata=%2BbSPdPIl2NA2a4puoDMV%2B079UT9AeC1OJXkRilz6RI0%3D&reserved=0>.
|
Yes, |
Ok, I've fully implemented this feature on a branch. Need to implement tests for it to make sure it behaves as expected and to iron out any bugs. Should be merged to master sometime this week. |
That branch is definitely WIP, so don't be surprised if there are bugs :P. |
Ok, I think this branch has all of the bugs ironed out now. Could you please try it if you have time to make sure it meets your expectations? |
Hi,
Again I appreciate you taking time to work on this effort. I have a question first before I get into what I found using updated version of fastcov.
* For a given set of GCDA and GCNO files, would you expect that the resultant .info files to be the same between lcov and fastcov using similar options? I noticed that they aren’t the same. For the reports I was generating, I was generating branch coverage info
The following are the commands I used to compare:
fastcov.py --gcov /<path> /gcc-9.2.0.R6/bin/gcov -b --lcov -o tktest.info -t TKTESTS --exclude usr/include lax/gcc
lcov -c -d . -o tktest.info --gcov-tool /<path>/gcc-9.2.0.R6/bin/gcov --rc lcov_branch_coverage=1 -t TKTEST --no-external
Here are the results of my testing:
1. I first just tried the new “-t” option with a non-combined report and was pleased to see that when I used genhtml that the test title appeared in the report.
2. Next I tried combining two “.info” file and used genhtml to generate a combined report. When using the new “-C” option to combine reports with fastcov I noticed that a number of the following warnings were produced. Should I be concerned about these?
* Warning: possible loss of correctness. Different number of branches for same line when combining reports ([10200, 0, 10200, 0, 9840, 360] vs [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
* Warning: possible loss of correctness. Different number of branches for same line when combining reports ([720, 0, 720, 0, 0, 720] vs [0, 0])
* Warning: possible loss of correctness. Different number of branches for same line when combining reports ([720, 0, 720, 0, 720, 0] vs [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
* Warning: possible loss of correctness. Different number of branches for same line when combining reports ([360, 0, 360, 0, 0, 360] vs [0, 0])
1. The result of the combined fastcov report wasn’t exactly what I was expecting. Here what was produced using fastcov “fastcov.py -b -o combined.info --lcov -C tktest.info wtest.info”
Filename [Sort by name]
Line Coverage ( hide details<index.html> ) [Sort by line coverage] <index-detail-sort-l.html>
Functions [Sort by function coverage] <index-detail-sort-f.html>
Branches [Sort by branch coverage] <index-detail-sort-b.html>
tkfmt.c<tkfmt.c.gcov.html>
[73.7%][73.7%]
73.7 %
129 / 175
88.9 %
8 / 9
37.2 %
32 / 86
WTESTS
73.7 %
129 / 175
88.9 %
8 / 9
37.2 %
32 / 86
For comparison, here is the output of the report when I combined the reports using lcov “lcov -a ./tktest.info -a ./wtest.info -o combined.info --rc lcov_branch_coverage=1”
Filename [Sort by name]
Line Coverage ( hide details<index.html> ) [Sort by line coverage] <index-detail-sort-l.html>
Functions [Sort by function coverage] <index-detail-sort-f.html>
Branches [Sort by branch coverage] <index-detail-sort-b.html>
tkfmt.c<tkfmt.c.gcov.html>
[73.7%][73.7%]
73.7 %
129 / 175
88.9 %
8 / 9
37.2 %
32 / 86
TKTESTS
62.3 %
109 / 175
66.7 %
6 / 9
30.2 %
26 / 86
WTESTS
70.9 %
124 / 175
77.8 %
7 / 9
37.2 %
32 / 86
So there are a couple of things to note between the teo reports when you select “show details”:
* The lcov report retained the statistics for both individual test reports and displayed them both in addition to the combined report statistics.
* The fastcov report seems to have combined both info files into one file and either has lost the statistical data for the individual tests or doesn’t display it.
* It is useful to be able to look at a given source file to
Note I used the following genhtml command to generate the reports:
genhtml ./combined.info -s --output-directory <output dir> --rc genhtml_branch_coverage=1 -k --demangle-cpp --legend --rc genhtml_hi_limit=80 --rc genhtml_med_limit=50 -q
From what I can tell, the combined data seems to be good and the title option works on individual report; however, using the fastcov combine options seems to not work properly when using the “show details” view in the genhtml report.
Hope this was helpful. Please let me know if you need any clarification.
Best,
-B
Sent: Friday, March 20, 2020 7:46 AM
To: RPGillespie6/fastcov <[email protected]>
Subject: RE: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
Sure thing. I will download the latest bits and give things a try today or over the weekend. Thank you so much for implementing this functionality.
From: Bryan Gillespie <[email protected]<mailto:[email protected]>>
Sent: Thursday, March 19, 2020 10:46 PM
To: RPGillespie6/fastcov <[email protected]<mailto:[email protected]>>
Cc: Author <[email protected]<mailto:[email protected]>>
Subject: Re: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
EXTERNAL
Ok, I think this branch has all of the bugs ironed out now. Could you please try it if you have time to make sure it meets your expectations?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRPGillespie6%2Ffastcov%2Fissues%2F39%23issuecomment-601502759&data=02%7C01%7C%7C3a86f4397c154a8b540708d7cc78d5fe%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637202691684988831&sdata=brbKqRp6VfFIq2A4A0gXz8Rkkr9LL652nPwZbR6vDeU%3D&reserved=0>, or unsubscribe<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJ2Z67WLBN4XBZ2VGI3ET7DRILKGZANCNFSM4LMZPUMA&data=02%7C01%7C%7C3a86f4397c154a8b540708d7cc78d5fe%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637202691684988831&sdata=HZSGgkJ82YrqL2jscSZQiM6TqVCwXYuYrhlBs9WgTHE%3D&reserved=0>.
|
This very helpful feedback. I misunderstood how the combine option should work given report files with different test names. This explains why the lcov generated one has both "TKTESTS" and "WTESTS" but fastcov only has "WTESTS". I will fix this and experiment with genhtml to make sure I understand this feature better.
Yes, though be aware that
The warning basically means that fastcov doesn't know how to combine branch coverage for the given line because each file is reporting a different number of branches for the same line. This could be explained if one coverage file was using |
Thank you for you feedback as well. I will try the -B option to see what happens; however, I believe that I neglected to mention that I believe that I prefer how fastcov deals with branching. There does indeed seem to be some noise with lcov and also some branch info being generated in some source code where there isn’t an apparent branch. I do not see this with fastcov, so thank you. I will also check to ensure that I’m being consistent with the use of my branching options when generating the different test .info files that I combine.
From: Bryan Gillespie <[email protected]>
Sent: Sunday, March 22, 2020 10:55 AM
To: RPGillespie6/fastcov <[email protected]>
Cc: Author <[email protected]>
Subject: Re: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
EXTERNAL
This very helpful feedback. I misunderstood how the combine option should work given report files with different test names. This explains why the lcov generated one has both "TKTESTS" and "WTESTS" but fastcov only has "WTESTS". I will fix this and experiment with genhtml to make sure I understand this feature better.
For a given set of GCDA and GCNO files, would you expect that the resultant .info files to be the same between lcov and fastcov using similar options?
Yes, though be aware that -b is not equivalent to --rc lcov_branch_coverage=1. Instead use -B which tells fastcov to include all branches (whereas -b tries to intelligently remove "noisy" gcc-generated branches such as c++ exception and initializer list branches).
I noticed that a number of the following warnings were produced. Should I be concerned about these?
The warning basically means that fastcov doesn't know how to combine branch coverage for the given line because each file is reporting a different number of branches for the same line. This could be explained if one coverage file was using -b and other was generated using all branches.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRPGillespie6%2Ffastcov%2Fissues%2F39%23issuecomment-602220589&data=02%7C01%7CBob.Huemmer%40sas.com%7C5a39b03889a7405879fc08d7ce710de2%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637204857276924781&sdata=GhAm0cwUYROyXQKX0G%2FMmgjMwU1hRsbebCnQxDad06U%3D&reserved=0>, or unsubscribe<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJ2Z67XK534BXH2HDZASKILRIYRFZANCNFSM4LMZPUMA&data=02%7C01%7CBob.Huemmer%40sas.com%7C5a39b03889a7405879fc08d7ce710de2%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637204857276924781&sdata=hiTWWUoeOrESEdUIqz3WLz75X81Nae1KBTusesNq87Y%3D&reserved=0>.
|
Sorry, I haven't had much time to work on this, this week. However, I've found the root problem. I need to keep coverage reports with different test names in separate buckets. Right now I'm combining them all into one report, which destroys the information you want to see when invoking |
Ok, I believe the latest version of the branch is fixed to correctly segregate test names. I squashed the branch so you'll have to do a With the fix, I ran the fastcov example project twice ( I will probably write a few more tests just to increase my confidence in this feature, but please try it out at your own leisure to see if it meets your needs. |
Bryan,
I've downloaded and tested your latest rendition of fastcov and it now is providing the functionality that we require. Thank you so very much! My testing, like yours, is a bit limited, so I intend to have some others on my team kick the tires a bit harder than I did. At the moment, all looks good though and if anything pops up that you need to be aware of, I will surely let you know.
Many thank on a job well done!
Best,
-Bob
Sent: Saturday, March 28, 2020 7:49 PM
To: RPGillespie6/fastcov <[email protected]>
Subject: Re: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
This is wonderful news. I will pull it down and give it a try ASAP. Thank you so much for your efforts!
…________________________________
From: Bryan Gillespie <[email protected]<mailto:[email protected]>>
Sent: Saturday, March 28, 2020 5:02 PM
To: RPGillespie6/fastcov <[email protected]<mailto:[email protected]>>
Cc: Author <[email protected]<mailto:[email protected]>>
Subject: Re: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
EXTERNAL
Ok, I believe the latest version of the branch is fixed to correctly segregate test names. I squashed the branch so you'll have to do a git reset --hard origin/bpg/add_testname_combine (or similar) to pick up the latest.
With the fix, I ran the fastcov example project twice (example/build.sh), each time with a different test name -t parameter, then combined with fastcov -C example.info example2.info --lcov -o example_combined.info. I can now see the separate coverage info in genhtml:
[image]<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F9853156%2F77833678-94079c00-7115-11ea-8f27-459ad8f2ebfd.png&data=02%7C01%7CBob.Huemmer%40sas.com%7C45cddf7cf5c74b164b8f08d7d35b649c%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637210261801320302&sdata=7txzprOeAVYVtM1hHTic14ATQF1r6tyNEwenCjGdEoU%3D&reserved=0>
I will probably write a few more tests just to increase my confidence in this feature, but please try it out at your own leisure to see if it meets your needs.
-
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRPGillespie6%2Ffastcov%2Fissues%2F39%23issuecomment-605519170&data=02%7C01%7CBob.Huemmer%40sas.com%7C45cddf7cf5c74b164b8f08d7d35b649c%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637210261801330296&sdata=ExaOi4q38Mv6%2Be9RF%2Fs%2FswoFmUMAeBwnloWboyz8H2U%3D&reserved=0>, or unsubscribe<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJ2Z67WAU2FNDF6A2XWVIMDRJZQYDANCNFSM4LMZPUMA&data=02%7C01%7CBob.Huemmer%40sas.com%7C45cddf7cf5c74b164b8f08d7d35b649c%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637210261801330296&sdata=fp9%2BnMBSoz%2BBg%2FWj2NKWXidRmrnYQNQkV%2F4NhoX7cjo%3D&reserved=0>.
|
Bryan,
I have a question, can you tell me what the following means please?
[4.400s] Processed 5084 .gcov files (5085 total, 1 skipped)
What does it mean that a file got skipped? Bad format or perhaps zero length?
Thanks,
-B
Sent: Sunday, March 29, 2020 12:51 PM
To: RPGillespie6/fastcov <[email protected]>
Subject: RE: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
Bryan,
I've downloaded and tested your latest rendition of fastcov and it now is providing the functionality that we require. Thank you so very much! My testing, like yours, is a bit limited, so I intend to have some others on my team kick the tires a bit harder than I did. At the moment, all looks good though and if anything pops up that you need to be aware of, I will surely let you know.
Many thank on a job well done!
Best,
-Bob
Sent: Saturday, March 28, 2020 7:49 PM
To: RPGillespie6/fastcov <[email protected]<mailto:[email protected]>>
Subject: Re: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
This is wonderful news. I will pull it down and give it a try ASAP. Thank you so much for your efforts!
…________________________________
From: Bryan Gillespie <[email protected]<mailto:[email protected]>>
Sent: Saturday, March 28, 2020 5:02 PM
To: RPGillespie6/fastcov <[email protected]<mailto:[email protected]>>
Cc: Author <[email protected]<mailto:[email protected]>>
Subject: Re: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
EXTERNAL
Ok, I believe the latest version of the branch is fixed to correctly segregate test names. I squashed the branch so you'll have to do a git reset --hard origin/bpg/add_testname_combine (or similar) to pick up the latest.
With the fix, I ran the fastcov example project twice (example/build.sh), each time with a different test name -t parameter, then combined with fastcov -C example.info example2.info --lcov -o example_combined.info. I can now see the separate coverage info in genhtml:
[image]<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F9853156%2F77833678-94079c00-7115-11ea-8f27-459ad8f2ebfd.png&data=02%7C01%7CBob.Huemmer%40sas.com%7C45cddf7cf5c74b164b8f08d7d35b649c%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637210261801320302&sdata=7txzprOeAVYVtM1hHTic14ATQF1r6tyNEwenCjGdEoU%3D&reserved=0>
I will probably write a few more tests just to increase my confidence in this feature, but please try it out at your own leisure to see if it meets your needs.
-
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRPGillespie6%2Ffastcov%2Fissues%2F39%23issuecomment-605519170&data=02%7C01%7CBob.Huemmer%40sas.com%7C45cddf7cf5c74b164b8f08d7d35b649c%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637210261801330296&sdata=ExaOi4q38Mv6%2Be9RF%2Fs%2FswoFmUMAeBwnloWboyz8H2U%3D&reserved=0>, or unsubscribe<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJ2Z67WAU2FNDF6A2XWVIMDRJZQYDANCNFSM4LMZPUMA&data=02%7C01%7CBob.Huemmer%40sas.com%7C45cddf7cf5c74b164b8f08d7d35b649c%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637210261801330296&sdata=fp9%2BnMBSoz%2BBg%2FWj2NKWXidRmrnYQNQkV%2F4NhoX7cjo%3D&reserved=0>.
|
A file is skipped if one of fastcov's filtering options matches it. The following options will cause files to be skipped:
Are you using one of these 3 options? Currently fastcov does not print which files it is skipping because it could make the terminal output very spammy, However, this could be a future CLI option ( |
Thank you for the information and yes, it might be nice to eventually have an option that prints out what files do get skipped. Could be useful when debugging to see what actually is getting filtered out.
Best,
-B
From: Bryan Gillespie <[email protected]>
Sent: Sunday, March 29, 2020 7:55 PM
To: RPGillespie6/fastcov <[email protected]>
Cc: Author <[email protected]>
Subject: Re: [RPGillespie6/fastcov] Request to Implement the lcov "-t" option. (#39)
EXTERNAL
What does it mean that a file got skipped? Bad format or perhaps zero length?
A file is skipped if one of fastcov's filtering options matches it. The following options will cause files to be skipped:
…--exclude: (skip files containing any of the listed substrings)
--include: (skip files not containing any of the listed substrings)
--source-files: (skip any files that are not one of these source files)
Currently fastcov does not print which files it is skipping because it could make the terminal output very spammy, However, this could be a future CLI option (--verbose or something)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRPGillespie6%2Ffastcov%2Fissues%2F39%23issuecomment-605721603&data=02%7C01%7CBob.Huemmer%40sas.com%7Ca2c9b1616fef41d6adaf08d7d43ca6bf%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637211229274572465&sdata=BYyZFYXZRoqYO4QJQ5ZmzIBGpBnGNcQ2Vfv9hMWDEsA%3D&reserved=0>, or unsubscribe<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJ2Z67UJHR43S7WC7JD6S3LRJ7NWZANCNFSM4LMZPUMA&data=02%7C01%7CBob.Huemmer%40sas.com%7Ca2c9b1616fef41d6adaf08d7d43ca6bf%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637211229274582461&sdata=bIHva%2BNlaB6sAUurWh7PeEixf%2FPaZo1XMXxF54FZ1KI%3D&reserved=0>.
|
This would be easy to add (just need to sprinkle in some conditional traces). I will take care of it after this issue. I've created a new issue to track this: |
The implementation of the "-t" option is likely also related to the previously reported issue of implementing the "-a" option from lcov within fastcov where it would be useful to merge multiple .info files together with fastcov.
The lcov doc states the following for the "-t" option:
-t testname
--test-name testname
Specify test name to be stored in the tracefile.
This name identifies a coverage data set when more than one data set is merged into a combined tracefile (see option -a).
Valid test names can consist of letters, decimal digits and the underscore character ("_").
This is important if you'd like to retain a test name when you merge multiple .info files together using fastcov/lcov. That way when the combined info file gets passed to genhtml, you can use "Show Details" pull down to see the test coverage that each test contributed to a given source file. Very useful info.
Also, thank you very much for writing fastcov! You did a nice job and the result are impressive!
The text was updated successfully, but these errors were encountered: