Changeset 231908 in webkit


Ignore:
Timestamp:
May 17, 2018 10:07:46 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

test262/Runner.pm: look for jsc in path if cannot call webkit-build-directory
https://bugs.webkit.org/show_bug.cgi?id=185650

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

First, use jsc from CLI arg, then try to use webkit-build-directory,
if that doesn't work, look for jsc in the $PATH

  • Scripts/test262/Runner.pm:

(processCLI):
(getBuildPath):
(runTest):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r231874 r231908  
     12018-05-17  Valerie R Young  <valerie@bocoup.com>
     2
     3        test262/Runner.pm: look for jsc in path if cannot call webkit-build-directory
     4        https://bugs.webkit.org/show_bug.cgi?id=185650
     5
     6        Reviewed by Michael Saboff.
     7
     8        First, use jsc from CLI arg, then try to use webkit-build-directory,
     9        if that doesn't work, look for jsc in the $PATH
     10
     11        * Scripts/test262/Runner.pm:
     12        (processCLI):
     13        (getBuildPath):
     14        (runTest):
     15
    1162018-05-16  Leo Balter  <leonardo.balter@gmail.com>
    217
  • trunk/Tools/Scripts/test262/Runner.pm

    r231874 r231908  
    5050}
    5151
     52my $webkitdirIsAvailable;
     53if  (eval {require webkitdirs; 1;}) {
     54    webkitdirs->import(qw(executableProductDir setConfiguration));
     55    $webkitdirIsAvailable = 1;
     56}
     57
    5258my $Bin;
    5359BEGIN {
     
    234240        . "Test262 Dir: $test262Dir\n"
    235241        . "JSC: $JSC\n"
    236         . "DYLD_FRAMEWORK_PATH: $DYLD_FRAMEWORK_PATH\n"
    237242        . "Child Processes: $max_process\n";
    238243
    239244    print "Test timeout: $timeout\n" if $timeout;
     245    print "DYLD_FRAMEWORK_PATH: $DYLD_FRAMEWORK_PATH\n" if $DYLD_FRAMEWORK_PATH;
    240246    print "Features to include: " . join(', ', @features) . "\n" if @features;
    241247    print "Paths: " . join(', ', @cliTestDirs) . "\n" if @cliTestDirs;
     
    461467
    462468sub getBuildPath {
    463     my $release = shift;
    464 
    465     # Try to find JSC for user, if not supplied
    466     my $cmd = abs_path("$Bin/../webkit-build-directory");
    467     if (! -e $cmd) {
    468         die 'Error: cannot find webkit-build-directory, specify with JSC with --jsc <path>.';
    469     }
    470 
    471     if ($release) {
    472         $cmd .= ' --release';
    473     } else {
    474         $cmd .= ' --debug';
    475     }
    476     $cmd .= ' --executablePath';
    477     my $jscDir = qx($cmd);
    478     chomp $jscDir;
     469    my ($release) = @_;
    479470
    480471    my $jsc;
    481     $jsc = $jscDir . '/jsc';
    482 
    483     $jsc = $jscDir . '/JavaScriptCore.framework/Resources/jsc' if (! -e $jsc);
    484     $jsc = $jscDir . '/bin/jsc' if (! -e $jsc);
    485     if (! -e $jsc) {
    486         die 'Error: cannot find jsc, specify with --jsc <path>.';
    487     }
    488 
    489     # Sets the Env DYLD_FRAMEWORK_PATH
    490     $DYLD_FRAMEWORK_PATH = dirname($jsc);
     472
     473    if ($webkitdirIsAvailable) {
     474        my $config = $release ? 'Release' : 'Debug';
     475        setConfiguration($config);
     476        my $jscDir = executableProductDir();
     477
     478        $jsc = $jscDir . '/jsc';
     479        $jsc = $jscDir . '/JavaScriptCore.framework/Resources/jsc' if (! -e $jsc);
     480        $jsc = $jscDir . '/bin/jsc' if (! -e $jsc);
     481
     482        # Sets the Env DYLD_FRAMEWORK_PATH
     483        $DYLD_FRAMEWORK_PATH = dirname($jsc) if (-e $jsc);
     484    }
     485
     486    if (! $jsc || ! -e $jsc) {
     487        # If we cannot find jsc using webkitdirs, look in path
     488        $jsc = qx(which jsc);
     489        chomp $jsc;
     490
     491        if (! $jsc ) {
     492            die("Cannot find jsc, specify with --jsc <path>.\n\n");
     493        }
     494    }
    491495
    492496    return $jsc;
     
    629633    $defaultHarness = $deffile if $scenario ne 'raw';
    630634
    631     my $prefix = qq(DYLD_FRAMEWORK_PATH=$DYLD_FRAMEWORK_PATH);
    632 
     635    my $prefix = $DYLD_FRAMEWORK_PATH ? qq(DYLD_FRAMEWORK_PATH=$DYLD_FRAMEWORK_PATH) : "";
    633636    my $execTimeStart = time();
     637
    634638    my $result = qx($prefix $JSC $args $defaultHarness $includesfile '$prefixFile$filename');
    635639    my $execTime = time() - $execTimeStart;
Note: See TracChangeset for help on using the changeset viewer.