-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 769 Bytes
/
Makefile
File metadata and controls
31 lines (23 loc) · 769 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
COVERDIR=$(CURDIR)/.cover
COVERAGEFILE=$(COVERDIR)/cover.out
COVERAGEREPORT=$(COVERDIR)/report.html
.PHONY: test test-watch coverage coverage-html coverage-ci vet fmt
test:
@ginkgo --failFast ./...
test-watch:
@ginkgo watch -cover -r ./...
coverage-ci:
@mkdir -p $(COVERDIR)
@ginkgo -r -covermode=count --cover --trace ./
@echo "mode: count" > "${COVERAGEFILE}"
@find . -type f -name '*.coverprofile' -exec cat {} \; -exec rm -f {} \; | grep -h -v "^mode:" >> ${COVERAGEFILE}
coverage: coverage-ci
@sed -i -e "s|_$(CURDIR)/|./|g" "${COVERAGEFILE}"
@cp "${COVERAGEFILE}" coverage.txt
coverage-html:
@go tool cover -html="${COVERAGEFILE}" -o $(COVERAGEREPORT)
@xdg-open $(COVERAGEREPORT) 2> /dev/null > /dev/null
vet:
@go vet ./...
fmt:
@go fmt ./...