Skip to content
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

CMake: add targets to generate local coverage reports #1068

Closed
piponazo opened this issue Nov 23, 2019 · 10 comments
Closed

CMake: add targets to generate local coverage reports #1068

piponazo opened this issue Nov 23, 2019 · 10 comments
Labels
CMake Configuration issues related with CMake
Milestone

Comments

@piponazo
Copy link
Collaborator

Although we already have an option in CMake which add the needed compiler flags in GCC and CLANG to produce coverage information (this is used by the tools we employ in the PRs to generate coverage reports) it would be nice to also add some targets in the CMake configuration to generate local coverage reports.

This would be useful for exploring not exercised paths in the code while testing either some legacy code or new features.

Some ideas of how this could be achieved can be found on the web:
https://codeist.zone/2018/03/16/code-coverage-with-gcov-and-cmake/
http://www.stablecoder.ca/2018/01/15/code-coverage.html

@piponazo piponazo added good first issue CMake Configuration issues related with CMake labels Nov 23, 2019
@emye
Copy link

emye commented Nov 27, 2019

Hello,
We are a group of students looking to help out on this project. We would like to assist in this issue. Thanks.

@piponazo
Copy link
Collaborator Author

Great @emye . Let me know if you need any help about this topic.

@D4N
Copy link
Member

D4N commented Nov 28, 2019

If you have some add hoc questions, you can also drop by in the #exiv2-chat chatroom on matrix.org.

@cryptomilk
Copy link
Collaborator

Do you use ctest? Because it has coverage support. See

https://test.cmocka.org/viewCoverage.php?buildid=1430

@emye emye mentioned this issue Dec 10, 2019
@piponazo
Copy link
Collaborator Author

@cryptomilk at the end @emye implemented it in a custom way. In case we start using CTest more intensively in the future we can check if the CTest/CMake support can simplify things. At the moment, since we have a mix of Unit Tests (included in CTest), bash & python tests (Not included in CTest), I think the current implementation is good enough.

@clanmills
Copy link
Collaborator

I think we have to "let this go". I'll associate this issue with #1550 for investigation. I don't know anything about CTest. Perhaps @1div0 can look at CTest and make a recommendation if this should be adopted. Now that the test suite is totally implemented in python3, I don't perceive that Exiv2 needs CTest.

@piponazo
Copy link
Collaborator Author

Let's close this one. In #1073 we already added something to generate local coverage reports in old-master. I'll port to the new main branch.

CTest is just the CMake test driver program. A helper to run your project tests easily with that CMake tool. As you mentioned Exiv2 probably does not need CTest, but it could make the life easier for newcomers to the project with previous experience in the tool. If we can run the tests easily with CTest I would vote for improving the support, but anyways it is a different topic to the "coverage" one which is the main topic discussed in this issue.

@clanmills
Copy link
Collaborator

Good. Everything we have in CMake for build, test, documentation, and release bundles is working well. If a contributor says "I know how to make this better with CTest", he/she can do the work. I'll let Peter know to forget about CTest.

@1div0
Copy link
Collaborator

1div0 commented Apr 14, 2021

@clanmills I am OK with that.

@clanmills
Copy link
Collaborator

Thanks, @1div0. You'll see that I've added #1550 with a load of test matters to be investigated. We'll have to prioritise as there's no way to achieve all of them in in a few months. And I'll do a couple of them. It will work out fine. It always does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake Configuration issues related with CMake
Projects
None yet
Development

No branches or pull requests

6 participants