Makefile: enable running individual tests
e.g. `make github.com/drone/drone/pkg/database/migrate` also add targets that don't correspond to files or directories to .PHONY
This commit is contained in:
parent
9f43d5c647
commit
a07f37fbf3
1 changed files with 23 additions and 17 deletions
40
Makefile
40
Makefile
|
@ -1,5 +1,24 @@
|
||||||
SHA := $(shell git rev-parse --short HEAD)
|
SHA := $(shell git rev-parse --short HEAD)
|
||||||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
PKGS := \
|
||||||
|
build \
|
||||||
|
build/buildfile \
|
||||||
|
build/docker \
|
||||||
|
build/dockerfile \
|
||||||
|
build/proxy \
|
||||||
|
build/repo \
|
||||||
|
build/script \
|
||||||
|
channel \
|
||||||
|
database \
|
||||||
|
database/encrypt \
|
||||||
|
database/migrate \
|
||||||
|
database/testing \
|
||||||
|
mail \
|
||||||
|
model \
|
||||||
|
plugin/deploy \
|
||||||
|
queue
|
||||||
|
PKGS := $(addprefix github.com/drone/drone/pkg/,$(PKGS))
|
||||||
|
.PHONY := test $(PKGS)
|
||||||
|
|
||||||
all: embed build
|
all: embed build
|
||||||
|
|
||||||
|
@ -40,23 +59,10 @@ build:
|
||||||
cd cmd/drone && go build -o ../../bin/drone
|
cd cmd/drone && go build -o ../../bin/drone
|
||||||
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
|
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
|
||||||
|
|
||||||
test:
|
test: $(PKGS)
|
||||||
go test -v github.com/drone/drone/pkg/build
|
|
||||||
go test -v github.com/drone/drone/pkg/build/buildfile
|
$(PKGS):
|
||||||
go test -v github.com/drone/drone/pkg/build/docker
|
go test -v $@
|
||||||
go test -v github.com/drone/drone/pkg/build/dockerfile
|
|
||||||
go test -v github.com/drone/drone/pkg/build/proxy
|
|
||||||
go test -v github.com/drone/drone/pkg/build/repo
|
|
||||||
go test -v github.com/drone/drone/pkg/build/script
|
|
||||||
go test -v github.com/drone/drone/pkg/channel
|
|
||||||
go test -v github.com/drone/drone/pkg/database
|
|
||||||
go test -v github.com/drone/drone/pkg/database/encrypt
|
|
||||||
go test -v github.com/drone/drone/pkg/database/migrate
|
|
||||||
go test -v github.com/drone/drone/pkg/database/testing
|
|
||||||
go test -v github.com/drone/drone/pkg/mail
|
|
||||||
go test -v github.com/drone/drone/pkg/model
|
|
||||||
go test -v github.com/drone/drone/pkg/plugin/deploy
|
|
||||||
go test -v github.com/drone/drone/pkg/queue
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
cp deb/drone/etc/init/drone.conf /etc/init/drone.conf
|
cp deb/drone/etc/init/drone.conf /etc/init/drone.conf
|
||||||
|
|
Loading…
Reference in a new issue