瀏覽代碼

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
 #!/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
+