Update make targets to require min test coverage
This commit is contained in:
parent
351216c3a7
commit
e3da2e4f80
9
Makefile
9
Makefile
@ -3,18 +3,25 @@ default: test
|
|||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
|
go build
|
||||||
|
|
||||||
minitor-go:
|
minitor-go:
|
||||||
go build
|
go build
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: minitor-go
|
run: minitor-go build
|
||||||
./minitor-go -debug
|
./minitor-go -debug
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
go test -coverprofile=coverage.out
|
go test -coverprofile=coverage.out
|
||||||
|
@echo
|
||||||
go tool cover -func=coverage.out
|
go tool cover -func=coverage.out
|
||||||
|
@echo
|
||||||
|
@# Check min coverage percentage
|
||||||
|
@go tool cover -func=coverage.out | awk -v target=80.0% \
|
||||||
|
'/^total:/ { print "Total coverage: " $$3 " Minimum coverage: " target; if ($$3+0.0 >= target+0.0) print "ok"; else { print "fail"; exit 1; } }'
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
Loading…
Reference in New Issue
Block a user