More feedback on test 'harness'

This commit is contained in:
Tom Wilkie committed 2015-04-01 12:32:35 +00:00
1 parent df7836df62
commit db9a0d7528
1 file changed
+6 -5
+6 -5
View File
@@ -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