Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/harness/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1399,18 +1399,7 @@ module Harness {
assert.equal(markedErrorCount, fileErrors.length, "count of errors in " + inputFile.unitName);
});

let numLibraryDiagnostics = ts.countWhere(diagnostics, diagnostic => {
return diagnostic.file && (isLibraryFile(diagnostic.file.fileName) || isBuiltFile(diagnostic.file.fileName));
});

let numTest262HarnessDiagnostics = ts.countWhere(diagnostics, diagnostic => {
// Count an error generated from tests262-harness folder.This should only apply for test262
return diagnostic.file && diagnostic.file.fileName.indexOf("test262-harness") >= 0;
});

// Verify we didn't miss any errors in total
assert.equal(totalErrorsReported + numLibraryDiagnostics + numTest262HarnessDiagnostics, diagnostics.length, "total number of errors");

assert.equal(totalErrorsReported, diagnostics.length, "total number of errors");
return minimalDiagnosticsToString(diagnostics) +
Harness.IO.newLine() + Harness.IO.newLine() + outputLines.join("\r\n");
}
Expand Down
13 changes: 10 additions & 3 deletions src/harness/rwcRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module RWC {
}
}

let defaultLibPath = ts.sys.resolvePath("built/local/lib.d.ts");
let defaultLib = {
unitName: ts.normalizePath(defaultLibPath),
content: Harness.IO.readFile(defaultLibPath)
};

export function runRWCTest(jsonPath: string) {
describe("Testing a RWC project: " + jsonPath, () => {
let inputFiles: { unitName: string; content: string; }[] = [];
Expand Down Expand Up @@ -65,6 +71,10 @@ module RWC {
opts.options.noEmitOnError = false;
});

if (!useCustomLibraryFile) {
inputFiles.push(defaultLib);
}

runWithIOLog(ioLog, () => {
harnessCompiler.reset();

Expand Down Expand Up @@ -96,9 +106,6 @@ module RWC {
if (useCustomLibraryFile) {
inputFiles.push(getHarnessCompilerInputUnit(fileRead.path));
}
else {
inputFiles.push(Harness.getDefaultLibraryFile());
}
}
}
}
Expand Down