Changeset 232755 in webkit


Ignore:
Timestamp:
Jun 12, 2018 10:16:50 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

test262/Runner.pm: minor updates
https://bugs.webkit.org/show_bug.cgi?id=186399

  • If harness files cannot be found in a CLI supplied

test262 path, then default to webkit's test262 harness files.

  • Lazily create the test262-results directory (only right before

writing to it)

  • If an expectation file is supplied via the CLI, save to the

supplied location instead of the default webkit location
(JSTest/test262/expectation.yaml).

Patch by Valerie R Young <valerie@bocoup.com> on 2018-06-12
Reviewed by Michael Saboff.

  • Scripts/test262/Runner.pm:

(processCLI):
(main):
(compileTest):
(processResult):
(getHarness):
(summarizeResults):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r232748 r232755  
     12018-06-12  Valerie R Young  <valerie@bocoup.com>
     2
     3        test262/Runner.pm: minor updates
     4        https://bugs.webkit.org/show_bug.cgi?id=186399
     5
     6        - If harness files cannot be found in a CLI supplied
     7        test262 path, then default to webkit's test262 harness files.
     8        - Lazily create the test262-results directory (only right before
     9        writing to it)
     10       - If an expectation file is supplied via the CLI, save to the
     11        supplied location instead of the default webkit location
     12        (JSTest/test262/expectation.yaml).
     13
     14        Reviewed by Michael Saboff.
     15
     16        * Scripts/test262/Runner.pm:
     17        (processCLI):
     18        (main):
     19        (compileTest):
     20        (processResult):
     21        (getHarness):
     22        (summarizeResults):
     23
    1242018-06-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    225
     
    672695        (determineXcodeSDK): Always prefer .internal SDKs if available.
    673696        * Scripts/webkitperl/webkitdirs_unittest/availableXcodeSDKS.pl:
    674        
     697
    6756982018-06-07  Fujii Hironori  <Hironori.Fujii@sony.com>
    676699
  • trunk/Tools/Scripts/test262/Runner.pm

    r232343 r232755  
    7979my $verbose;
    8080my $JSC;
    81 my $test262Dir;
    8281my $harnessDir;
    8382my %filterFeatures;
     
    9291my $timeout;
    9392
    94 my $expectationsFile = abs_path("$Bin/../../../JSTests/test262/expectations.yaml");
    95 my $configFile = abs_path("$Bin/../../../JSTests/test262/config.yaml");
     93my $test262Dir;
     94my $webkitTest262Dir = abs_path("$Bin/../../../JSTests/test262");
     95my $expectationsFile = abs_path("$webkitTest262Dir/expectations.yaml");
     96my $configFile = abs_path("$webkitTest262Dir/config.yaml");
    9697
    9798my $resultsDir = $ENV{PWD} . "/test262-results";
    98 mkpath($resultsDir);
    99 
    100 my $resultsFile = abs_path("$resultsDir/results.yaml");
    101 my $summaryTxtFile = abs_path("$resultsDir/summary.txt");
    102 my $summaryFile = abs_path("$resultsDir/summary.yaml");
     99my $resultsFile;
     100my $summaryTxtFile;
     101my $summaryFile;
    103102
    104103my @results;
     
    107106my $tempdir = tempdir();
    108107my ($deffh, $deffile) = getTempFile();
    109 
    110 my @default_harnesses;
    111108
    112109my $startTime = time();
     
    167164    }
    168165
    169     if ($stats) {
    170         if (! -e $resultsFile) {
    171             die "Error: cannot find results file to summarize," .
     166    if ($stats || $failingOnly) {
     167        # If not supplied, try to find the results file in expected directory
     168        $resultsFile ||= abs_path("$resultsDir/results.yaml");
     169
     170        if ($failingOnly && ! -e $resultsFile) {
     171            die "Error: cannot find results file to run failing tests," .
    172172                "please specify with --results.";
    173173        }
    174         summarizeResults();
    175         exit;
    176     }
     174
     175        if ($stats) {
     176            if (! -e $resultsFile) {
     177                die "Error: cannot find results file to summarize," .
     178                    " please specify with --results.";
     179            }
     180            summarizeResults();
     181            exit;
     182        }
     183    }
     184
    177185
    178186    if ($JSC) {
     
    196204
    197205    if (! $test262Dir) {
    198         $test262Dir = abs_path("$Bin/../../../JSTests/test262");
     206        $test262Dir = $webkitTest262Dir;
    199207    } else {
    200208        $test262Dir = abs_path($test262Dir);
    201209    }
     210
    202211    $harnessDir = "$test262Dir/harness";
     212    if (! -e $harnessDir) {
     213        # if the harness directory does not exist in the custom test262 path,
     214        # then use the webkits harness directory.
     215        $harnessDir = "$webkitTest262Dir/harness";
     216    }
     217
    203218
    204219    if (! $ignoreConfig) {
     
    211226            %configSkipHash = map { $_ => 1 } @{$config->{skip}->{files}};
    212227        }
    213     }
    214 
    215     if ( $failingOnly && ! -e $resultsFile ) {
    216         die "Error: cannot find results file to run failing tests," .
    217             " please specify with --results.";
    218228    }
    219229
     
    257267}
    258268
     269
    259270sub main {
    260271    processCLI();
    261272
    262     @default_harnesses = (
     273    my @defaultHarnessFiles = (
    263274        "$harnessDir/sta.js",
    264275        "$harnessDir/assert.js",
     
    266277        "$Bin/agent.js"
    267278    );
    268     print $deffh getHarness(<@default_harnesses>);
     279
     280    print $deffh getHarness(\@defaultHarnessFiles);
    269281
    270282    # If not commandline test path supplied, use the root directory of all tests.
     
    390402
    391403    if ($runningAllTests) {
     404        if (! -e $resultsDir) {
     405            mkpath($resultsDir);
     406        }
     407        $resultsFile = abs_path("$resultsDir/results.yaml");
     408
    392409        DumpFile($resultsFile, \@results);
    393410        print "Saved all the results in $resultsFile\n";
     
    593610    my ($tfh, $tfname) = getTempFile();
    594611
    595     my $includesContent = getHarness(map { "$harnessDir/$_" } @{ $includes });
     612    my @includes = map { "$harnessDir/$_" } @{ $includes };
     613    my $includesContent = getHarness(\@includes);
    596614    print $tfh $includesContent;
    597615
     
    665683    if ($scenario ne 'skip' && $currentfailure) {
    666684
    667         # We have a new failure if we have loaded an expectation file
    668         # AND (there is no expected failure OR the failure has changed).
    669         my $isnewfailure = $expect
    670             && (!$expectedfailure || $expectedfailure ne $currentfailure);
     685        # We have a new failure if we haven't loaded an expectation file
     686        # (all fails are new) OR we have loaded an expectation fail and
     687        # (there is no expected failure OR the failure has changed).
     688        my $isnewfailure = ! $expect
     689            || !$expectedfailure || $expectedfailure ne $currentfailure;
    671690
    672691        # Print the failure if we haven't loaded an expectation file
     
    748767
    749768sub getHarness {
    750     my @files = @_;
     769    my ($filesref) = @_;
     770
    751771    my $content;
    752     for (@files) {
     772    for (@{$filesref}) {
    753773        my $file = $_;
    754774
     
    761781    };
    762782
    763     return $content;
     783    return $content || '';
    764784}
    765785
     
    771791        @results = @{$rawresults[0]};
    772792    }
     793
     794    # Create test262-results folder if it does not exits
     795    if (! -e $resultsDir) {
     796        mkpath($resultsDir);
     797    }
     798    $summaryTxtFile = abs_path("$resultsDir/summary.txt");
     799    $summaryFile = abs_path("$resultsDir/summary.yaml");
     800
    773801    my %byfeature;
    774802    my %bypath;
Note: See TracChangeset for help on using the changeset viewer.