WebKit Bugzilla
Attachment 342975 Details for
Bug 186790
: [test262-runner] Print results report to HTML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186790-20180618175635.patch (text/plain), 6.00 KB, created by
Leo Balter
on 2018-06-18 14:56:36 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Leo Balter
Created:
2018-06-18 14:56:36 PDT
Size:
6.00 KB
patch
obsolete
>Subversion Revision: 232942 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index c65cefb4ea40db1a17ede7ec78bb8a539d46280e..2599824eb899ed97c4397a56f5dfcecff96106a3 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,16 @@ >+2018-06-18 Leo Balter <leonardo.balter@gmail.com> >+ >+ [test262-runner] Print results report to HTML >+ https://bugs.webkit.org/show_bug.cgi?id=186790 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WIP >+ * Scripts/test262/Runner.pm: >+ (main): >+ (summarizeResults): >+ (printHTML): >+ > 2018-06-18 Zan Dobersek <zdobersek@igalia.com> > > [webkitpy] WPTRunner should remove any metadata content before (re)generating it >diff --git a/Tools/Scripts/test262/Runner.pm b/Tools/Scripts/test262/Runner.pm >index 7c73d5f1035a8a40f3ed7a4df09f0f12b47d0da5..58dda3595350a157a5d8429bbf1db3d38dbd9bee 100755 >--- a/Tools/Scripts/test262/Runner.pm >+++ b/Tools/Scripts/test262/Runner.pm >@@ -478,6 +478,8 @@ sub main { > > printf("Done in %.2f seconds!\n", time() - $startTime); > >+ printHTML(\%failed, $total, $failcount, $newfailcount, $skipfilecount); >+ > my $totalfailures = $expect ? $newfailcount : $failcount; > exit ($totalfailures ? 1 : 0); > } >@@ -860,6 +862,7 @@ sub summarizeResults { > } > $summaryTxtFile = abs_path("$resultsDir/summary.txt"); > $summaryFile = abs_path("$resultsDir/summary.yaml"); >+ my $summaryHTMLFile = abs_path("$resultsDir/summary.html"); > > my %byfeature; > my %bypath; >@@ -916,8 +919,17 @@ sub summarizeResults { > } > > open(my $sfh, '>', $summaryTxtFile) or die $!; >+ open(my $htmlfh, '>', $summaryHTMLFile) or die $!; >+ >+ print $htmlfh qq{<html><head> >+ <title>Test262 Results</title> >+ </head> >+ <body> >+ <table><thead> >+ <th>Folder</th><th>%</th><th>Total</th><th>Ran</th><th>pass</th><th>fail</th><th>skip</th><th>Time</th><th>Average</th> >+ </thead><tbody>}; > >- print $sfh sprintf("%-6s %-6s %-6s %-6s %-6s %-6s %-7s %-6s %s\n", 'TOTAL', 'RAN', 'PASS-%', 'PASS', 'FAIL', 'SKIP', 'TIME', 'AVG', 'FOLDER'); >+ print $sfh sprintf("%-6s %-6s %-6s %-6s %-6s %-6s %-7s %-6s %s\n", 'TOTAL', 'RAN', 'PASS-%', 'PASS', 'FAIL', 'SKIP', 'TIME', 'AVG', 'FOLDER'); > foreach my $key (sort keys %bypath) { > my $totalFilesRan = $bypath{$key}->[0] + $bypath{$key}->[1]; > my $totalFiles = $totalFilesRan + $bypath{$key}->[2]; >@@ -943,11 +955,28 @@ sub summarizeResults { > $time, > $avgTime, > $key); >+ >+ print $htmlfh sprintf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>", >+ $key, >+ $per, >+ $totalFiles, >+ $totalFilesRan, >+ $bypath{$key}->[0], >+ $bypath{$key}->[1], >+ $bypath{$key}->[2], >+ $time, >+ $avgTime); > } > >+ print $htmlfh qq{</tbody></table>}; >+ > print $sfh "\n\n"; > print $sfh sprintf("%-6s %-6s %-6s %-6s %-6s %-6s %-7s %-6s %s\n", 'TOTAL', 'RAN', 'PASS-%', 'PASS', 'FAIL', 'SKIP', 'TIME', 'AVG', 'FEATURE'); > >+ print $htmlfh qq{<table><thead> >+ <th>Feature</th><th>%</th><th>Total</th><th>Ran</th><th>pass</th><th>fail</th><th>skip</th><th>Time</th><th>Average</th> >+ </thead><tbody>}; >+ > foreach my $key (sort keys %byfeature) { > my $totalFilesRan = $byfeature{$key}->[0] + $byfeature{$key}->[1]; > my $totalFiles = $totalFilesRan + $byfeature{$key}->[2]; >@@ -973,9 +1002,25 @@ sub summarizeResults { > $time, > $avgTime, > $key); >+ >+ print $htmlfh sprintf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>", >+ $key, >+ $per, >+ $totalFiles, >+ $totalFilesRan, >+ $byfeature{$key}->[0], >+ $byfeature{$key}->[1], >+ $byfeature{$key}->[2], >+ $time, >+ $avgTime); > } > >+ print $htmlfh qq{</tbody></table> >+ <div>Visit <a href="index.html">the index</a> for a report of failures.</div> >+ </body></html>}; >+ > close($sfh); >+ close($htmlfh); > > my %resultsyaml = ( > byFolder => \%bypath, >@@ -1001,6 +1046,50 @@ sub findAllFailing { > @files = map { qq($test262Dir/$_) } keys %filedictionary; > } > >+sub printHTML { >+ my %failed = %{shift()}; >+ my ($total, $failcount, $newfailcount, $skipcount) = @_; >+ >+ # Create test262-results folder if it does not exits >+ if (! -e $resultsDir) { >+ mkpath($resultsDir); >+ } >+ my $indexHTML = abs_path("$resultsDir/index.html"); >+ open(my $htmlfh, '>', $indexHTML) or die $!; >+ >+ print $htmlfh qq{<html><head> >+ <title>Test262 Results</title> >+ </head> >+ <body>}; >+ >+ print $htmlfh qq{<h2>Stats</h2><ul>}; >+ >+ { >+ my $failedFiles = scalar (keys %failed); >+ my $totalPlus = $total + $skipcount; >+ print $htmlfh qq{ >+ <li>$total test files ran out of $totalPlus files, $skipcount skipped test files</li> >+ <li>$failcount failures from $failedFiles distinct files, $newfailcount new failures</li> >+ }; >+ } >+ >+ print $htmlfh qq{</ul><h2>Failures</h2><ul>}; >+ >+ while (my ($path, $scenarios) = each %failed) { >+ print $htmlfh qq{<li>$path<ul>}; >+ while (my ($scenario, $value) = each %{$scenarios}) { >+ print $htmlfh qq{<li>$scenario: $value</li>}; >+ } >+ print $htmlfh qq{</ul></li>} >+ } >+ >+ print $htmlfh qq{</ul> >+ <div>Visit <a href="summary.html">the summary</a> for statistics.</div> >+ </body></html>}; >+ >+ close $htmlfh; >+} >+ > __END__ > > =head1 DESCRIPTION
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186790
:
342975
|
342994
|
343103
|
343109