mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 20:24:31 +00:00
agent: makefile: Add codecov target
Add target to run codecov report locally. Useful to identify what are the missing lines to be covered by unit test. Fixes: #1487 Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
This commit is contained in:
parent
6e1ef809e1
commit
7ae349c511
1
src/agent/.gitignore
vendored
Normal file
1
src/agent/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
tarpaulin-report.html
|
@ -150,6 +150,7 @@ install: install-services
|
|||||||
clean:
|
clean:
|
||||||
@cargo clean
|
@cargo clean
|
||||||
@rm -f $(GENERATED_FILES)
|
@rm -f $(GENERATED_FILES)
|
||||||
|
@rm -f tarpaulin-report.html
|
||||||
|
|
||||||
#TARGET test: run cargo tests
|
#TARGET test: run cargo tests
|
||||||
test:
|
test:
|
||||||
@ -195,6 +196,27 @@ help: Makefile show-summary
|
|||||||
@echo "Targets:"
|
@echo "Targets:"
|
||||||
@sed -n 's/^##TARGET//p' $< | sort
|
@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: \
|
.PHONY: \
|
||||||
help \
|
help \
|
||||||
show-header \
|
show-header \
|
||||||
|
Loading…
Reference in New Issue
Block a user