forked from zimmski/osutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (44 loc) · 1.35 KB
/
Makefile
File metadata and controls
57 lines (44 loc) · 1.35 KB
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
49
50
51
52
53
54
55
56
57
export ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
export PKG := github.com/zimmski/osutil
export UNIT_TEST_TIMEOUT := 480
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(ARGS):;@:) # turn arguments into do-nothing targets
export ARGS
all: install-dependencies install-tools install lint test-verbose
.PHONY: all
clean:
go clean -i $(PKG)/...
go clean -i -race $(PKG)/...
.PHONY: clean
clean-coverage:
find $(ROOT_DIR) | grep .coverprofile | xargs rm
.PHONY: clean-coverage
install:
go install -v ./...
.PHONY: install
install-dependencies:
go get -t -v ./...
go test -i -v ./...
.PHONY: install-dependencies
install-tools:
# Install linting tools
go get -u -v golang.org/x/lint/golint/...
go get -u -v github.com/kisielk/errcheck/...
go get -u -v honnef.co/go/tools/cmd/megacheck
# Install code coverage tools
go get -u -v github.com/onsi/ginkgo/ginkgo/...
go get -u -v github.com/modocache/gover/...
go get -u -v github.com/mattn/goveralls/...
.PHONY: install-tools
lint:
$(ROOT_DIR)/scripts/lint.sh
.PHONY: lint
test:
go test -race -test.timeout $(UNIT_TEST_TIMEOUT)s $(PKG_TEST)
.PHONY: test
test-with-coverage:
ginkgo -r -cover -race -skipPackage="testdata" $(PKG_TEST)
.PHONY: test-with-coverage
test-verbose:
go test -race -test.timeout $(UNIT_TEST_TIMEOUT)s -v $(PKG_TEST)
.PHONY: test-verbose