@@ -91,6 +91,29 @@ type work struct {
91
91
end chan bool
92
92
}
93
93
94
+ // printSkip prints a skip message for all of work.
95
+ func (w * work ) printSkip (t * tester , msg string ) {
96
+ if t .json {
97
+ type event struct {
98
+ Time time.Time
99
+ Action string
100
+ Package string
101
+ Output string `json:",omitempty"`
102
+ }
103
+ enc := json .NewEncoder (& w .out )
104
+ ev := event {Time : time .Now (), Package : w .dt .name , Action : "start" }
105
+ enc .Encode (ev )
106
+ ev .Action = "output"
107
+ ev .Output = msg
108
+ enc .Encode (ev )
109
+ ev .Action = "skip"
110
+ ev .Output = ""
111
+ enc .Encode (ev )
112
+ return
113
+ }
114
+ fmt .Fprintln (& w .out , msg )
115
+ }
116
+
94
117
// A distTest is a test run by dist test.
95
118
// Each test has a unique name and belongs to a group (heading)
96
119
type distTest struct {
@@ -1238,7 +1261,7 @@ func (t *tester) runPending(nextTest *distTest) {
1238
1261
go func (w * work ) {
1239
1262
if ! <- w .start {
1240
1263
timelog ("skip" , w .dt .name )
1241
- w .out . WriteString ( "skipped due to earlier error\n " )
1264
+ w .printSkip ( t , "skipped due to earlier error" )
1242
1265
} else {
1243
1266
timelog ("start" , w .dt .name )
1244
1267
w .err = w .cmd .Run ()
@@ -1249,7 +1272,7 @@ func (t *tester) runPending(nextTest *distTest) {
1249
1272
if isUnsupportedVMASize (w ) {
1250
1273
timelog ("skip" , w .dt .name )
1251
1274
w .out .Reset ()
1252
- w .out . WriteString ( "skipped due to unsupported VMA\n " )
1275
+ w .printSkip ( t , "skipped due to unsupported VMA" )
1253
1276
w .err = nil
1254
1277
}
1255
1278
}
0 commit comments