build: simplify coverage display

This commit is contained in:
Vincent Bernat
2025-08-18 09:02:08 +02:00
parent e682215b2e
commit b3db197d45

View File

@@ -199,8 +199,7 @@ test-coverage-go: ; $(info $(M) running Go coverage tests…) @ ## Run Go covera
$Q $(GO) tool cover -html=test/go/profile.out -o test/go/coverage.html
$Q $(GOCOV) convert test/go/profile.out | $(GOCOVXML) > test/go/coverage.xml
@printf "Code coverage: "; \
c=$$(echo "scale=1;$$(sed -En 's/^<coverage line-rate="([0-9.]+)".*/\1/p' test/go/coverage.xml) * 100 / 1" | bc -q) ; \
echo $$c ; [ $$c != 0 ]
go tool cover -func test/go/profile.out | awk '($$1 == "total:") { print $$NF}'
test-js: .fmt-js~ .lint-js~ $(GENERATED_JS)
test-js: ; $(info $(M) running JS tests) @ ## Run JS tests