-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 781 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (23 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.PHONY: build test test-e2e vet fmt tidy clean cover
build:
go build -o bin/ .
test:
go test ./...
test-e2e:
go test -tags=e2e ./e2e -v
vet:
go vet ./...
fmt:
gofmt -l -w .
tidy:
go mod tidy
clean:
rm -rf bin/
# Reports coverage and fails unless every function is at least 90% covered.
# Excluded: main() and the shim's process-replacement helpers (exec_*.go) —
# they only run inside the built binary, so `go test` can never execute them;
# the e2e suite covers their behavior for real.
cover:
go test ./command/ ./util/ -coverprofile=coverage.out
go tool cover -func=coverage.out | tee coverage.txt | tail -1
@awk '$$3+0 < 90 && $$2 != "main" && $$1 !~ /exec_(unix|windows)\.go/ { print "UNDER 90%:", $$1, $$3; bad = 1 } END { if (bad) exit 1 }' coverage.txt