Emit the error file contents and highlight it to show errors for rwc errors

This commit is contained in:
Sheetal Nandi 2014-08-20 15:44:52 -07:00
parent 58fca3773f
commit 3d5f692c0a

View file

@ -59,13 +59,14 @@ module RWC {
}); });
}); });
var inputFiles: { unitName: string; content: string; }[] = [];
var otherFiles: { unitName: string; content: string; }[] = [];
var compilerResult: Harness.Compiler.CompilerResult; var compilerResult: Harness.Compiler.CompilerResult;
it('can compile', () => { it('can compile', () => {
runWithIOLog(ioLog, () => { runWithIOLog(ioLog, () => {
harnessCompiler.reset(); harnessCompiler.reset();
// Load the files // Load the files
var inputFiles: { unitName: string; content: string; }[] = [];
ts.forEach(opts.filenames, fileName => { ts.forEach(opts.filenames, fileName => {
inputFiles.push(getHarnessCompilerInputUnit(fileName)); inputFiles.push(getHarnessCompilerInputUnit(fileName));
}); });
@ -78,7 +79,6 @@ module RWC {
} }
} }
var otherFiles: { unitName: string; content: string; }[] = [];
ts.forEach(ioLog.filesRead, fileRead => { ts.forEach(ioLog.filesRead, fileRead => {
var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(fileRead.path)); var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(fileRead.path));
var inInputList = ts.forEach(inputFiles, inputFile=> inputFile.unitName === resolvedPath); var inInputList = ts.forEach(inputFiles, inputFile=> inputFile.unitName === resolvedPath);
@ -144,7 +144,9 @@ module RWC {
return null; return null;
} }
return Harness.Compiler.minimalDiagnosticsToString(compilerResult.errors); return Harness.Compiler.minimalDiagnosticsToString(compilerResult.errors) +
sys.newLine + sys.newLine +
Harness.Compiler.getErrorBaseline(inputFiles.concat(otherFiles), compilerResult.errors);
}, false, baselineOpts); }, false, baselineOpts);
}); });