Sort diagnostics in our baseline output.

This was we don't get noisy baselines just because a different phase of the compiler reported
the diagnostic.

This helps with Yui's refactoring work to move grammar checks into the type checker.
This commit is contained in:
Cyrus Najmabadi
2014-12-16 15:56:56 -08:00
parent adb0393458
commit f1a2e41a8a
306 changed files with 1480 additions and 1470 deletions
+10
View File
@@ -1168,7 +1168,17 @@ module Harness {
return errorOutput;
}
function compareDiagnostics(d1: HarnessDiagnostic, d2: HarnessDiagnostic) {
return ts.compareValues(d1.filename, d2.filename) ||
ts.compareValues(d1.start, d2.start) ||
ts.compareValues(d1.end, d2.end) ||
ts.compareValues(d1.code, d2.code) ||
ts.compareValues(d1.message, d2.message) ||
0;
}
export function getErrorBaseline(inputFiles: { unitName: string; content: string }[], diagnostics: HarnessDiagnostic[]) {
diagnostics.sort(compareDiagnostics);
var outputLines: string[] = [];
// Count up all the errors we find so we don't miss any