-
Notifications
You must be signed in to change notification settings - Fork 87
/
Makefile
48 lines (39 loc) · 1.15 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
47
48
precommit: fmt license test
test:
@go test -race ./...
fmt:
@go fmt ./...
license:
@go run $(GOPATH)/src/github.com/limetext/tasks/gen_license.go
fast_test:
@go test ./...
check_fmt:
ifneq ($(shell gofmt -l ./ | grep -v testdata),)
$(error code not fmted, run make fmt. $(shell gofmt -l ./ | grep -v testdata))
endif
check_license:
@go run $(GOPATH)/src/github.com/limetext/tasks/gen_license.go -check
tasks:
go get -d -u github.com/limetext/tasks
cover_dep:
go get -v -u github.com/mattn/goveralls
go get -v -u github.com/axw/gocov/gocov
travis:
ifeq ($(TRAVIS_OS_NAME),osx)
brew update
brew install oniguruma
endif
travis_test: export PKG_CONFIG_PATH += $(PWD)/vendor/github.com/limetext/rubex:$(GOPATH)/src/github.com/limetext/rubex
travis_test: test cover report_cover
cover:
@echo "mode: count" > coverage.cov; \
for pkg in $$(go list "./..."); do \
go test -covermode=count -coverprofile=tmp.cov $$pkg; \
sed 1d tmp.cov >> coverage.cov; \
rm tmp.cov; \
done
report_cover:
ifeq ($(REPORT_COVERAGE),true)
$$(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.cov -service=travis-ci
endif
rm coverage.cov