瀏覽代碼

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

Alexey Alexandrov 7 年之前
父節點
當前提交
0ade723f4d
No account linked to committer's email address
共有 1 個檔案被更改,包括 8 行新增1 行删除
  1. 8
    1
      test.sh

+ 8
- 1
test.sh 查看文件

@@ -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
+