@@ -109,9 +109,9 @@ benchmark-send:
109
109
@mkdir -p build
110
110
go test -v -bench=$(if $(RUN_BENCH ) ,$(RUN_BENCH ) ,BenchmarkAllSenders) ./send/ ./send/benchmark/ -run=^^$$
111
111
coverage-% :$(buildDir ) /output.% .coverage
112
- @grep -s -q -e " ^PASS" $<
112
+ @grep -s -q -e " ^PASS" $( buildDir ) /output. $* .test
113
113
html-coverage-% :$(buildDir ) /output.% .coverage $(buildDir ) /output.% .coverage.html
114
- @grep -s -q -e " ^PASS" $<
114
+ @grep -s -q -e " ^PASS" $( buildDir ) /output. $* .test
115
115
lint-% :$(buildDir ) /output.% .lint
116
116
@grep -v -s -q " ^--- FAIL" $<
117
117
# end convienence targets
@@ -135,28 +135,31 @@ coverDeps := $(addprefix $(gopath)/src/,$(coverDeps))
135
135
# and save test output.
136
136
$(buildDir ) /test.% :$(testSrcFiles ) $(coverDeps )
137
137
go test $(if $(DISABLE_COVERAGE ) ,,-covermode=count) -c -o $@ ./$(subst -,/,$* )
138
- $(buildDir ) /race.% :$(testSrcFiles )
139
- go test -race -c -o $@ ./$(subst -,/,$* )
140
- # targets to run any tests in the top-level package
141
- $(buildDir ) /test.$(name ) :$(testSrcFiles ) $(coverDeps )
142
- go test $(if $(DISABLE_COVERAGE ) ,,-covermode=count) -c -o $@ ./
143
- $(buildDir ) /race.$(name ) :$(testSrcFiles )
144
- go test -race -c -o $@ ./
145
- # targets to run the tests and report the output
146
- $(buildDir ) /output.% .test :$(buildDir ) /test.% .FORCE
147
- $(testRunEnv ) ./$< $(testArgs ) 2>&1 | tee $@
148
- $(buildDir ) /output.% .race :$(buildDir ) /race.% .FORCE
149
- $(testRunEnv ) ./$< $(testArgs ) 2>&1 | tee $@
138
+ $(buildDir ) /output.% .test : .FORCE
139
+ @mkdir -p $(buildDir )
140
+ go test $(if $(DISABLE_COVERAGE ) ,,-covermode=count) $(testArgs ) ./$(subst -,/,$* ) | tee $@
141
+ $(buildDir ) /output.$(name ) .test : .FORCE
142
+ @mkdir -p $(buildDir )
143
+ go test $(testArgs ) ./ | tee $@
144
+
145
+ $(buildDir ) /output.% .race : .FORCE
146
+ @mkdir -p $(buildDir )
147
+ go test -race $(testArgs ) ./$(subst -,/,$* ) 2>&1 | tee $@
148
+ $(buildDir ) /output.$(name ) .race : .FORCE
149
+ @mkdir -p $(buildDir )
150
+ go test -race $(testArgs ) ./ 2>&1 | tee $@
150
151
# targets to generate gotest output from the linter.
151
152
$(buildDir ) /output.% .lint :$(buildDir ) /run-linter $(testSrcFiles ) .FORCE
152
153
@./$< --output=$@ --lintArgs=' $(lintArgs)' --packages=' $*'
153
154
$(buildDir ) /output.lint :$(buildDir ) /run-linter .FORCE
154
155
@./$< --output=" $@ " --lintArgs=' $(lintArgs)' --packages=" $( packages) "
155
156
# targets to process and generate coverage reports
156
- $(buildDir ) /output.% .coverage :$(buildDir ) /test.% .FORCE $(coverDeps )
157
- $(testRunEnv ) ./$< $(testArgs ) -test.coverprofile=$@ | tee $(subst coverage,test,$@ )
157
+ $(buildDir ) /output.% .coverage : .FORCE $(coverDeps )
158
+ @mkdir -p $(buildDir )
159
+ go test $(testArgs ) -test.coverprofile=$@ | tee $(subst coverage,test,$@ )
158
160
@-[ -f $@ ] && go tool cover -func=$@ | sed ' s%$(projectPath)/%%' | column -t
159
161
$(buildDir ) /output.% .coverage.html :$(buildDir ) /output.% .coverage $(coverDeps )
162
+ @mkdir -p $(buildDir )
160
163
go tool cover -html=$< -o $@
161
164
# end test and coverage artifacts
162
165
0 commit comments