Changeset 231873 in webkit


Ignore:
Timestamp:
May 16, 2018 2:46:36 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Leo Balter <Leo Balter> 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):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r231867 r231873  
     12018-05-16  Leo Balter  <leonardo.balter@gmail.com>
     2
     3        Test262-Runner: Set timer for each test run
     4        https://bugs.webkit.org/show_bug.cgi?id=185692
     5
     6        Reviewed by Michael Saboff.
     7
     8        Sets a high resolution timer for each execution call of JSC, reporting
     9        the time in the results report to allow identifying slow tests.
     10        * Scripts/test262/Runner.pm:
     11        (main):
     12        (processFile):
     13        (runTest):
     14        (processResult):
     15
    1162018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
    217
  • trunk/Tools/Scripts/test262/Runner.pm

    r231848 r231873  
    4242use Env qw(DYLD_FRAMEWORK_PATH);
    4343use Config;
     44use Time::HiRes qw(time);
    4445
    4546my $podIsAvailable;
     
    398399    print $skipfilecount . " test files skipped\n";
    399400
    400     my $endTime = time();
    401     my $totalTime = $endTime - $startTime;
    402     print "Done in $totalTime seconds!\n";
     401    printf("Done in %.2f seconds!\n", time() - $startTime);
    403402
    404403    my $totalfailures = $expect ? $newfailcount : $failcount;
     
    513512
    514513    foreach my $scenario (@scenarios) {
    515         my $result = runTest($includesfile, $filename, $scenario, $data);
    516 
    517         $resultsdata = processResult($filename, $data, $scenario, $result);
     514        my ($result, $execTime) = runTest($includesfile, $filename, $scenario, $data);
     515
     516        $resultsdata = processResult($filename, $data, $scenario, $result, $execTime);
    518517        DumpFile($resultsfh, $resultsdata);
    519518    }
     
    624623
    625624    my $prefix = qq(DYLD_FRAMEWORK_PATH=$DYLD_FRAMEWORK_PATH);
     625
     626    my $execTimeStart = time();
    626627    my $result = qx($prefix $JSC $args $defaultHarness $includesfile '$prefixFile$filename');
     628    my $execTime = time() - $execTimeStart;
    627629
    628630    chomp $result;
    629631
    630     return $result if ($?);
     632    if ($?) {
     633        return ($result, $execTime);
     634    } else {
     635        return (0, $execTime);
     636    }
    631637}
    632638
    633639sub processResult {
    634     my ($path, $data, $scenario, $result) = @_;
     640    my ($path, $data, $scenario, $result, $execTime) = @_;
    635641
    636642    # Report a relative path
     
    639645    $resultdata{path} = $file;
    640646    $resultdata{mode} = $scenario;
     647    $resultdata{time} = $execTime;
    641648
    642649    my $currentfailure = parseError($result) if $result;
Note: See TracChangeset for help on using the changeset viewer.