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

Add support for generating coverage reports #1173

Merged
merged 3 commits into from May 30, 2022

Conversation

achernya
Copy link
Collaborator

@achernya achernya commented Feb 7, 2022

This change adds autoconf/automake support for building all of mosh
with gcov, and generates an lcov html report. This allows seeing which
parts ofthe source tree have good test coverage, and which can be
shored up. Eventually, it would be good to hook this up to Github
Actions to be generated automatically.

@achernya achernya requested a review from andersk February 7, 2022 00:40
@achernya achernya force-pushed the add-coverage branch 4 times, most recently from 1621ce8 to 82d80e8 Compare February 7, 2022 00:52
@eminence
Copy link
Member

There's lots of autoconf magic here, which is a bit inscrutable to me, as a non-autoconf-wizard. Can you provide a few instructions about how to use this (how to have coverage data be collected, and how to generate an html report)?

@achernya
Copy link
Collaborator Author

Sure! As a pre-req, make sure you have lcov installed. On Debian/Ubuntu, this is apt install lcov. Use ./autogen.sh to produce a ./configure, per usual, but to do the actual build, you'll want to do

$ ./configure --enable-code-coverage
$ make check-code-coverage

This will run the tests and process the gcov output with lcov, and produce an html report in a subdirectory matching the pattern *-coverage.

I can also add these instructions to the README in an additional commit to this PR if you'd like.

Copy link
Contributor

@bbarenblat bbarenblat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add $(CODE_COVERAGE_CFLAGS) and $(CODE_COVERAGE_LIBS) to src/examples/Makefile.am as well?

Makefile.am Outdated Show resolved Hide resolved
src/frontend/Makefile.am Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
src/tests/Makefile.am Outdated Show resolved Hide resolved
This change adds autoconf/automake support for building all of mosh
with gcov, and generates an lcov html report. This allows seeing which
parts ofthe source tree have good test coverage, and which can be
shored up. Eventually, it would be good to hook this up to Github
Actions to be generated automatically.
@achernya achernya merged commit 1f27c53 into mobile-shell:master May 30, 2022
@achernya achernya deleted the add-coverage branch August 3, 2022 23:20
@eminence eminence added this to the 1.4.0 milestone Aug 12, 2022
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.

None yet

3 participants