10
10
namespace Microsoft . DotNet . Tools . Test
11
11
{
12
12
/*
13
- |---FieldCount---| 2 bytes
13
+ |---FieldCount---| 2 bytes
14
14
15
- |---ExecutionId Id---| (2 bytes)
16
- |---ExecutionId Size---| (4 bytes)
17
- |---ExecutionId Value---| (n bytes)
15
+ |---ExecutionId Id---| (2 bytes)
16
+ |---ExecutionId Size---| (4 bytes)
17
+ |---ExecutionId Value---| (n bytes)
18
18
19
- |---SuccessfulTestMessageList Id---| (2 bytes)
20
- |---SuccessfulTestMessageList Size---| (4 bytes)
21
- |---SuccessfulTestMessageList Value---| (n bytes)
22
- |---SuccessfulTestMessageList Length---| (4 bytes)
19
+ |---SuccessfulTestMessageList Id---| (2 bytes)
20
+ |---SuccessfulTestMessageList Size---| (4 bytes)
21
+ |---SuccessfulTestMessageList Value---| (n bytes)
22
+ |---SuccessfulTestMessageList Length---| (4 bytes)
23
23
24
- |---SuccessfulTestMessageList[0] FieldCount---| 2 bytes
24
+ |---SuccessfulTestMessageList[0] FieldCount---| 2 bytes
25
25
26
- |---SuccessfulTestMessageList[0].Uid Id---| (2 bytes)
27
- |---SuccessfulTestMessageList[0].Uid Size---| (4 bytes)
28
- |---SuccessfulTestMessageList[0].Uid Value---| (n bytes)
26
+ |---SuccessfulTestMessageList[0].Uid Id---| (2 bytes)
27
+ |---SuccessfulTestMessageList[0].Uid Size---| (4 bytes)
28
+ |---SuccessfulTestMessageList[0].Uid Value---| (n bytes)
29
29
30
- |---SuccessfulTestMessageList[0].DisplayName Id---| (2 bytes)
31
- |---SuccessfulTestMessageList[0].DisplayName Size---| (4 bytes)
32
- |---SuccessfulTestMessageList[0].DisplayName Value---| (n bytes)
30
+ |---SuccessfulTestMessageList[0].DisplayName Id---| (2 bytes)
31
+ |---SuccessfulTestMessageList[0].DisplayName Size---| (4 bytes)
32
+ |---SuccessfulTestMessageList[0].DisplayName Value---| (n bytes)
33
33
34
- |---SuccessfulTestMessageList[0].State Id---| (2 bytes)
35
- |---SuccessfulTestMessageList[0].State Size---| (4 bytes )
36
- |---SuccessfulTestMessageList[0].State Value---| (n bytes)
34
+ |---SuccessfulTestMessageList[0].State Id---| (2 bytes)
35
+ |---SuccessfulTestMessageList[0].State Size---| (1 byte )
36
+ |---SuccessfulTestMessageList[0].State Value---| (n bytes)
37
37
38
- |---SuccessfulTestMessageList[0].Reason Id---| (2 bytes)
39
- |---SuccessfulTestMessageList[0].Reason Size---| (4 bytes)
40
- |---SuccessfulTestMessageList[0].Reason Value---| (n bytes)
38
+ |---SuccessfulTestMessageList[0].Duration Id---| (2 bytes)
39
+ |---SuccessfulTestMessageList[0].Duration Size---| (8 bytes)
40
+ |---SuccessfulTestMessageList[0].Duration Value---| (n bytes)
41
41
42
- |---SuccessfulTestMessageList[0].SessionUid Id---| (2 bytes)
43
- |---SuccessfulTestMessageList[0].SessionUid Size---| (4 bytes)
44
- |---SuccessfulTestMessageList[0].SessionUid Value---| (n bytes)
42
+ |---SuccessfulTestMessageList[0].Reason Id---| (2 bytes)
43
+ |---SuccessfulTestMessageList[0].Reason Size---| (4 bytes)
44
+ |---SuccessfulTestMessageList[0].Reason Value---| (n bytes)
45
45
46
- |---FailedTestMessageList Id---| (2 bytes)
47
- |---FailedTestMessageList Size---| (4 bytes)
48
- |---FailedTestMessageList Value---| (n bytes)
49
- |---FailedTestMessageList Length---| (4 bytes)
46
+ |---SuccessfulTestMessageList[0].StandardOutput Id---| (2 bytes)
47
+ |---SuccessfulTestMessageList[0].StandardOutput Size---| (4 bytes)
48
+ |---SuccessfulTestMessageList[0].StandardOutput Value---| (n bytes)
50
49
51
- |---FailedTestMessageList[0] FieldCount---| 2 bytes
50
+ |---SuccessfulTestMessageList[0].StandardError Id---| (2 bytes)
51
+ |---SuccessfulTestMessageList[0].StandardError Size---| (4 bytes)
52
+ |---SuccessfulTestMessageList[0].StandardError Value---| (n bytes)
52
53
53
- |---FailedTestMessageList [0].Uid Id---| (2 bytes)
54
- |---FailedTestMessageList [0].Uid Size---| (4 bytes)
55
- |---FailedTestMessageList [0].Uid Value---| (n bytes)
54
+ |---SuccessfulTestMessageList [0].SessionUid Id---| (2 bytes)
55
+ |---SuccessfulTestMessageList [0].SessionUid Size---| (4 bytes)
56
+ |---SuccessfulTestMessageList [0].SessionUid Value---| (n bytes)
56
57
57
- |---FailedTestMessageList[0].DisplayName Id---| (2 bytes)
58
- |---FailedTestMessageList[0].DisplayName Size---| (4 bytes)
59
- |---FailedTestMessageList[0].DisplayName Value---| (n bytes)
58
+ |---FailedTestMessageList Id---| (2 bytes)
59
+ |---FailedTestMessageList Size---| (4 bytes)
60
+ |---FailedTestMessageList Value---| (n bytes)
61
+ |---FailedTestMessageList Length---| (4 bytes)
60
62
61
- |---FailedTestMessageList[0].State Id---| (2 bytes)
62
- |---FailedTestMessageList[0].State Size---| (4 bytes)
63
- |---FailedTestMessageList[0].State Value---| (n bytes)
63
+ |---FailedTestMessageList[0] FieldCount---| 2 bytes
64
64
65
- |---FailedTestMessageList[0].Reason Id---| (2 bytes)
66
- |---FailedTestMessageList[0].Reason Size---| (4 bytes)
67
- |---FailedTestMessageList[0].Reason Value---| (n bytes)
65
+ |---FailedTestMessageList[0].Uid Id---| (2 bytes)
66
+ |---FailedTestMessageList[0].Uid Size---| (4 bytes)
67
+ |---FailedTestMessageList[0].Uid Value---| (n bytes)
68
68
69
- |---FailedTestMessageList[0].ErrorMessage Id---| (2 bytes)
70
- |---FailedTestMessageList[0].ErrorMessage Size---| (4 bytes)
71
- |---FailedTestMessageList[0].ErrorMessage Value---| (n bytes)
69
+ |---FailedTestMessageList[0].DisplayName Id---| (2 bytes)
70
+ |---FailedTestMessageList[0].DisplayName Size---| (4 bytes)
71
+ |---FailedTestMessageList[0].DisplayName Value---| (n bytes)
72
72
73
- |---FailedTestMessageList[0].ErrorStackTrace Id---| (2 bytes)
74
- |---FailedTestMessageList[0].ErrorStackTrace Size---| (4 bytes )
75
- |---FailedTestMessageList[0].ErrorStackTrace Value---| (n bytes)
73
+ |---FailedTestMessageList[0].State Id---| (2 bytes)
74
+ |---FailedTestMessageList[0].State Size---| (1 byte )
75
+ |---FailedTestMessageList[0].State Value---| (n bytes)
76
76
77
- |---FailedTestMessageList[0].SessionUid Id---| (2 bytes)
78
- |---FailedTestMessageList[0].SessionUid Size---| (4 bytes)
79
- |---FailedTestMessageList[0].SessionUid Value---| (n bytes)
80
- */
77
+ |---SuccessfulTestMessageList[0].Duration Id---| (2 bytes)
78
+ |---SuccessfulTestMessageList[0].Duration Size---| (8 bytes)
79
+ |---SuccessfulTestMessageList[0].Duration Value---| (n bytes)
80
+
81
+ |---FailedTestMessageList[0].Reason Id---| (2 bytes)
82
+ |---FailedTestMessageList[0].Reason Size---| (4 bytes)
83
+ |---FailedTestMessageList[0].Reason Value---| (n bytes)
84
+
85
+ |---FailedTestMessageList[0].ErrorMessage Id---| (2 bytes)
86
+ |---FailedTestMessageList[0].ErrorMessage Size---| (4 bytes)
87
+ |---FailedTestMessageList[0].ErrorMessage Value---| (n bytes)
88
+
89
+ |---FailedTestMessageList[0].ErrorStackTrace Id---| (2 bytes)
90
+ |---FailedTestMessageList[0].ErrorStackTrace Size---| (4 bytes)
91
+ |---FailedTestMessageList[0].ErrorStackTrace Value---| (n bytes)
92
+
93
+ |---SuccessfulTestMessageList[0].StandardOutput Id---| (2 bytes)
94
+ |---SuccessfulTestMessageList[0].StandardOutput Size---| (4 bytes)
95
+ |---SuccessfulTestMessageList[0].StandardOutput Value---| (n bytes)
96
+
97
+ |---SuccessfulTestMessageList[0].StandardError Id---| (2 bytes)
98
+ |---SuccessfulTestMessageList[0].StandardError Size---| (4 bytes)
99
+ |---SuccessfulTestMessageList[0].StandardError Value---| (n bytes)
100
+
101
+ |---FailedTestMessageList[0].SessionUid Id---| (2 bytes)
102
+ |---FailedTestMessageList[0].SessionUid Size---| (4 bytes)
103
+ |---FailedTestMessageList[0].SessionUid Value---| (n bytes)
104
+ */
81
105
82
106
internal sealed class TestResultMessagesSerializer : BaseSerializer , INamedPipeSerializer
83
107
{
@@ -130,8 +154,9 @@ private static List<SuccessfulTestResultMessage> ReadSuccessfulTestMessagesPaylo
130
154
int length = ReadInt ( stream ) ;
131
155
for ( int i = 0 ; i < length ; i ++ )
132
156
{
133
- string ? uid = null , displayName = null , reason = null , sessionUid = null ;
157
+ string ? uid = null , displayName = null , reason = null , standardOutput = null , errorOutput = null , sessionUid = null ;
134
158
byte ? state = null ;
159
+ long ? duration = null ;
135
160
136
161
int fieldCount = ReadShort ( stream ) ;
137
162
@@ -154,10 +179,22 @@ private static List<SuccessfulTestResultMessage> ReadSuccessfulTestMessagesPaylo
154
179
state = ReadByte ( stream ) ;
155
180
break ;
156
181
182
+ case SuccessfulTestResultMessageFieldsId . Duration :
183
+ duration = ReadLong ( stream ) ;
184
+ break ;
185
+
157
186
case SuccessfulTestResultMessageFieldsId . Reason :
158
187
reason = ReadStringValue ( stream , fieldSize ) ;
159
188
break ;
160
189
190
+ case SuccessfulTestResultMessageFieldsId . StandardOutput :
191
+ standardOutput = ReadStringValue ( stream , fieldSize ) ;
192
+ break ;
193
+
194
+ case SuccessfulTestResultMessageFieldsId . ErrorOutput :
195
+ errorOutput = ReadStringValue ( stream , fieldSize ) ;
196
+ break ;
197
+
161
198
case SuccessfulTestResultMessageFieldsId . SessionUid :
162
199
sessionUid = ReadStringValue ( stream , fieldSize ) ;
163
200
break ;
@@ -168,7 +205,7 @@ private static List<SuccessfulTestResultMessage> ReadSuccessfulTestMessagesPaylo
168
205
}
169
206
}
170
207
171
- successfulTestResultMessages . Add ( new SuccessfulTestResultMessage ( uid , displayName , state , reason , sessionUid ) ) ;
208
+ successfulTestResultMessages . Add ( new SuccessfulTestResultMessage ( uid , displayName , state , duration , reason , standardOutput , errorOutput , sessionUid ) ) ;
172
209
}
173
210
174
211
return successfulTestResultMessages ;
@@ -181,8 +218,10 @@ private static List<FailedTestResultMessage> ReadFailedTestMessagesPayload(Strea
181
218
int length = ReadInt ( stream ) ;
182
219
for ( int i = 0 ; i < length ; i ++ )
183
220
{
184
- string ? uid = null , displayName = null , reason = null , sessionUid = null , errorMessage = null , errorStackTrace = null ;
221
+ string ? uid = null , displayName = null , reason = null , sessionUid = null ,
222
+ errorMessage = null , errorStackTrace = null , standardOutput = null , errorOutput = null ;
185
223
byte ? state = null ;
224
+ long ? duration = null ;
186
225
187
226
int fieldCount = ReadShort ( stream ) ;
188
227
@@ -205,6 +244,10 @@ private static List<FailedTestResultMessage> ReadFailedTestMessagesPayload(Strea
205
244
state = ReadByte ( stream ) ;
206
245
break ;
207
246
247
+ case FailedTestResultMessageFieldsId . Duration :
248
+ duration = ReadLong ( stream ) ;
249
+ break ;
250
+
208
251
case FailedTestResultMessageFieldsId . Reason :
209
252
reason = ReadStringValue ( stream , fieldSize ) ;
210
253
break ;
@@ -217,6 +260,14 @@ private static List<FailedTestResultMessage> ReadFailedTestMessagesPayload(Strea
217
260
errorStackTrace = ReadStringValue ( stream , fieldSize ) ;
218
261
break ;
219
262
263
+ case FailedTestResultMessageFieldsId . StandardOutput :
264
+ standardOutput = ReadStringValue ( stream , fieldSize ) ;
265
+ break ;
266
+
267
+ case FailedTestResultMessageFieldsId . ErrorOutput :
268
+ errorOutput = ReadStringValue ( stream , fieldSize ) ;
269
+ break ;
270
+
220
271
case FailedTestResultMessageFieldsId . SessionUid :
221
272
sessionUid = ReadStringValue ( stream , fieldSize ) ;
222
273
break ;
@@ -227,7 +278,7 @@ private static List<FailedTestResultMessage> ReadFailedTestMessagesPayload(Strea
227
278
}
228
279
}
229
280
230
- failedTestResultMessages . Add ( new FailedTestResultMessage ( uid , displayName , state , reason , errorMessage , errorStackTrace , sessionUid ) ) ;
281
+ failedTestResultMessages . Add ( new FailedTestResultMessage ( uid , displayName , state , duration , reason , errorMessage , errorStackTrace , standardOutput , errorOutput , sessionUid ) ) ;
231
282
}
232
283
233
284
return failedTestResultMessages ;
@@ -268,7 +319,10 @@ private static void WriteSuccessfulTestMessagesPayload(Stream stream, Successful
268
319
WriteField ( stream , SuccessfulTestResultMessageFieldsId . Uid , successfulTestResultMessage . Uid ) ;
269
320
WriteField ( stream , SuccessfulTestResultMessageFieldsId . DisplayName , successfulTestResultMessage . DisplayName ) ;
270
321
WriteField ( stream , SuccessfulTestResultMessageFieldsId . State , successfulTestResultMessage . State ) ;
322
+ WriteField ( stream , SuccessfulTestResultMessageFieldsId . Duration , successfulTestResultMessage . Duration ) ;
271
323
WriteField ( stream , SuccessfulTestResultMessageFieldsId . Reason , successfulTestResultMessage . Reason ) ;
324
+ WriteField ( stream , SuccessfulTestResultMessageFieldsId . StandardOutput , successfulTestResultMessage . StandardOutput ) ;
325
+ WriteField ( stream , SuccessfulTestResultMessageFieldsId . ErrorOutput , successfulTestResultMessage . ErrorOutput ) ;
272
326
WriteField ( stream , SuccessfulTestResultMessageFieldsId . SessionUid , successfulTestResultMessage . SessionUid ) ;
273
327
}
274
328
@@ -299,9 +353,12 @@ private static void WriteFailedTestMessagesPayload(Stream stream, FailedTestResu
299
353
WriteField ( stream , FailedTestResultMessageFieldsId . Uid , failedTestResultMessage . Uid ) ;
300
354
WriteField ( stream , FailedTestResultMessageFieldsId . DisplayName , failedTestResultMessage . DisplayName ) ;
301
355
WriteField ( stream , FailedTestResultMessageFieldsId . State , failedTestResultMessage . State ) ;
356
+ WriteField ( stream , FailedTestResultMessageFieldsId . Duration , failedTestResultMessage . Duration ) ;
302
357
WriteField ( stream , FailedTestResultMessageFieldsId . Reason , failedTestResultMessage . Reason ) ;
303
358
WriteField ( stream , FailedTestResultMessageFieldsId . ErrorMessage , failedTestResultMessage . ErrorMessage ) ;
304
359
WriteField ( stream , FailedTestResultMessageFieldsId . ErrorStackTrace , failedTestResultMessage . ErrorStackTrace ) ;
360
+ WriteField ( stream , FailedTestResultMessageFieldsId . StandardOutput , failedTestResultMessage . StandardOutput ) ;
361
+ WriteField ( stream , FailedTestResultMessageFieldsId . ErrorOutput , failedTestResultMessage . ErrorOutput ) ;
305
362
WriteField ( stream , FailedTestResultMessageFieldsId . SessionUid , failedTestResultMessage . SessionUid ) ;
306
363
}
307
364
@@ -319,16 +376,22 @@ private static ushort GetFieldCount(SuccessfulTestResultMessage successfulTestRe
319
376
( ushort ) ( ( successfulTestResultMessage . Uid is null ? 0 : 1 ) +
320
377
( successfulTestResultMessage . DisplayName is null ? 0 : 1 ) +
321
378
( successfulTestResultMessage . State is null ? 0 : 1 ) +
379
+ ( successfulTestResultMessage . Duration is null ? 0 : 1 ) +
322
380
( successfulTestResultMessage . Reason is null ? 0 : 1 ) +
381
+ ( successfulTestResultMessage . StandardOutput is null ? 0 : 1 ) +
382
+ ( successfulTestResultMessage . ErrorOutput is null ? 0 : 1 ) +
323
383
( successfulTestResultMessage . SessionUid is null ? 0 : 1 ) ) ;
324
384
325
385
private static ushort GetFieldCount ( FailedTestResultMessage failedTestResultMessage ) =>
326
386
( ushort ) ( ( failedTestResultMessage . Uid is null ? 0 : 1 ) +
327
387
( failedTestResultMessage . DisplayName is null ? 0 : 1 ) +
328
388
( failedTestResultMessage . State is null ? 0 : 1 ) +
389
+ ( failedTestResultMessage . Duration is null ? 0 : 1 ) +
329
390
( failedTestResultMessage . Reason is null ? 0 : 1 ) +
330
391
( failedTestResultMessage . ErrorMessage is null ? 0 : 1 ) +
331
392
( failedTestResultMessage . ErrorStackTrace is null ? 0 : 1 ) +
393
+ ( failedTestResultMessage . StandardOutput is null ? 0 : 1 ) +
394
+ ( failedTestResultMessage . ErrorOutput is null ? 0 : 1 ) +
332
395
( failedTestResultMessage . SessionUid is null ? 0 : 1 ) ) ;
333
396
}
334
397
}
0 commit comments