Title: [231873] trunk/Tools
Revision
231873
Author
commit-qu...@webkit.org
Date
2018-05-16 14:46:36 -0700 (Wed, 16 May 2018)

Log Message

Test262-Runner: Set timer for each test run
https://bugs.webkit.org/show_bug.cgi?id=185692

Patch by Leo Balter <leonardo.bal...@gmail.com> on 2018-05-16
Reviewed by Michael Saboff.

Sets a high resolution timer for each execution call of JSC, reporting
the time in the results report to allow identifying slow tests.
* Scripts/test262/Runner.pm:
(main):
(processFile):
(runTest):
(processResult):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (231872 => 231873)


--- trunk/Tools/ChangeLog	2018-05-16 21:23:29 UTC (rev 231872)
+++ trunk/Tools/ChangeLog	2018-05-16 21:46:36 UTC (rev 231873)
@@ -1,3 +1,18 @@
+2018-05-16  Leo Balter  <leonardo.bal...@gmail.com>
+
+        Test262-Runner: Set timer for each test run
+        https://bugs.webkit.org/show_bug.cgi?id=185692
+
+        Reviewed by Michael Saboff.
+
+        Sets a high resolution timer for each execution call of JSC, reporting
+        the time in the results report to allow identifying slow tests.
+        * Scripts/test262/Runner.pm:
+        (main):
+        (processFile):
+        (runTest):
+        (processResult):
+
 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
 
         Add support for Intl NumberFormat formatToParts

Modified: trunk/Tools/Scripts/test262/Runner.pm (231872 => 231873)


--- trunk/Tools/Scripts/test262/Runner.pm	2018-05-16 21:23:29 UTC (rev 231872)
+++ trunk/Tools/Scripts/test262/Runner.pm	2018-05-16 21:46:36 UTC (rev 231873)
@@ -41,6 +41,7 @@
 use FindBin;
 use Env qw(DYLD_FRAMEWORK_PATH);
 use Config;
+use Time::HiRes qw(time);
 
 my $podIsAvailable;
 if  (eval {require Pod::Usage; 1;}) {
@@ -397,9 +398,7 @@
 
     print $skipfilecount . " test files skipped\n";
 
-    my $endTime = time();
-    my $totalTime = $endTime - $startTime;
-    print "Done in $totalTime seconds!\n";
+    printf("Done in %.2f seconds!\n", time() - $startTime);
 
     my $totalfailures = $expect ? $newfailcount : $failcount;
     exit ($totalfailures ? 1 : 0);
@@ -512,9 +511,9 @@
     ($includesfh, $includesfile) = compileTest($includes) if defined $includes;
 
     foreach my $scenario (@scenarios) {
-        my $result = runTest($includesfile, $filename, $scenario, $data);
+        my ($result, $execTime) = runTest($includesfile, $filename, $scenario, $data);
 
-        $resultsdata = processResult($filename, $data, $scenario, $result);
+        $resultsdata = processResult($filename, $data, $scenario, $result, $execTime);
         DumpFile($resultsfh, $resultsdata);
     }
 
@@ -623,15 +622,22 @@
     $defaultHarness = $deffile if $scenario ne 'raw';
 
     my $prefix = qq(DYLD_FRAMEWORK_PATH=$DYLD_FRAMEWORK_PATH);
+
+    my $execTimeStart = time();
     my $result = qx($prefix $JSC $args $defaultHarness $includesfile '$prefixFile$filename');
+    my $execTime = time() - $execTimeStart;
 
     chomp $result;
 
-    return $result if ($?);
+    if ($?) {
+        return ($result, $execTime);
+    } else {
+        return (0, $execTime);
+    }
 }
 
 sub processResult {
-    my ($path, $data, $scenario, $result) = @_;
+    my ($path, $data, $scenario, $result, $execTime) = @_;
 
     # Report a relative path
     my $file = abs2rel( $path, $test262Dir );
@@ -638,6 +644,7 @@
     my %resultdata;
     $resultdata{path} = $file;
     $resultdata{mode} = $scenario;
+    $resultdata{time} = $execTime;
 
     my $currentfailure = parseError($result) if $result;
     my $expectedfailure = $expect
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to