-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (47 loc) · 1.87 KB
/
Copy pathMakefile
File metadata and controls
58 lines (47 loc) · 1.87 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
58
export GO15VENDOREXPERIMENT=1
exe = ./cmd/cli53
.PHONY: all build install test coverage test-deps
all: install
test-deps:
go get github.com/wadey/gocovmerge
go install github.com/wadey/gocovmerge
go get github.com/gucumber/gucumber/cmd/gucumber
go install github.com/gucumber/gucumber/cmd/gucumber
build:
go build -v $(exe)
install:
go install $(exe)
test-unit:
go test
test-integration: build
@tmp_gopath=$$(mktemp -d /tmp/cli53-gucumber.XXXXXX); \
GOBIN=$$tmp_gopath/bin go install github.com/gucumber/gucumber/cmd/gucumber@v0.0.0-20180127021336-7d5c79e832a2; \
mkdir -p $$tmp_gopath/src/github.com/barnybug; \
ln -s $$(pwd) $$tmp_gopath/src/github.com/barnybug/cli53; \
cd $$tmp_gopath/src/github.com/barnybug/cli53 && \
GOPATH=$$tmp_gopath $$tmp_gopath/bin/gucumber; \
status=$$?; \
chmod -R +w $$tmp_gopath; \
rm -rf $$tmp_gopath; \
exit $$status
# run unit and system tests, then recombine coverage output
test-coverage: test-deps
rm -rf coverage && mkdir coverage
go test -covermode=count -coverprofile=coverage/unit.txt
go test -c -covermode=count -coverpkg . -o ./cli53 ./cmd/cli53
@tmp_gopath=$$(mktemp -d /tmp/cli53-gucumber.XXXXXX); \
GOBIN=$$tmp_gopath/bin go install github.com/gucumber/gucumber/cmd/gucumber@v0.0.0-20180127021336-7d5c79e832a2; \
mkdir -p $$tmp_gopath/src/github.com/barnybug; \
ln -s $$(pwd) $$tmp_gopath/src/github.com/barnybug/cli53; \
cd $$tmp_gopath/src/github.com/barnybug/cli53 && \
COVERAGE=1 GOPATH=$$tmp_gopath $$tmp_gopath/bin/gucumber; \
status=$$?; \
chmod -R +w $$tmp_gopath; \
rm -rf $$tmp_gopath; \
exit $$status
gocovmerge coverage/*.txt > coverage.txt
test: test-unit test-integration
docker-build:
sudo docker run --rm -v `pwd`:/go/src/github.com/barnybug/cli53 -w /go/src/github.com/barnybug/cli53 golang:1.6-alpine sh -c 'apk add --no-cache make git && make build'
sudo docker build -t barnybug/cli53 .
rm -f cli53