Merge pull request #1489 from jcvenegas/2021-03-03/codecov

agent: makefile: Add codecov target
This commit is contained in:
Bo Chen
2021-03-10 11:21:33 -08:00
committed by GitHub
2 changed files with 23 additions and 0 deletions

1
src/agent/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
tarpaulin-report.html

View File

@@ -150,6 +150,7 @@ install: install-services
clean:
@cargo clean
@rm -f $(GENERATED_FILES)
@rm -f tarpaulin-report.html
#TARGET test: run cargo tests
test:
@@ -195,6 +196,27 @@ help: Makefile show-summary
@echo "Targets:"
@sed -n 's/^##TARGET//p' $< | sort
TARPAULIN_ARGS:=-v --workspace
install-tarpaulin:
cargo install cargo-tarpaulin
# Check if cargo tarpaulin is installed
HAS_TARPAULIN:= $(shell cargo --list | grep tarpaulin 2>/dev/null)
check_tarpaulin:
ifndef HAS_TARPAULIN
$(error "tarpaulin is not available please: run make install-tarpaulin ")
else
$(info OK: tarpaulin installed)
endif
##TARGET codecov: Generate code coverage report
codecov: check_tarpaulin
cargo tarpaulin $(TARPAULIN_ARGS)
##TARGET codecov-html: Generate code coverage html report
codecov-html: check_tarpaulin
cargo tarpaulin $(TARPAULIN_ARGS) -o Html
.PHONY: \
help \
show-header \