From c7acc6d1f46be6a53dd999e570fe46bc6ce0d686 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 25 Aug 2015 09:32:48 -0700 Subject: 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. --- .travis.yml | 2 +- Makefile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0721c83..9a8dcda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,5 @@ env: - DEFINES=standard - DEFINES=PUGIXML_WCHAR_MODE - 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) diff --git a/Makefile b/Makefile index ad0dc1e..6831882 100644 --- a/Makefile +++ b/Makefile @@ -54,10 +54,10 @@ all: $(EXECUTABLE) ifeq ($(config),coverage) test: $(EXECUTABLE) - -@find $(BUILD) -name '*.gcda' | xargs rm + -@find $(BUILD) -name '*.gcda' -exec rm {} + ./$(EXECUTABLE) - @gcov -b -c $(BUILD)/src/pugixml.cpp.gcda | sed -e '/./{H;$!d;}' -e 'x;/pugixml.cpp/!d;' - @ls *.gcov | grep -v pugixml.cpp.gcov | xargs rm + @gcov -b -o=$(BUILD)/src pugixml.cpp.gcda | sed -e '/./{H;$!d;}' -e 'x;/pugixml.cpp/!d;' + @find . -name '*.gcov' -and -not -name 'pugixml.cpp.gcov' -exec rm {} + else test: $(EXECUTABLE) ./$(EXECUTABLE) -- cgit v1.2.3