@@ -13,8 +13,23 @@ import { IRunTestContext, TestKind, TestLevel, TestResultState } from '../../jav
1313
1414export class JUnitRunnerResultAnalyzer extends RunnerResultAnalyzer {
1515
16- private static readonly CONTROL_FRAME_PREFIX : RegExp = / ^ % [ A - Z ] + (?: \d + ) ? (?: \s | , | ; ) / ;
17- private static readonly NUMERIC_CONTROL_FRAME : RegExp = / ^ % [ A - Z ] + \d + $ / ;
16+ private static readonly CONTROL_MESSAGE_PREFIXES : string [ ] = [
17+ '%TSTTREE' ,
18+ '%TESTS' ,
19+ '%TESTE' ,
20+ '%FAILED' ,
21+ '%ERROR' ,
22+ '%EXPECTS' ,
23+ '%EXPECTE' ,
24+ '%ACTUALS' ,
25+ '%ACTUALE' ,
26+ '%TRACES' ,
27+ '%TRACEE' ,
28+ '%TESTC' ,
29+ '%RUNTIME' ,
30+ '%MENTER' ,
31+ '%MEXIT' ,
32+ ] ;
1833
1934 private testOutputMapping : Map < string , ITestInfo > = new Map ( ) ;
2035 private triggeredTestsMapping : Map < string , TestItem > = new Map ( ) ;
@@ -71,25 +86,11 @@ export class JUnitRunnerResultAnalyzer extends RunnerResultAnalyzer {
7186
7287 /**
7388 * Whether the given line is an Eclipse RemoteTestRunner control message.
74- * Control messages start with '%' followed by an upper-case message id,
75- * an optional index, and either a protocol separator (whitespace, comma, or semicolon)
76- * or the end of the line for numeric-suffixed frames such as "%RUNTIME15".
77- * Some payload delimiters, such as "%TRACES", are bare control frames with no suffix.
78- * This avoids dropping legitimate output such as "%OK".
89+ * Only known protocol frame prefixes are filtered so user output that merely starts
90+ * with '%' (for example, "%OK" or "%STATUS 200") remains visible.
7991 */
8092 private isControlMessage ( line : string ) : boolean {
81- return JUnitRunnerResultAnalyzer . CONTROL_FRAME_PREFIX . test ( line )
82- || JUnitRunnerResultAnalyzer . NUMERIC_CONTROL_FRAME . test ( line )
83- || this . isBareControlMessage ( line ) ;
84- }
85-
86- private isBareControlMessage ( line : string ) : boolean {
87- return line === MessageId . ExpectStart
88- || line === MessageId . ExpectEnd
89- || line === MessageId . ActualStart
90- || line === MessageId . ActualEnd
91- || line === MessageId . TraceStart
92- || line === MessageId . TraceEnd ;
93+ return JUnitRunnerResultAnalyzer . CONTROL_MESSAGE_PREFIXES . some ( ( prefix : string ) => line . startsWith ( prefix ) ) ;
9394 }
9495
9596 public processData ( data : string ) : void {
0 commit comments