forked from db47h/ngaro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (38 loc) · 1.39 KB
/
Makefile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
GO ?= go
PKG := github.com/dobegor/ngaro
SRC := vm/*.go asm/*.go
.PHONY: all install clean test bench qbench get-deps cover-asm cover-vm report
all: test
test:
ifeq ($(REPORT_COVERAGE),true)
$(GO) test $(PKG)/vm -covermode=count -coverprofile=coverage0.cov
$(GO) test $(PKG)/asm -covermode=count -coverprofile=coverage2.cov
@echo "mode: count" > coverage.cov
@grep -v ^mode coverage0.cov >> coverage.cov
@grep -v ^mode coverage1.cov >> coverage.cov
@grep -v ^mode coverage2.cov >> coverage.cov
$$(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.cov -service=travis-ci
@$(RM) coverage0.cov coverage1.cov coverage2.cov coverage.cov
else
$(GO) test -v $(PKG)/...
endif
bench:
$(GO) test -v $(PKG)/vm -run DONOTRUNTESTS -bench .
cover:
$(GO) test $(PKG)/vm -covermode=count -coverprofile=coverage0.cov
$(GO) test $(PKG)/asm -covermode=count -coverprofile=coverage2.cov
@echo "mode: count" > coverage.cov
@grep -v ^mode coverage0.cov >> coverage.cov
@grep -v ^mode coverage1.cov >> coverage.cov
@grep -v ^mode coverage2.cov >> coverage.cov
$(GO) tool cover -html coverage.cov
@$(RM) coverage0.cov coverage1.cov coverage2.cov coverage.cov
report: $(SRC)
@echo "=== gocyclo ===\n"
@gocyclo . | head
@echo "\n\n=== misspell ===\n"
@misspell -source go $^
@misspell -source text README.md
get-deps:
$(GO) get github.com/pkg/errors
$(GO) get github.com/pkg/term