Minor change to coverage.bash script
Peter Bourgon
8 years ago
0 | 0 | #!/usr/bin/env bash |
1 | 1 | |
2 | # This script runs the cover tool on all packages with test files. If you set | |
3 | # an "HTML" environment variable, it will additionally open the web-based | |
4 | # coverage visualizer for each package. | |
2 | # This script runs the cover tool on all packages with test files. If you set a | |
3 | # WEB environment variable, it will additionally open the web-based coverage | |
4 | # visualizer for each package. | |
5 | 5 | |
6 | 6 | function go_files { find . -name '*_test.go' ; } |
7 | 7 | function filter { grep -v '/_' ; } |
29 | 29 | package_names | while read pkg |
30 | 30 | do |
31 | 31 | go test -coverprofile=cover.out $pkg |
32 | if [ -n "${HTML+x}" ] | |
32 | if [ -n "${WEB+x}" ] | |
33 | 33 | then |
34 | 34 | go tool cover -html=cover.out |
35 | 35 | fi |