Skip to content

Add code coverage to stdlib. #1024

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

loiseaujc
Copy link
Contributor

@loiseaujc loiseaujc commented Jul 25, 2025

Following the discussion in #937, this PR (tries to) add code coverage to stdlib using codecov.

Key facts

  • Added a new code-coverage.yml Github Action which runs on every push and pull requests.
  • Uses fpm to run the test with the added -coverage flag added for compilation with gfortran.
    • Use the release profile with xdp and qp turned on.
  • Automatically upload the coverage report to codecov
  • Requires a CODECOV_TOKEN to be set up in the settings of the repo. This should be done by the one of the org owners I believe.

Current issue

The Github Action runs correctly and the coverage report is upload to codecov (see here). Note however that it does not seem to include the coverage report for a number of modules including the linalg for instance. I'm not sure what's going here and I have a fairly limited experience with gcov and lcov.

I get warnings like these

geninfo: WARNING: WARNING: GCOV did not produce any data for /home/runner/work/stdlib/stdlib/build/coverage/src_stdlib_sparse.f90.gcno
	(use "geninfo --ignore-errors gcov,gcov ..." to suppress this warning)

despite the test for sparse being run.

ping @perazz, @jalvesz and @jvdp1

Copy link

codecov bot commented Jul 25, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@loiseaujc
Copy link
Contributor Author

I've ended up chaining the code coverage thing with the fpm-deployment action and it now works like a charm. The code coverage is generated from the stdlib-fpm branch with xdp and qp turned on (see here). It seems like we're slightly below the 25% mark.

@loiseaujc loiseaujc marked this pull request as ready for review July 26, 2025 08:17
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

Successfully merging this pull request may close these issues.

1 participant