mirror of
https://github.com/henrydcase/nobs.git
synced 2024-11-22 15:18:57 +00:00
improves makefile
This commit is contained in:
parent
34805fc1fb
commit
2a25a09b4a
@ -2,4 +2,7 @@ sudo: required
|
|||||||
language: go
|
language: go
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make test
|
- NOASM=0 make test
|
||||||
|
- NOASM=1 make test
|
||||||
|
- NOASM=0 make cover
|
||||||
|
- NOASM=1 make cover
|
||||||
|
13
Makefile
13
Makefile
@ -5,6 +5,11 @@ GOPATH_LOCAL = $(PRJ_DIR)/build/
|
|||||||
GOPATH_DIR = src/github.com/henrydcase/nobs
|
GOPATH_DIR = src/github.com/henrydcase/nobs
|
||||||
VENDOR_DIR = tls_vendor
|
VENDOR_DIR = tls_vendor
|
||||||
OPTS ?=
|
OPTS ?=
|
||||||
|
NOASM ?=
|
||||||
|
|
||||||
|
ifeq ($(NOASM),1)
|
||||||
|
OPTS+=$(OPTS_TAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
TARGETS=\
|
TARGETS=\
|
||||||
dh\
|
dh\
|
||||||
@ -18,9 +23,15 @@ prep-%:
|
|||||||
|
|
||||||
make_dirs:
|
make_dirs:
|
||||||
mkdir -p $(GOPATH_LOCAL)/$(GOPATH_DIR)
|
mkdir -p $(GOPATH_LOCAL)/$(GOPATH_DIR)
|
||||||
|
cp -rf etc $(GOPATH_LOCAL)/$(GOPATH_DIR)
|
||||||
|
|
||||||
test: clean make_dirs $(addprefix prep-,$(TARGETS))
|
test: clean make_dirs $(addprefix prep-,$(TARGETS))
|
||||||
GOPATH=$(GOPATH_LOCAL) go test -v ./...
|
cd $(GOPATH_LOCAL); GOPATH=$(GOPATH_LOCAL) go test $(OPTS) -v ./...
|
||||||
|
|
||||||
|
cover:
|
||||||
|
cd $(GOPATH_LOCAL); GOPATH=$(GOPATH_LOCAL) go test \
|
||||||
|
-race -coverprofile=coverage_$(NOASM).txt -covermode=atomic $(OPTS) -v ./...
|
||||||
|
cat $(GOPATH_LOCAL)/coverage_$(NOASM).txt >> coverage.txt
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(GOPATH_LOCAL)
|
rm -rf $(GOPATH_LOCAL)
|
||||||
|
Loading…
Reference in New Issue
Block a user