Sin descripción

test.sh 714B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. set -e
  3. set -x
  4. MODE=atomic
  5. echo "mode: $MODE" > coverage.txt
  6. # All packages.
  7. PKG=$(go list ./...)
  8. staticcheck -ignore '
  9. github.com/google/pprof/internal/binutils/binutils_test.go:SA6004
  10. github.com/google/pprof/internal/driver/svg.go:SA6004
  11. github.com/google/pprof/internal/report/source_test.go:SA6004
  12. github.com/google/pprof/profile/filter_test.go:SA6004
  13. ' $PKG
  14. unused $PKG
  15. # Packages that have any tests.
  16. PKG=$(go list -f '{{if .TestGoFiles}} {{.ImportPath}} {{end}}' ./...)
  17. go test -v $PKG
  18. for d in $PKG; do
  19. go test -race -coverprofile=profile.out -covermode=$MODE $d
  20. if [ -f profile.out ]; then
  21. cat profile.out | grep -v "^mode: " >> coverage.txt
  22. rm profile.out
  23. fi
  24. done