Skip to content

Commit

Permalink
move coverage generation into a separate script
Browse files Browse the repository at this point in the history
  • Loading branch information
sabhiram committed Feb 22, 2015
1 parent 33ef0c1 commit 877e68f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .travis.yml
Expand Up @@ -13,10 +13,5 @@ before_install:
- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi

script:
- echo -e "mode: count" > coverage.out
- go test -v -covermode=count -coverprofile=magic_packet.out
- go test -v ./cmd/wol -covermode=count -coverprofile=wol.out
- cat magic_packet.out | tail -n +2 >> coverage.out
- cat wol.out | tail -n +2 >> coverage.out
- rm magic_packet.out wol.out
- ./run_tests.sh
- goveralls -coverprofile=coverage.out -service travis-ci -repotoken $COVERALLS_TOKEN
16 changes: 16 additions & 0 deletions run_tests.sh
@@ -0,0 +1,16 @@
#!/bin/bash

# This is a simple script to run our tests and accumulate the
# resulting coverage report into a single coverage.out file

fail=0

echo "mode: set" > coverage.out

go test -v . -covermode=count -coverprofile=magic_packet.out || fail=1
cat magic_packet.out | tail -n +2 >> coverage.out
rm magic_packet.out

go test -v ./cmd/wol -covermode=count -coverprofile=wol.out || fail=1
cat wol.out | tail -n +2 >> coverage.out
rm wol.out

0 comments on commit 877e68f

Please sign in to comment.