Add Makefile to test and validate.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera 2016-01-29 12:45:37 -05:00
Родитель fca06b9767
Коммит 3b675ea1d5
3 изменённых файлов: 21 добавлений и 10 удалений

Просмотреть файл

@ -6,11 +6,5 @@
go:
- 1.5
- tip
install:
- go get -t ./...
- go get github.com/golang/lint/golint
script:
- go vet ./...
- test -z "$(golint ./... | tee /dev/stderr)"
- test -z "$(gofmt -s -l . | tee /dev/stderr)"
- go test -tags=test -v ./...
install: make deps
script: make validate && make test

15
Makefile Normal file
Просмотреть файл

@ -0,0 +1,15 @@
.PHONY: all deps test validate
all: deps test validate
deps:
go get -t ./...
go get github.com/golang/lint/golint
test:
go test -tags=test ./...
validate:
go vet ./...
test -z "$(golint ./... | tee /dev/stderr)"
test -z "$(gofmt -s -l . | tee /dev/stderr)"

Просмотреть файл

@ -55,9 +55,11 @@ This package is still pending to be extracted from the Docker engine.
## Developing
engine-api requires some minimal libraries that you can download running `go get ./...`.
engine-api requires some minimal libraries that you can download running `make deps`.
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.
To run tests, use the command `make test`. We use build tags to isolate functions and structures that are only available for testing.
To validate the sources, use the command `make validate`.
## License