@@ -44,10 +44,10 @@ class CompilerBaselineRunner extends RunnerBase {
4444 // Everything declared here should be cleared out in the "after" callback.
4545 let justName : string ;
4646 let content : string ;
47- let testCaseContent : { settings : Harness . TestCaseParser . CompilerSetting [ ] ; testUnitData : Harness . TestCaseParser . TestUnitData [ ] ; } ;
47+ let testCaseContent : { settings : Harness . TestCaseParser . CompilerSettings ; testUnitData : Harness . TestCaseParser . TestUnitData [ ] ; } ;
4848
4949 let units : Harness . TestCaseParser . TestUnitData [ ] ;
50- let tcSettings : Harness . TestCaseParser . CompilerSetting [ ] ;
50+ let tcSettings : Harness . TestCaseParser . CompilerSettings ;
5151
5252 let lastUnit : Harness . TestCaseParser . TestUnitData ;
5353 let rootDir : string ;
@@ -61,15 +61,12 @@ class CompilerBaselineRunner extends RunnerBase {
6161 let otherFiles : { unitName : string ; content : string } [ ] ;
6262 let harnessCompiler : Harness . Compiler . HarnessCompiler ;
6363
64- let createNewInstance = false ;
65-
6664 before ( ( ) => {
6765 justName = fileName . replace ( / ^ .* [ \\ \/ ] / , "" ) ; // strips the fileName from the path.
6866 content = Harness . IO . readFile ( fileName ) ;
6967 testCaseContent = Harness . TestCaseParser . makeUnitsFromTest ( content , fileName ) ;
7068 units = testCaseContent . testUnitData ;
7169 tcSettings = testCaseContent . settings ;
72- createNewInstance = false ;
7370 lastUnit = units [ units . length - 1 ] ;
7471 rootDir = lastUnit . originalFilePath . indexOf ( "conformance" ) === - 1 ? "tests/cases/compiler/" : lastUnit . originalFilePath . substring ( 0 , lastUnit . originalFilePath . lastIndexOf ( "/" ) ) + "/" ;
7572 harnessCompiler = Harness . Compiler . getCompiler ( ) ;
@@ -100,27 +97,6 @@ class CompilerBaselineRunner extends RunnerBase {
10097 } ) ;
10198 } ) ;
10299
103- beforeEach ( ( ) => {
104- /* The compiler doesn't handle certain flags flipping during a single compilation setting. Tests on these flags will need
105- a fresh compiler instance for themselves and then create a fresh one for the next test. Would be nice to get dev fixes
106- eventually to remove this limitation. */
107- for ( let i = 0 ; i < tcSettings . length ; ++ i ) {
108- // noImplicitAny is passed to getCompiler, but target is just passed in the settings blob to setCompilerSettings
109- if ( ! createNewInstance && ( tcSettings [ i ] . flag == "noimplicitany" || tcSettings [ i ] . flag === "target" ) ) {
110- harnessCompiler = Harness . Compiler . getCompiler ( ) ;
111- harnessCompiler . setCompilerSettings ( tcSettings ) ;
112- createNewInstance = true ;
113- }
114- }
115- } ) ;
116-
117- afterEach ( ( ) => {
118- if ( createNewInstance ) {
119- harnessCompiler = Harness . Compiler . getCompiler ( ) ;
120- createNewInstance = false ;
121- }
122- } ) ;
123-
124100 after ( ( ) => {
125101 // Mocha holds onto the closure environment of the describe callback even after the test is done.
126102 // Therefore we have to clean out large objects after the test is done.
@@ -402,10 +378,6 @@ class CompilerBaselineRunner extends RunnerBase {
402378 else {
403379 this . tests . forEach ( test => this . checkTestCodeOutput ( test ) ) ;
404380 }
405-
406- describe ( "Cleanup after compiler baselines" , ( ) => {
407- let harnessCompiler = Harness . Compiler . getCompiler ( ) ;
408- } ) ;
409381 } ) ;
410382 }
411383
0 commit comments