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

Build: Fix coverage targets. #3830

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions devel/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -196,37 +196,43 @@ cppcheck-clean:
# Coverage/profiling
#

COVERAGE_DIR = $(top_builddir)/coverage
COVERAGE_DIR = $(abs_top_builddir)/coverage

# Check coverage of unit tests
.PHONY: coverage
coverage: coverage-partial-clean
cd $(top_builddir) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& lcov --no-external --exclude='*_test.c' -c -i -d . \
-o pacemaker_base.info \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& lcov --no-external --exclude='*_test.c' -c -d . \
-o pacemaker_test.info \
&& lcov -a pacemaker_base.info -a pacemaker_test.info \
-o pacemaker_total.info \
&& lcov --remove pacemaker_total.info -o pacemaker_filtered.info\
"$(abs_top_builddir)/tools/*" \
"$(abs_top_builddir)/daemons/*/*" \
"$(abs_top_builddir)/replace/*" \
genhtml $(top_builddir)/pacemaker_filtered.info -o $(COVERAGE_DIR) -s -t "Pacemaker code coverage"
cd $(top_builddir) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& lcov --capture --no-external --exclude='*_test.c' --initial \
--directory lib --ignore-errors=unused \
--output-file pacemaker_base.info \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& lcov --capture --no-external --exclude='*_test.c' \
--directory lib --ignore-errors=unused \
--output-file pacemaker_test.info \
&& lcov --add-tracefile pacemaker_base.info \
--add-tracefile pacemaker_test.info \
--output-file pacemaker_total.info \
&& genhtml --output-directory $(COVERAGE_DIR) \
--show-details --title "Pacemaker library code coverage"\
pacemaker_total.info

# Check coverage of CLI regression tests
.PHONY: coverage-cts
coverage-cts: coverage-partial-clean
cd $(top_builddir) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& lcov --no-external -c -i -d tools -o pacemaker_base.info \
&& cts/cts-cli \
&& lcov --no-external -c -d tools -o pacemaker_test.info \
&& lcov -a pacemaker_base.info -a pacemaker_test.info \
-o pacemaker_total.info
genhtml $(top_builddir)/pacemaker_total.info -o $(COVERAGE_DIR) -s
cd $(top_builddir) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& lcov --capture --no-external --initial --directory tools \
--output-file pacemaker_base.info \
&& cts/cts-cli \
&& lcov --capture --no-external --directory tools \
--output-file pacemaker_test.info \
&& lcov --add-tracefile pacemaker_base.info \
--add-tracefile pacemaker_test.info \
--output-file pacemaker_total.info \
&& genhtml --output-directory $(COVERAGE_DIR) \
--show-details --title "Pacemaker tools code coverage" \
pacemaker_total.info

# Remove coverage-related files that aren't needed across runs
.PHONY: coverage-partial-clean
Expand Down