Parcourir la source

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

Alexey Alexandrov il y a 7 ans
Parent
révision
0ade723f4d
No account linked to committer's email address
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. 8
    1
      test.sh

+ 8
- 1
test.sh Voir le fichier

@@ -1,13 +1,19 @@
1 1
 #!/usr/bin/env bash
2 2
 
3 3
 set -e
4
+set -x
4 5
 MODE=atomic
5 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 11
 staticcheck $PKG
10 12
 unused $PKG
13
+
14
+# Packages that have any tests.
15
+PKG=$(go list -f '{{if .TestGoFiles}} {{.ImportPath}} {{end}}' ./...)
16
+
11 17
 go test -v $PKG
12 18
 
13 19
 for d in $PKG; do
@@ -17,3 +23,4 @@ for d in $PKG; do
17 23
     rm profile.out
18 24
   fi
19 25
 done
26
+