Skip to content

Commit

Permalink
Fix nasa#380: Exclude unit tests from lcov report
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Nov 15, 2019
1 parent d4caca8 commit 3a60668
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmake/Makefile.sample
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,16 @@ clean:
distclean:
rm -rf "$(O)"

# Grab lcov baseline before running tests
test:
lcov --capture --initial --directory $(O)/$(ARCH) --output-file $(O)/$(ARCH)/coverage_base.info
(cd $(O)/$(ARCH) && ctest -O ctest.log)

lcov:
lcov --capture --directory $(O)/$(ARCH) --output-file $(O)/$(ARCH)/coverage.info
genhtml $(O)/$(ARCH)/coverage.info --output-directory $(O)/$(ARCH)/lcov
lcov --capture --directory $(O)/$(ARCH) --output-file $(O)/$(ARCH)/coverage_test.info
lcov --add-tracefile $(O)/$(ARCH)/coverage_base.info --add-tracefile $(O)/$(ARCH)/coverage_test.info --output-file $(O)/$(ARCH)/coverage_total.info
lcov --remove $(O)/$(ARCH)/coverage_total.info 'unit-test/*' --output-file $(O)/$(ARCH)/coverage_filtered.info
genhtml $(O)/$(ARCH)/coverage_filtered.info --output-directory $(O)/$(ARCH)/lcov
@/bin/echo -e "\n\nCoverage Report Link: file:$(CURDIR)/$(O)/$(ARCH)/lcov/index.html\n"

doc:
Expand Down

0 comments on commit 3a60668

Please sign in to comment.