File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ func runTest(ctx context.Context, args []string) error {
115
115
}
116
116
defer os .RemoveAll (tmpdir )
117
117
118
+ atLeastOneFailure := false
118
119
// list tests
119
120
for _ , pkg := range pkgs {
120
121
tests , err := listDirTests (pkg .Dir )
@@ -130,7 +131,7 @@ func runTest(ctx context.Context, args []string) error {
130
131
return err
131
132
}
132
133
133
- everythingIsOK := true
134
+ isPackageOK := true
134
135
for _ , test := range tests {
135
136
// FIXME: check if matches run regex
136
137
args := []string {
@@ -149,15 +150,19 @@ func runTest(ctx context.Context, args []string) error {
149
150
if opts .verbose {
150
151
fmt .Println (string (out ))
151
152
}
152
- everythingIsOK = false
153
+ isPackageOK = false
154
+ atLeastOneFailure = true
153
155
}
154
156
}
155
- if everythingIsOK {
157
+ if isPackageOK {
156
158
fmt .Printf ("ok\t %s\t %s\n " , pkg .ImportPath , time .Since (pkgStart ))
157
159
}
158
160
}
159
161
160
162
fmt .Printf ("total: %s\n " , time .Since (start ))
163
+ if atLeastOneFailure {
164
+ os .Exit (1 )
165
+ }
161
166
return nil
162
167
}
163
168
You can’t perform that action at this time.
0 commit comments