From 014137b544388bc06a25674d0284640260705672 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 20 Aug 2015 00:41:35 -0700 Subject: [PATCH] remove unused createNewInstance support --- src/harness/compilerRunner.ts | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 87e22e08cfa..a24ed30ae14 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -44,10 +44,10 @@ class CompilerBaselineRunner extends RunnerBase { // Everything declared here should be cleared out in the "after" callback. let justName: string; let content: string; - let testCaseContent: { settings: Harness.TestCaseParser.CompilerSetting[]; testUnitData: Harness.TestCaseParser.TestUnitData[]; }; + let testCaseContent: { settings: Harness.TestCaseParser.CompilerSettings; testUnitData: Harness.TestCaseParser.TestUnitData[]; }; let units: Harness.TestCaseParser.TestUnitData[]; - let tcSettings: Harness.TestCaseParser.CompilerSetting[]; + let tcSettings: Harness.TestCaseParser.CompilerSettings; let lastUnit: Harness.TestCaseParser.TestUnitData; let rootDir: string; @@ -61,15 +61,12 @@ class CompilerBaselineRunner extends RunnerBase { let otherFiles: { unitName: string; content: string }[]; let harnessCompiler: Harness.Compiler.HarnessCompiler; - let createNewInstance = false; - before(() => { justName = fileName.replace(/^.*[\\\/]/, ""); // strips the fileName from the path. content = Harness.IO.readFile(fileName); testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName); units = testCaseContent.testUnitData; tcSettings = testCaseContent.settings; - createNewInstance = false; lastUnit = units[units.length - 1]; rootDir = lastUnit.originalFilePath.indexOf("conformance") === -1 ? "tests/cases/compiler/" : lastUnit.originalFilePath.substring(0, lastUnit.originalFilePath.lastIndexOf("/")) + "/"; harnessCompiler = Harness.Compiler.getCompiler(); @@ -100,27 +97,6 @@ class CompilerBaselineRunner extends RunnerBase { }); }); - beforeEach(() => { - /* The compiler doesn't handle certain flags flipping during a single compilation setting. Tests on these flags will need - a fresh compiler instance for themselves and then create a fresh one for the next test. Would be nice to get dev fixes - eventually to remove this limitation. */ - for (let i = 0; i < tcSettings.length; ++i) { - // noImplicitAny is passed to getCompiler, but target is just passed in the settings blob to setCompilerSettings - if (!createNewInstance && (tcSettings[i].flag == "noimplicitany" || tcSettings[i].flag === "target")) { - harnessCompiler = Harness.Compiler.getCompiler(); - harnessCompiler.setCompilerSettings(tcSettings); - createNewInstance = true; - } - } - }); - - afterEach(() => { - if (createNewInstance) { - harnessCompiler = Harness.Compiler.getCompiler(); - createNewInstance = false; - } - }); - after(() => { // Mocha holds onto the closure environment of the describe callback even after the test is done. // Therefore we have to clean out large objects after the test is done. @@ -402,10 +378,6 @@ class CompilerBaselineRunner extends RunnerBase { else { this.tests.forEach(test => this.checkTestCodeOutput(test)); } - - describe("Cleanup after compiler baselines", () => { - let harnessCompiler = Harness.Compiler.getCompiler(); - }); }); }