File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 - name : Install build tools
1515 run : |
1616 sudo apt-get update
17- sudo apt-get install -y build-essential cmake
17+ sudo apt-get install -y build-essential gcovr
1818 - name : Build
1919 run : make
20- - name : Build and run C tests
21- run : |
22- make ctest
23- if [ -x tests/ctest ]; then
24- ./tests/ctest
25- else
26- echo "ctest binary missing"; exit 1
27- fi
20+ - name : Coverage gate (>=95% lines)
21+ run : make ci
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ LIB_PATH = $(BUILD_DIR)/$(LIBNAME)
1414OBJ_PATH = $(BUILD_DIR ) /src/space_packet.o
1515EXAMPLE_PATH = $(BUILD_DIR ) /examples/spacepacket_example
1616CTEST_PATH = $(BUILD_DIR ) /tests/ctest
17+ COVERAGE_MIN ?= 95
1718
1819all : lib example test ctest
1920
@@ -43,6 +44,10 @@ $(CTEST_PATH): lib tests/unit_tests.c
4344coverage-html :
4445 bash scripts/coverage_html.sh
4546
47+ ci :
48+ bash scripts/coverage_html.sh
49+ gcovr -r " $$ PWD" --filter " $$ PWD/src" --txt-summary --fail-under-line $(COVERAGE_MIN )
50+
4651clean :
4752 rm -rf $(BUILD_DIR )
4853
@@ -51,4 +56,4 @@ install: lib
5156 cp $(LIB_PATH ) $(PREFIX ) /lib/$(LIBNAME )
5257 cp include/space_packet.h $(PREFIX ) /include/
5358
54- .PHONY : all lib example test ctest coverage-html clean install
59+ .PHONY : all lib example test ctest coverage-html ci clean install
You can’t perform that action at this time.
0 commit comments