Browse Source

Skip packages with no tests while testing. (#264)

Alexey Alexandrov 7 years ago
parent
commit
0ade723f4d
No account linked to committer's email address
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      test.sh

+ 8
- 1
test.sh View File

1
 #!/usr/bin/env bash
1
 #!/usr/bin/env bash
2
 
2
 
3
 set -e
3
 set -e
4
+set -x
4
 MODE=atomic
5
 MODE=atomic
5
 echo "mode: $MODE" > coverage.txt
6
 echo "mode: $MODE" > coverage.txt
6
 
7
 
7
-PKG=$(go list ./... | grep -v /vendor/)
8
+# All packages.
9
+PKG=$(go list ./...)
8
 
10
 
9
 staticcheck $PKG
11
 staticcheck $PKG
10
 unused $PKG
12
 unused $PKG
13
+
14
+# Packages that have any tests.
15
+PKG=$(go list -f '{{if .TestGoFiles}} {{.ImportPath}} {{end}}' ./...)
16
+
11
 go test -v $PKG
17
 go test -v $PKG
12
 
18
 
13
 for d in $PKG; do
19
 for d in $PKG; do
17
     rm profile.out
23
     rm profile.out
18
   fi
24
   fi
19
 done
25
 done
26
+