@@ -136,7 +136,7 @@ func runList(ctx context.Context, args []string) error {
136
136
continue
137
137
}
138
138
139
- log .Println (pkg .ImportPath )
139
+ fmt .Println (pkg .ImportPath )
140
140
for _ , test := range tests {
141
141
fmt .Printf (" %s\n " , test )
142
142
}
@@ -155,13 +155,13 @@ func runTest(ctx context.Context, args []string) error {
155
155
}
156
156
defer cleanup ()
157
157
158
- log .Printf ("runTest opts=%s args=%s" , JSON (opts ), JSON (args ))
158
+ fmt .Printf ("runTest opts=%s args=%s" , JSON (opts ), JSON (args ))
159
159
start := time .Now ()
160
160
161
161
if opts .Timeout > 0 {
162
162
go func () {
163
163
<- time .After (opts .Timeout )
164
- log .Printf ("FAIL: timed out after %s\n " , time .Since (start ))
164
+ fmt .Printf ("FAIL: timed out after %s\n " , time .Since (start ))
165
165
panic (fmt .Sprintf ("timed out after %s" , time .Since (start )))
166
166
}()
167
167
}
@@ -187,7 +187,7 @@ func runTest(ctx context.Context, args []string) error {
187
187
// compile test binary
188
188
bin , err := compileTestBin (pkg , opts .TmpDir )
189
189
if err != nil {
190
- log .Printf ("FAIL\t %s\t [compile error: %v]\n " , pkg .ImportPath , err )
190
+ fmt .Printf ("FAIL\t %s\t [compile error: %v]\n " , pkg .ImportPath , err )
191
191
return err
192
192
}
193
193
@@ -209,31 +209,31 @@ func runTest(ctx context.Context, args []string) error {
209
209
args = append (args , "-test.run" , fmt .Sprintf ("^%s$" , test ))
210
210
for i := opts .Retry ; i >= 0 ; i -- {
211
211
cmd := exec .Command (bin , args ... )
212
- log .Println (cmd .String ())
212
+ fmt .Println (cmd .String ())
213
213
out , err := cmd .CombinedOutput ()
214
214
if err != nil {
215
215
if i == 0 {
216
- log .Printf ("FAIL\t %s.%s\t [test error: %v]\n " , pkg .ImportPath , test , err )
216
+ fmt .Printf ("FAIL\t %s.%s\t [test error: %v]\n " , pkg .ImportPath , test , err )
217
217
isPackageOK = false
218
218
atLeastOneFailure = true
219
219
} else if opts .Verbose {
220
- log .Printf ("RETRY\t %s.%s\t [test error: %v]\n " , pkg .ImportPath , test , err )
220
+ fmt .Printf ("RETRY\t %s.%s\t [test error: %v]\n " , pkg .ImportPath , test , err )
221
221
}
222
222
if opts .Verbose {
223
- log .Println (string (out ))
223
+ fmt .Println (string (out ))
224
224
}
225
225
} else {
226
- log .Printf ("ok\t %s.%s\n " , pkg .ImportPath , test )
226
+ fmt .Printf ("ok\t %s.%s\n " , pkg .ImportPath , test )
227
227
break
228
228
}
229
229
}
230
230
}
231
231
if isPackageOK {
232
- log .Printf ("ok\t %s\t %s\n " , pkg .ImportPath , time .Since (pkgStart ))
232
+ fmt .Printf ("ok\t %s\t %s\n " , pkg .ImportPath , time .Since (pkgStart ))
233
233
}
234
234
}
235
235
236
- log .Printf ("total: %s\n " , time .Since (start ))
236
+ fmt .Printf ("total: %s\n " , time .Since (start ))
237
237
if atLeastOneFailure {
238
238
return errors .New ("at least one failure occurred" )
239
239
}
@@ -271,7 +271,7 @@ func compileTestBin(pkg Package, tempdir string) (string, error) {
271
271
args = append (args , "-o" , bin )
272
272
cmd := exec .Command ("go" , args ... )
273
273
cmd .Dir = pkg .Dir
274
- log .Println (cmd .String ())
274
+ fmt .Println (cmd .String ())
275
275
out , err := cmd .CombinedOutput ()
276
276
if err != nil {
277
277
fmt .Fprintln (os .Stderr , string (out ))
@@ -284,7 +284,7 @@ func compileTestBin(pkg Package, tempdir string) (string, error) {
284
284
func listDirTests (dir string ) ([]string , error ) {
285
285
cmd := exec .Command ("go" , "test" , "-list" , "." )
286
286
cmd .Dir = dir
287
- log .Println (cmd .String ())
287
+ fmt .Println (cmd .String ())
288
288
out , err := cmd .CombinedOutput ()
289
289
if err != nil {
290
290
return nil , err
@@ -303,7 +303,7 @@ func listDirTests(dir string) ([]string, error) {
303
303
}
304
304
305
305
if len (opts .Skip ) > 0 {
306
- log .Println ("skip" , opts .Skip )
306
+ fmt .Println ("skip" , opts .Skip )
307
307
var filteredTests []string
308
308
for _ , test := range tests {
309
309
shouldKeep := true
@@ -329,7 +329,7 @@ func listDirTests(dir string) ([]string, error) {
329
329
}
330
330
331
331
if len (opts .Run ) > 0 {
332
- log .Println ("run" , opts .Run )
332
+ fmt .Println ("run" , opts .Run )
333
333
var filteredTests []string
334
334
for _ , test := range tests {
335
335
shouldKeep := false
@@ -360,7 +360,7 @@ func listDirTests(dir string) ([]string, error) {
360
360
func listPackagesWithTests (patterns []string ) ([]Package , error ) {
361
361
cmdArgs := append ([]string {"list" , "-test" , "-f" , "{{.ImportPath}} {{.Dir}}" }, patterns ... )
362
362
cmd := exec .Command ("go" , cmdArgs ... )
363
- log .Println (cmd .String ())
363
+ fmt .Println (cmd .String ())
364
364
out , err := cmd .CombinedOutput ()
365
365
if err != nil {
366
366
fmt .Fprintln (os .Stderr , string (out ))
0 commit comments