From 4e4f7507d09699f26b3884254e208d1e7966442f Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 7 Nov 2017 16:08:57 -0800 Subject: [PATCH] Fix getDefaultLibraryFile + turn off lib 1. getDefaultLibraryFile should use ts to normalise the file and find the filename. 2. lib should be turned off at the same time that noLib is turned on to avoid a pointless error. --- src/harness/harness.ts | 4 ++-- src/harness/rwcRunner.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 338ca6bb087..8a3202b88be 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -2146,8 +2146,8 @@ namespace Harness { return filePath.indexOf(Harness.libFolder) === 0; } - export function getDefaultLibraryFile(libPath: string, io: Harness.Io): Harness.Compiler.TestFile { - const libFile = Harness.userSpecifiedRoot + Harness.libFolder + libPath.slice(io.directoryName(libPath).length + 1); + export function getDefaultLibraryFile(filePath: string, io: Harness.Io): Harness.Compiler.TestFile { + const libFile = Harness.userSpecifiedRoot + Harness.libFolder + ts.getBaseFileName(ts.normalizeSlashes(filePath)); return { unitName: libFile, content: io.readFile(libFile) }; } diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index 5613848b8e0..ef7a371b0c4 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -138,6 +138,7 @@ namespace RWC { } // do not use lib since we already read it in above + opts.options.lib = undefined; opts.options.noLib = true; // Emit the results