build: Rework config=coverage to be more robust
Use find -exec instead of xargs to work around differences between xargs on OSX and Linux. Use -b option of gcov - for some reason gcov on Travis can't find .gcno files otherwise (old version?). And finally enable config=coverage again.
This commit is contained in:
parent
9865f042ed
commit
c7acc6d1f4
@ -7,5 +7,5 @@ env:
|
|||||||
- DEFINES=standard
|
- DEFINES=standard
|
||||||
- DEFINES=PUGIXML_WCHAR_MODE
|
- DEFINES=PUGIXML_WCHAR_MODE
|
||||||
- DEFINES=PUGIXML_COMPACT
|
- DEFINES=PUGIXML_COMPACT
|
||||||
script: make test defines=$DEFINES -j2
|
script: make test defines=$DEFINES config=coverage -j2
|
||||||
after_success: bash <(curl -s https://codecov.io/bash)
|
after_success: bash <(curl -s https://codecov.io/bash)
|
||||||
|
|||||||
6
Makefile
6
Makefile
@ -54,10 +54,10 @@ all: $(EXECUTABLE)
|
|||||||
|
|
||||||
ifeq ($(config),coverage)
|
ifeq ($(config),coverage)
|
||||||
test: $(EXECUTABLE)
|
test: $(EXECUTABLE)
|
||||||
-@find $(BUILD) -name '*.gcda' | xargs rm
|
-@find $(BUILD) -name '*.gcda' -exec rm {} +
|
||||||
./$(EXECUTABLE)
|
./$(EXECUTABLE)
|
||||||
@gcov -b -c $(BUILD)/src/pugixml.cpp.gcda | sed -e '/./{H;$!d;}' -e 'x;/pugixml.cpp/!d;'
|
@gcov -b -o=$(BUILD)/src pugixml.cpp.gcda | sed -e '/./{H;$!d;}' -e 'x;/pugixml.cpp/!d;'
|
||||||
@ls *.gcov | grep -v pugixml.cpp.gcov | xargs rm
|
@find . -name '*.gcov' -and -not -name 'pugixml.cpp.gcov' -exec rm {} +
|
||||||
else
|
else
|
||||||
test: $(EXECUTABLE)
|
test: $(EXECUTABLE)
|
||||||
./$(EXECUTABLE)
|
./$(EXECUTABLE)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user