diff --git a/.travis.yml b/.travis.yml index 2343bb4..1138f1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,7 @@ sudo: required language: go script: - - make test + - NOASM=0 make test + - NOASM=1 make test + - NOASM=0 make cover + - NOASM=1 make cover diff --git a/Makefile b/Makefile index de9b730..be2e6db 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,11 @@ GOPATH_LOCAL = $(PRJ_DIR)/build/ GOPATH_DIR = src/github.com/henrydcase/nobs VENDOR_DIR = tls_vendor OPTS ?= +NOASM ?= + +ifeq ($(NOASM),1) + OPTS+=$(OPTS_TAGS) +endif TARGETS=\ dh\ @@ -18,9 +23,15 @@ prep-%: make_dirs: mkdir -p $(GOPATH_LOCAL)/$(GOPATH_DIR) + cp -rf etc $(GOPATH_LOCAL)/$(GOPATH_DIR) 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: rm -rf $(GOPATH_LOCAL)