diff options
Diffstat (limited to 'tools/wpt.ts')
-rwxr-xr-x | tools/wpt.ts | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/tools/wpt.ts b/tools/wpt.ts index 203b198d1..e6f08dd34 100755 --- a/tools/wpt.ts +++ b/tools/wpt.ts @@ -349,8 +349,14 @@ function reportFinal( let finalExpectedFailedAndFailedCount = 0; const finalExpectedFailedButPassedTests: [string, TestCaseResult][] = []; const finalExpectedFailedButPassedFiles: string[] = []; + const finalFailedFiles: string[] = []; for (const { test, result } of results) { - const { failed, failedCount, expectedFailedButPassed } = analyzeTestResult( + const { + failed, + failedCount, + expectedFailedButPassed, + expectedFailedAndFailedCount, + } = analyzeTestResult( result, test.expectation, ); @@ -359,7 +365,7 @@ function reportFinal( finalExpectedFailedAndFailedCount += 1; } else { finalFailedCount += 1; - finalExpectedFailedButPassedFiles.push(test.path); + finalFailedFiles.push(test.path); } } else if (failedCount > 0) { finalFailedCount += 1; @@ -369,6 +375,11 @@ function reportFinal( for (const case_ of expectedFailedButPassed) { finalExpectedFailedButPassedTests.push([test.path, case_]); } + } else if ( + test.expectation === false && + expectedFailedAndFailedCount != result.cases.length + ) { + finalExpectedFailedButPassedFiles.push(test.path); } } const finalPassedCount = finalTotalCount - finalFailedCount; @@ -383,6 +394,14 @@ function reportFinal( ` ${JSON.stringify(`${result[0]} - ${result[1].name}`)}`, ); } + if (finalFailedFiles.length > 0) { + console.log(`\nfile failures:\n`); + } + for (const result of finalFailedFiles) { + console.log( + ` ${JSON.stringify(result)}`, + ); + } if (finalExpectedFailedButPassedTests.length > 0) { console.log(`\nexpected test failures that passed:\n`); } @@ -398,13 +417,16 @@ function reportFinal( console.log(` ${JSON.stringify(result)}`); } + const failed = (finalFailedCount > 0) || + (finalExpectedFailedButPassedFiles.length > 0); + console.log( `\nfinal result: ${ - finalFailedCount > 0 ? red("failed") : green("ok") + failed ? red("failed") : green("ok") }. ${finalPassedCount} passed; ${finalFailedCount} failed; ${finalExpectedFailedAndFailedCount} expected failure; total ${finalTotalCount}\n`, ); - return finalFailedCount > 0 ? 1 : 0; + return failed ? 1 : 0; } function analyzeTestResult( @@ -475,7 +497,7 @@ function reportVariation(result: TestResult, expectation: boolean | string[]) { console.log(`\n${result.name}\n${result.message}\n${result.stack}`); } - if (failed.length > 0) { + if (failedCount > 0) { console.log(`\nfailures:\n`); } for (const result of failed) { |