Skip to content

Commit 4a52cbe

Browse files
Update codecov to use gcovr report
1 parent 1882c5c commit 4a52cbe

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

Makefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ clean:
1818
rm -f sofos sofos_debug unittest unittest_coverage sofos_coverage
1919
rm -f *.o
2020
rm -f *.gcov *.gcda *.gcno
21-
rm -f coverage*.html
21+
rm -f coverage*.html cobertura.xml
2222
rm -f clang-tidy.txt clang-format.patch
2323

2424
SOFOSCC=sofos.cc main.cc
@@ -57,13 +57,18 @@ coverage: sofos_coverage unittest_coverage
5757
rm -f *.gcda
5858
./unittest_coverage
5959
cd test && bash run_tests.bash ../sofos_coverage
60+
61+
coverage_html: coverage
6062
gcovr -r . -e catch.hpp -e unittest.cc --html-details -o coverage.html
6163

62-
test_codecov: sofos_coverage unittest_coverage
63-
rm -f *.gcda
64-
./unittest_coverage
65-
cd test && bash run_tests.bash ../sofos_coverage
66-
bash -c 'bash <(curl -s https://codecov.io/bash)'
64+
coverage_xml: coverage
65+
gcovr -r . -e catch.hpp -e unittest.cc -x -o cobertura.xml
66+
67+
codecov.bash:
68+
curl -s https://codecov.io/bash > $@
69+
70+
test_codecov: coverage_xml codecov.bash
71+
bash codecov.bash -X gcov search
6772

6873
tidy:
6974
$(CLANGTIDY) $(TIDYFILES) -- $(CXXFLAGS) $(SOFOSFLAGS) -Wall
@@ -81,4 +86,4 @@ test_tidy:
8186
@$(CLANGTIDY) $(SOFOSCC) -- $(CXXFLAGS) $(SOFOSFLAGS) -Wall 2>/dev/null | tee clang-tidy.txt
8287
@test 0 -eq `cat clang-tidy.txt | wc -l`
8388

84-
.PHONY: coverage tidy format test test_codecov test_format cov
89+
.PHONY: coverage tidy format test test_codecov test_format test_tidy coverage_html coverage_xml

0 commit comments

Comments
 (0)