build: use intermediate lcov coverage file
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 2 Feb 2016 23:24:26 +0000 (00:24 +0100)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sat, 6 Feb 2016 14:42:09 +0000 (15:42 +0100)
Otherwise the 'lcov -q --remove' run fails with the following error:
lcov: ERROR: cannot write to coverage.info!

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Makefile
tests/Makefile

index 7d8ae4b..87a9869 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -177,7 +177,7 @@ clean::
        $(RM) $(CLEANSUFFIXES)
        $(RM) $(CLEANSUFFIXES:%=tools/%)
        $(RM) -r coverage-html
-       $(RM) -rf coverage.info lcov
+       $(RM) -rf coverage.info coverage.info.in lcov
 
 distclean::
        $(RM) $(DISTCLEANSUFFIXES)
index db2bc61..6e5dfa6 100644 (file)
@@ -217,8 +217,9 @@ fate-list:
 coverage.info: TAG = LCOV
 coverage.info:
        $(M)lcov -q -d $(CURDIR) -b $(patsubst src%,./,$(SRC_LINK)) --capture | \
-           sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@
-       $(M)lcov -q --remove $@ "/usr*" -o $@
+           sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@.in
+       $(M)lcov -q --remove $@.in "/usr*" > $@
+       $(Q)$(RM) $@.in
 
 lcov:  TAG = GENHTML
 lcov: coverage.info