Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Enable C++ coverage #12642

Merged
merged 10 commits into from
Sep 24, 2018
Merged

Enable C++ coverage #12642

merged 10 commits into from
Sep 24, 2018

Conversation

marcoabreu
Copy link
Contributor

@marcoabreu marcoabreu commented Sep 22, 2018

This PR adds coverage metrics for the C++ backend.

Something to verify at a later stage: Compare coverage result of optimized builds with non-optimized: https://github.com/pyarmak/cmake-gtest-coverage-example/blob/master/cmake/modules/CodeCoverage.cmake

@marcoabreu marcoabreu added the pr-work-in-progress PR is still work in progress label Sep 22, 2018
@marcoabreu marcoabreu force-pushed the cpp-codecov branch 3 times, most recently from 332afa9 to 9bf127d Compare September 22, 2018 14:04
@marcoabreu marcoabreu force-pushed the cpp-codecov branch 5 times, most recently from 4774a0f to 9984940 Compare September 23, 2018 03:55
@marcoabreu marcoabreu changed the title [WIP] Enable C++ coverage Enable C++ coverage Sep 23, 2018
@marcoabreu marcoabreu added pr-awaiting-review PR is waiting for code review and removed pr-work-in-progress PR is still work in progress labels Sep 23, 2018
Copy link
Member

@szha szha left a comment

Choose a reason for hiding this comment

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

feel free to merge once tested.

ifeq ($(ENABLE_TESTCOVERAGE), 1)
CFLAGS += --coverage
LDFLAGS += --coverage
endif
Copy link
Member

Choose a reason for hiding this comment

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

need to make sure this flag is portable to other compilers/linkers. I checked for gcc and clang, both of which supports gcov.
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
https://clang.llvm.org/docs/SourceBasedCodeCoverage.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only compatible with GCC and clang, right. Want me to add a check?

@marcoabreu marcoabreu added pr-awaiting-testing PR is reviewed and waiting CI build and test and removed pr-awaiting-review PR is waiting for code review labels Sep 24, 2018
@marcoabreu
Copy link
Contributor Author

@marcoabreu marcoabreu added pr-awaiting-merge Review and CI is complete. Ready to Merge and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Sep 24, 2018
@marcoabreu marcoabreu merged commit ccba621 into apache:master Sep 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-merge Review and CI is complete. Ready to Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants