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

Measure code coverage in CI #98

Open
eschnett opened this issue May 3, 2023 · 4 comments
Open

Measure code coverage in CI #98

eschnett opened this issue May 3, 2023 · 4 comments

Comments

@eschnett
Copy link
Collaborator

eschnett commented May 3, 2023

No description provided.

@rhaas80
Copy link
Member

rhaas80 commented May 3, 2023

Related to EinsteinToolkit/tests#41
There is a gcov test tool in the ET in repos/utils/GcovAnalysis.pl that one could leverage (produces HTML output already), last updated 9 years ago (by @rhaas80 and @stevenrbrandt).

@SamuelCupp
Copy link
Contributor

You could consider Codecov, which is free for public repos. It has hooks for GitHub Actions, and I use it for GRHayL. I have a code-coverage action which runs gcovr and then calls the codecov action to submit and compile all the different CI reports into a single report.

@eschnett
Copy link
Collaborator Author

We will also need a set of configure options to tell the compiler to emit code that measures the coverage.

@SamuelCupp
Copy link
Contributor

I also have those set up in my compilation action for GRHayL (not the toolkit). I just add the cflags "-ftest-coverage -fprofile-arcs". These flags exist for gcc, clang, and Intel.

I will note that I have only had success getting this to work for the gcc compiler. The clang compiler needs to somehow use the llvm-cov, but I haven't spent the time to figure this out. This can be seen in my code coverage action. I have the llvm-cov running, but either the coverage files aren't being properly generated or the gcovr command is incorrect when used with llvm-cov.

I don't know how to do it for the Intel compiler, so if someone figures that out or the clang issue please let me know.

I'm also currently only collecting data from the Ubuntu tests, so I don't know if MacOS has additional hoops to jump through.

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

No branches or pull requests

3 participants