From ad18bde92bbe4307f0a2b245cc0ecd0f89fcf671 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 7 Nov 2017 15:43:55 -0800 Subject: [PATCH 1/2] RWC:Handle lib entries in tsconfig --- src/harness/harness.ts | 4 ++-- src/harness/rwcRunner.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index abec41ea4a..338ca6bb08 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(io: Harness.Io): Harness.Compiler.TestFile { - const libFile = Harness.userSpecifiedRoot + Harness.libFolder + Harness.Compiler.defaultLibFileName; + export function getDefaultLibraryFile(libPath: string, io: Harness.Io): Harness.Compiler.TestFile { + const libFile = Harness.userSpecifiedRoot + Harness.libFolder + libPath.slice(io.directoryName(libPath).length + 1); return { unitName: libFile, content: io.readFile(libFile) }; } diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index af6e8c95c5..5613848b8e 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -131,7 +131,7 @@ namespace RWC { } else { // set the flag to put default library to the beginning of the list - inputFiles.unshift(Harness.getDefaultLibraryFile(oldIO)); + inputFiles.unshift(Harness.getDefaultLibraryFile(fileRead.path, oldIO)); } } } 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 2/2] 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 338ca6bb08..8a3202b88b 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 5613848b8e..ef7a371b0c 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