Skip to content

Commit

Permalink
Change to test_cover and ran code coverage across package
Browse files Browse the repository at this point in the history
  • Loading branch information
dougnukem committed Oct 28, 2016
1 parent 0fc4d65 commit cc45e7f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Expand Up @@ -6,11 +6,14 @@ go:

go_import_path: github.com/dnaeon/go-vcr

before_install:
- go get github.com/modocache/gover

install:
- make get

script:
- make test
- make test_cover

after_success:
- bash <(curl -s https://codecov.io/bash)
5 changes: 4 additions & 1 deletion Makefile
Expand Up @@ -2,6 +2,9 @@ get:
go get -v -t -d ./...

test:
./test.sh
go test -v -race ./...

test_cover:
./test_cover.sh

.PHONY: get test
12 changes: 0 additions & 12 deletions test.sh

This file was deleted.

10 changes: 10 additions & 0 deletions test_cover.sh
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -e
echo "" > coverage.txt

go list -f '"go test -v -race -covermode=atomic -coverprofile={{.Name}}.coverprofile -coverpkg={{range $i, $f := .XTestImports}}{{if eq (printf "%.24s" $f) "github.com/dnaeon/go-vcr" }}{{$f}},{{end}}{{end}}{{.ImportPath}} {{.ImportPath}}"' ./... | grep -v vendor | xargs -I {} bash -c {}

gover . coverage.txt

rm *.coverprofile

0 comments on commit cc45e7f

Please sign in to comment.