Skip to content

Commit

Permalink
test: allow setting clean as option for coverage
Browse files Browse the repository at this point in the history
Allow running make coverage with CLEAN=true so that the coverage reports
can be generated and cleaned up afterwards (right now this is a
workaround but with the drawback that this creates another make process

Adjust coverage-clean so that it only removes the coverage/ dir if
CLEAN=false otherwise leave it intact

Update .gitignore to ignore the coverage/ dir

Refs: https://github.com/nodejs/node/pull/15190/files#r136934721
Fixes: nodejs#15214
  • Loading branch information
ssbrewster committed Sep 19, 2017
1 parent d932e80 commit 5636f0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tags
doc/api.xml
tmp/
test/tmp*/
coverage/
iojs
iojs_g
node
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ coverage-clean:
$(RM) -r node_modules
$(RM) -r gcovr testing
$(RM) -r out/$(BUILDTYPE)/.coverage
$(RM) -r .cov_tmp coverage
$(RM) -r .cov_tmp
if [ ! $(CLEAN) ]; then \
$(RM) -r coverage; fi
$(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcda
$(RM) out/$(BUILDTYPE)/obj.target/node/src/tracing/*.gcda
$(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcno
Expand Down Expand Up @@ -172,6 +174,8 @@ coverage-test: coverage-build
--html --html-detail -o ../coverage/cxxcoverage.html)
mv lib lib_
mv lib__ lib
if [ $(CLEAN) ]; then \
make coverage-clean; fi
@echo -n "Javascript coverage %: "
@grep -B1 Lines coverage/index.html | head -n1 \
| sed 's/<[^>]*>//g'| sed 's/ //g'
Expand Down

0 comments on commit 5636f0c

Please sign in to comment.