1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

Override GOPATH when collecting coverage

This commit is contained in:
Achilleas Anagnostopoulos 2017-07-01 20:50:27 +01:00
parent f961270904
commit 5f8f42a0c5
3 changed files with 9 additions and 7 deletions

View File

@ -2,10 +2,8 @@ language: go
sudo: required sudo: required
go: go:
- 1.8 - 1.8
before_install:
- go get -t -v ./...
script: script:
- make lint - make lint
- bash coverage.sh - make collect-coverage
after_success: after_success:
- bash <(curl -s https://codecov.io/bash) - bash <(curl -s https://codecov.io/bash)

View File

@ -119,7 +119,7 @@ $(iso_target): iso_prereq kernel_image
else else
VAGRANT_SRC_FOLDER = /home/vagrant/workspace VAGRANT_SRC_FOLDER = /home/vagrant/workspace
.PHONY: kernel iso vagrant-up vagrant-down vagrant-ssh run gdb clean .PHONY: kernel iso vagrant-up vagrant-down vagrant-ssh run gdb clean lint lint-check-deps test collect-coverage
kernel: kernel:
vagrant ssh -c 'cd $(VAGRANT_SRC_FOLDER); make GC_FLAGS="$(GC_FLAGS)" kernel' vagrant ssh -c 'cd $(VAGRANT_SRC_FOLDER); make GC_FLAGS="$(GC_FLAGS)" kernel'
@ -173,8 +173,12 @@ lint: lint-check-deps
./... ./...
lint-check-deps: lint-check-deps:
@$(GO) get -u gopkg.in/alecthomas/gometalinter.v1 @GOPATH=$(GOPATH) $(GO) get -u -t gopkg.in/alecthomas/gometalinter.v1
@gometalinter.v1 --install >/dev/null @gometalinter.v1 --install >/dev/null
test: test:
$(GO) test -cover ./... GOPATH=$(GOPATH) $(GO) test -cover gopheros/...
collect-coverage:
GOPATH=$(GOPATH) sh coverage.sh

View File

@ -3,7 +3,7 @@ set -e
echo "" > coverage.txt echo "" > coverage.txt
for d in $(go list ./... | grep -v vendor); do for d in $(go list ./... | grep gopheros); do
go test -v -race -coverprofile=profile.out -covermode=atomic $d go test -v -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then if [ -f profile.out ]; then
cat profile.out >> coverage.txt cat profile.out >> coverage.txt