Skip to content

Commit 5636f0c

Browse files
committed
test: allow setting clean as option for coverage
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
1 parent d932e80 commit 5636f0c

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ tags
2626
doc/api.xml
2727
tmp/
2828
test/tmp*/
29+
coverage/
2930
iojs
3031
iojs_g
3132
node

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ coverage-clean:
123123
$(RM) -r node_modules
124124
$(RM) -r gcovr testing
125125
$(RM) -r out/$(BUILDTYPE)/.coverage
126-
$(RM) -r .cov_tmp coverage
126+
$(RM) -r .cov_tmp
127+
if [ ! $(CLEAN) ]; then \
128+
$(RM) -r coverage; fi
127129
$(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcda
128130
$(RM) out/$(BUILDTYPE)/obj.target/node/src/tracing/*.gcda
129131
$(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcno
@@ -172,6 +174,8 @@ coverage-test: coverage-build
172174
--html --html-detail -o ../coverage/cxxcoverage.html)
173175
mv lib lib_
174176
mv lib__ lib
177+
if [ $(CLEAN) ]; then \
178+
make coverage-clean; fi
175179
@echo -n "Javascript coverage %: "
176180
@grep -B1 Lines coverage/index.html | head -n1 \
177181
| sed 's/<[^>]*>//g'| sed 's/ //g'

0 commit comments

Comments
 (0)