@@ -58,16 +58,18 @@ class CompilerBaselineRunner extends RunnerBase {
5858 }
5959
6060 public checkTestCodeOutput ( fileName : string , test ?: CompilerFileBasedTest ) {
61- if ( test && test . configurations ) {
61+ if ( test && ts . some ( test . configurations ) ) {
6262 test . configurations . forEach ( configuration => {
6363 describe ( `${ this . testSuiteName } tests for ${ fileName } ${ configuration ? ` (${ Harness . getFileBasedTestConfigurationDescription ( configuration ) } )` : `` } ` , ( ) => {
6464 this . runSuite ( fileName , test , configuration ) ;
6565 } ) ;
6666 } ) ;
6767 }
68- describe ( `${ this . testSuiteName } tests for ${ fileName } ` , ( ) => {
69- this . runSuite ( fileName , test ) ;
70- } ) ;
68+ else {
69+ describe ( `${ this . testSuiteName } tests for ${ fileName } ` , ( ) => {
70+ this . runSuite ( fileName , test ) ;
71+ } ) ;
72+ }
7173 }
7274
7375 private runSuite ( fileName : string , test ?: CompilerFileBasedTest , configuration ?: Harness . FileBasedTestConfiguration ) {
@@ -112,6 +114,7 @@ class CompilerBaselineRunner extends RunnerBase {
112114class CompilerTest {
113115 private fileName : string ;
114116 private justName : string ;
117+ private configuredName : string ;
115118 private lastUnit : Harness . TestCaseParser . TestUnitData ;
116119 private harnessSettings : Harness . TestCaseParser . CompilerSettings ;
117120 private hasNonDtsFiles : boolean ;
@@ -126,6 +129,25 @@ class CompilerTest {
126129 constructor ( fileName : string , testCaseContent ?: Harness . TestCaseParser . TestCaseContent , configurationOverrides ?: Harness . TestCaseParser . CompilerSettings ) {
127130 this . fileName = fileName ;
128131 this . justName = vpath . basename ( fileName ) ;
132+ this . configuredName = this . justName ;
133+ if ( configurationOverrides ) {
134+ let configuredName = "" ;
135+ const keys = Object
136+ . keys ( configurationOverrides )
137+ . map ( k => k . toLowerCase ( ) )
138+ . sort ( ) ;
139+ for ( const key of keys ) {
140+ if ( configuredName ) {
141+ configuredName += "," ;
142+ }
143+ configuredName += `${ key } =${ configurationOverrides [ key ] . toLowerCase ( ) } ` ;
144+ }
145+ if ( configuredName ) {
146+ const extname = vpath . extname ( this . justName ) ;
147+ const basename = vpath . basename ( this . justName , extname , /*ignoreCase*/ true ) ;
148+ this . configuredName = `${ basename } (${ configuredName } )${ extname } ` ;
149+ }
150+ }
129151
130152 const rootDir = fileName . indexOf ( "conformance" ) === - 1 ? "tests/cases/compiler/" : ts . getDirectoryPath ( fileName ) + "/" ;
131153
@@ -205,15 +227,15 @@ class CompilerTest {
205227 public verifyDiagnostics ( ) {
206228 // check errors
207229 Harness . Compiler . doErrorBaseline (
208- this . justName ,
230+ this . configuredName ,
209231 this . tsConfigFiles . concat ( this . toBeCompiled , this . otherFiles ) ,
210232 this . result . diagnostics ,
211233 ! ! this . options . pretty ) ;
212234 }
213235
214236 public verifyModuleResolution ( ) {
215237 if ( this . options . traceResolution ) {
216- Harness . Baseline . runBaseline ( this . justName . replace ( / \. t s x ? $ / , ".trace.json" ) ,
238+ Harness . Baseline . runBaseline ( this . configuredName . replace ( / \. t s x ? $ / , ".trace.json" ) ,
217239 JSON . stringify ( this . result . traces . map ( utils . sanitizeTraceResolutionLogEntry ) , undefined , 4 ) ) ;
218240 }
219241 }
@@ -225,14 +247,14 @@ class CompilerTest {
225247 // Because of the noEmitOnError option no files are created. We need to return null because baselining isn't required.
226248 ? null // tslint:disable-line no-null-keyword
227249 : record ;
228- Harness . Baseline . runBaseline ( this . justName . replace ( / \. t s x ? $ / , ".sourcemap.txt" ) , baseline ) ;
250+ Harness . Baseline . runBaseline ( this . configuredName . replace ( / \. t s x ? $ / , ".sourcemap.txt" ) , baseline ) ;
229251 }
230252 }
231253
232254 public verifyJavaScriptOutput ( ) {
233255 if ( this . hasNonDtsFiles ) {
234256 Harness . Compiler . doJsEmitBaseline (
235- this . justName ,
257+ this . configuredName ,
236258 this . fileName ,
237259 this . options ,
238260 this . result ,
@@ -245,7 +267,7 @@ class CompilerTest {
245267
246268 public verifySourceMapOutput ( ) {
247269 Harness . Compiler . doSourcemapBaseline (
248- this . justName ,
270+ this . configuredName ,
249271 this . options ,
250272 this . result ,
251273 this . harnessSettings ) ;
@@ -256,8 +278,15 @@ class CompilerTest {
256278 return ;
257279 }
258280
281+ const noTypesAndSymbols =
282+ this . harnessSettings . noTypesAndSymbols &&
283+ this . harnessSettings . noTypesAndSymbols . toLowerCase ( ) === "true" ;
284+ if ( noTypesAndSymbols ) {
285+ return ;
286+ }
287+
259288 Harness . Compiler . doTypeAndSymbolBaseline (
260- this . justName ,
289+ this . configuredName ,
261290 this . result . program ! ,
262291 this . toBeCompiled . concat ( this . otherFiles ) . filter ( file => ! ! this . result . program ! . getSourceFile ( file . unitName ) ) ,
263292 /*opts*/ undefined ,
0 commit comments