@@ -3,10 +3,19 @@ IPFS_MIN_GO_VERSION = 1.7
3
3
IPFS_MIN_GX_VERSION = 0.6
4
4
IPFS_MIN_GX_GO_VERSION = 1.1
5
5
6
- ifeq ($(TEST_NO_FUSE ) ,1)
7
- go_test=IPFS_REUSEPORT =false go test -tags nofuse
6
+
7
+ export IPFS_REUSEPORT =false
8
+
9
+ ifneq ($(COVERALLS_TOKEN ) , )
10
+ covertools_rule = covertools
11
+ GOT = overalls -project=github.com/ipfs/go-ipfs -covermode atomic -ignore=.git,Godeps,thirdparty,test -- $(GOTFLAGS )
8
12
else
9
- go_test=IPFS_REUSEPORT =false go test
13
+ covertools_rule = $()
14
+ GOT = go test $(GOTFLAGS ) ./...
15
+ endif
16
+
17
+ ifeq ($(TEST_NO_FUSE ) ,1)
18
+ GOTFLAGS += -tags nofuse
10
19
endif
11
20
12
21
ifeq ($(OS ) ,Windows_NT)
@@ -48,9 +57,14 @@ gx_check: ${gx_bin} ${gx-go_bin}
48
57
path_check :
49
58
@bin/check_go_path $(realpath $(shell pwd) ) $(realpath $(addsuffix /src/github.com/ipfs/go-ipfs,$(subst $(GOPATH_DELIMITER ) , ,$(GOPATH ) ) ) )
50
59
51
- deps : go_check gx_check path_check
60
+ deps : go_check gx_check path_check $( covertools_rule )
52
61
${gx_bin} --verbose install --global
53
62
63
+ covertools :
64
+ go get -u github.com/mattn/goveralls
65
+ go get -u golang.org/x/tools/cmd/cover
66
+ go get -u github.com/Kubuxu/overalls
67
+
54
68
# saves/vendors third-party dependencies to Godeps/_workspace
55
69
# -r flag rewrites import paths to use the vendored path
56
70
# ./... performs operation on all packages in tree
67
81
uninstall :
68
82
$(MAKE ) -C cmd/ipfs uninstall
69
83
70
- PHONY += all help godep gx_check
84
+ PHONY += all help godep gx_check covertools
71
85
PHONY += go_check deps vendor install build nofuse clean uninstall
72
86
73
87
# #############################################################
@@ -85,14 +99,14 @@ test_3node:
85
99
test_go_fmt :
86
100
bin/test-go-fmt
87
101
88
- test_go_short :
89
- $(go_test ) -test.short ./...
90
102
91
- test_go_expensive :
92
- $(go_test ) ./...
93
-
94
- test_go_race :
95
- $(go_test ) ./... -race
103
+ test_go_short : GOTFLAGS += -test.short
104
+ test_go_race : GOTFLAGS += -race
105
+ test_go_expensive test_go_short test_go_race :
106
+ $(GOT )
107
+ ifneq ($(COVERALLS_TOKEN ) , )
108
+ goveralls -coverprofile=overalls.coverprofile -service $(SERVICE)
109
+ endif
96
110
97
111
test_sharness_short :
98
112
$(MAKE ) -j1 -C test/sharness/
0 commit comments