Skip to content

Commit 3b675ea

Browse files
committed
Add Makefile to test and validate.
Signed-off-by: David Calavera <[email protected]>
1 parent fca06b9 commit 3b675ea

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.travis.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,5 @@
66
go:
77
- 1.5
88
- tip
9-
install:
10-
- go get -t ./...
11-
- go get github.com/golang/lint/golint
12-
script:
13-
- go vet ./...
14-
- test -z "$(golint ./... | tee /dev/stderr)"
15-
- test -z "$(gofmt -s -l . | tee /dev/stderr)"
16-
- go test -tags=test -v ./...
9+
install: make deps
10+
script: make validate && make test

Makefile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.PHONY: all deps test validate
2+
3+
all: deps test validate
4+
5+
deps:
6+
go get -t ./...
7+
go get github.com/golang/lint/golint
8+
9+
test:
10+
go test -tags=test ./...
11+
12+
validate:
13+
go vet ./...
14+
test -z "$(golint ./... | tee /dev/stderr)"
15+
test -z "$(gofmt -s -l . | tee /dev/stderr)"

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ This package is still pending to be extracted from the Docker engine.
5555

5656
## Developing
5757

58-
engine-api requires some minimal libraries that you can download running `go get ./...`.
58+
engine-api requires some minimal libraries that you can download running `make deps`.
5959

60-
To run tests, use this command `go test -tags=test ./...`. We use build tags to isolate functions and structures that are only available for testing.
60+
To run tests, use the command `make test`. We use build tags to isolate functions and structures that are only available for testing.
61+
62+
To validate the sources, use the command `make validate`.
6163

6264
## License
6365

0 commit comments

Comments
 (0)