From 945eb1145d0a02e8bea13288733fdaef60979259 Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 27 Aug 2015 13:48:25 -0700 Subject: [PATCH] Revert change to the harness that break the unittest --- src/harness/harness.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 5cde3ad3647..ac392df513f 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1415,7 +1415,16 @@ module Harness { assert.equal(markedErrorCount, fileErrors.length, "count of errors in " + inputFile.unitName); }); - assert.equal(totalErrorsReported, diagnostics.length, "total number of errors"); + 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; + }); + + assert.equal(totalErrorsReported + numLibraryDiagnostics + numTest262HarnessDiagnostics, diagnostics.length, "total number of errors"); return minimalDiagnosticsToString(diagnostics) + Harness.IO.newLine() + Harness.IO.newLine() + outputLines.join("\r\n"); }