Merge pull request #4488 from Microsoft/fixRWC

Move RWC runner to use Harness.IO instead of sys
This commit is contained in:
Vladimir Matveev
2015-08-27 18:16:22 -07:00
parent 28212441d9
commit be8f17c5d7
4 changed files with 73 additions and 52 deletions

View File

@@ -274,7 +274,7 @@ namespace ts {
return optionNameMapCache;
}
export function parseCommandLine(commandLine: string[]): ParsedCommandLine {
export function parseCommandLine(commandLine: string[], readFile?: (path: string) => string): ParsedCommandLine {
let options: CompilerOptions = {};
let fileNames: string[] = [];
let errors: Diagnostic[] = [];
@@ -343,7 +343,7 @@ namespace ts {
}
function parseResponseFile(fileName: string) {
let text = sys.readFile(fileName);
let text = readFile ? readFile(fileName) : sys.readFile(fileName);
if (!text) {
errors.push(createCompilerDiagnostic(Diagnostics.File_0_not_found, fileName));
@@ -496,4 +496,4 @@ namespace ts {
return fileNames;
}
}
}
}