Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
More feedback on test 'harness'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Wilkie committed Apr 1, 2015
1 parent df7836d commit db9a0d7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ $(DOCKER_DISTRIB):

tests:
echo "mode: count" > profile.cov
for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \
go test -tags netgo -covermode=count -coverprofile=$$dir/profile.tmp $$dir; \
if [ -f $$dir/profile.tmp ]; then \
cat $$dir/profile.tmp | tail -n +2 >> profile.cov; \
rm $$dir/profile.tmp; \
for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \
output=$$(tempfile -p cover); \
go test -tags netgo -covermode=count -coverprofile=$$output $$dir; \
if [ -f $$output ]; then \
tail -n +2 <$$output >>profile.cov; \
rm $$output; \
fi \
done
go tool cover -html=profile.cov -o=coverage.html
Expand Down

0 comments on commit db9a0d7

Please sign in to comment.