Changeset 219965 in webkit


Ignore:
Timestamp:
Jul 26, 2017, 3:15:21 PM (8 years ago)
Author:
mark.lam@apple.com
Message:

Make run-javascriptcore-test run testair, testb3, and testmasm.
https://bugs.webkit.org/show_bug.cgi?id=174837
<rdar://problem/33522927>

Reviewed by Saam Barati and Filip Pizlo.

  1. Refactors code for running testapi so that we can use it to run other tests.
  2. Added running of testmasm, testair, testb3.

Note: the existing testapi invocation code does not support remote invocation of
the tests (e.g. on a ARM device). Hence, the new additions of testmasm, testair,
and testb3 also do not support remote invocation. If we wish to add remote
invocation support, we should do that in a separate patch.

  • Scripts/run-javascriptcore-tests:

(testPath):
(runTest):
(testapiPath): Deleted.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r219963 r219965  
     12017-07-26  Mark Lam  <mark.lam@apple.com>
     2
     3        Make run-javascriptcore-test run testair, testb3, and testmasm.
     4        https://bugs.webkit.org/show_bug.cgi?id=174837
     5        <rdar://problem/33522927>
     6
     7        Reviewed by Saam Barati and Filip Pizlo.
     8
     9        1. Refactors code for running testapi so that we can use it to run other tests.
     10        2. Added running of testmasm, testair, testb3.
     11
     12        Note: the existing testapi invocation code does not support remote invocation of
     13        the tests (e.g. on a ARM device).  Hence, the new additions of testmasm, testair,
     14        and testb3 also do not support remote invocation.  If we wish to add remote
     15        invocation support, we should do that in a separate patch.
     16
     17        * Scripts/run-javascriptcore-tests:
     18        (testPath):
     19        (runTest):
     20        (testapiPath): Deleted.
     21
    1222017-07-26  Aakash Jain  <aakash_jain@apple.com>
    223
  • trunk/Tools/Scripts/run-javascriptcore-tests

    r217605 r219965  
    11#!/usr/bin/perl -w
    22
    3 # Copyright (C) 2005, 2013-2016 Apple Inc.  All rights reserved.
     3# Copyright (C) 2005, 2013-2017 Apple Inc.  All rights reserved.
    44# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
    55#
     
    5757my $buildJSC = 1;
    5858
     59my $runTestMasm = 1;
     60my $runTestAir = 1;
     61my $runTestB3 = 1;
    5962my $runTestAPI = 1;
    6063
     
    7578my $jsonFileName;
    7679
     80if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTMASM}) {
     81    if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTMASM} eq "true") {
     82        $runTestMasm = 1;
     83    } elsif ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTMASM} eq "false") {
     84        $runTestMasm = 0;
     85    } else {
     86        print "Don't recognize value for RUN_JAVASCRIPTCORE_TESTS_TESTMASM environment variable: '"
     87            . $ENV{RUN_JAVASCRIPTCORE_TESTS_TESTMASM} . "'. Should be set to 'true' or 'false'.\n";
     88    }
     89}
     90
     91if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAIR}) {
     92    if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAIR} eq "true") {
     93        $runTestAir = 1;
     94    } elsif ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAIR} eq "false") {
     95        $runTestAir = 0;
     96    } else {
     97        print "Don't recognize value for RUN_JAVASCRIPTCORE_TESTS_TESTAIR environment variable: '"
     98            . $ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAIR} . "'. Should be set to 'true' or 'false'.\n";
     99    }
     100}
     101
     102if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTB3}) {
     103    if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTB3} eq "true") {
     104        $runTestB3 = 1;
     105    } elsif ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTB3} eq "false") {
     106        $runTestB3 = 0;
     107    } else {
     108        print "Don't recognize value for RUN_JAVASCRIPTCORE_TESTS_TESTB3 environment variable: '"
     109            . $ENV{RUN_JAVASCRIPTCORE_TESTS_TESTB3} . "'. Should be set to 'true' or 'false'.\n";
     110    }
     111}
     112
    77113if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAPI}) {
    78114    if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAPI} eq "true") {
     
    103139my $programName = basename($0);
    104140my $buildJSCDefault = $buildJSC ? "will check" : "will not check";
     141my $testmasmDefault = $runTestMasm ? "will run" : "will not run";
     142my $testairDefault = $runTestAir ? "will run" : "will not run";
     143my $testb3Default = $runTestB3 ? "will run" : "will not run";
    105144my $testapiDefault = $runTestAPI ? "will run" : "will not run";
    106145my $jscStressDefault = $runJSCStress ? "will run" : " will not run";
     
    116155  --[no-]ftl-jit                Turn the FTL JIT on or off
    117156  --[no-]build                  Check (or don't check) to see if the jsc build is up-to-date (default: $buildJSCDefault)
     157  --[no-]testmasm               Run (or don't run) testmasm (default: $testmasmDefault)
     158  --[no-]testair                Run (or don't run) testair (default: $testairDefault)
     159  --[no-]testb3                 Run (or don't run) testb3 (default: $testb3Default)
    118160  --[no-]testapi                Run (or don't run) testapi (default: $testapiDefault)
    119161  --[no-]jsc-stress             Run (or don't run) the JSC stress tests (default: $jscStressDefault)
     
    146188
    147189Environment Variables:
     190  - set RUN_JAVASCRIPTCORE_TESTS_TESTMASM to "true" or "false" (no quotes) to determine if we run the testmasm tests.
     191  - set RUN_JAVASCRIPTCORE_TESTS_TESTAIR to "true" or "false" (no quotes) to determine if we run the testair tests.
     192  - set RUN_JAVASCRIPTCORE_TESTS_TESTB3 to "true" or "false" (no quotes) to determine if we run the testb3 tests.
    148193  - set RUN_JAVASCRIPTCORE_TESTS_TESTAPI to "true" or "false" (no quotes) to determine if we run the testapi tests.
    149194  - set RUN_JAVASCRIPTCORE_TESTS_BUILD to "true" or "false" (no quotes) to set the should-we-build-before-running-tests setting.
     
    155200    'extra-tests=s' => \@extraTests,
    156201    'build!' => \$buildJSC,
     202    'testmasm!' => \$runTestMasm,
     203    'testair!' => \$runTestAir,
     204    'testb3!' => \$runTestB3,
    157205    'testapi!' => \$runTestAPI,
    158206    'jsc-stress!' => \$runJSCStress,
     
    217265setPathForRunningWebKitApp(\%ENV) if isCygwin();
    218266
    219 sub testapiPath($)
    220 {
    221     my ($productDir) = @_;
    222     my $jscName = "testapi";
    223     $jscName .= "_debug" if configuration() eq "Debug_All";
    224     return File::Spec->catfile($productDir, $jscName);
    225 }
    226 
    227 #run api tests
    228 if ($runTestAPI) {
     267sub testPath {
     268    my ($productDir, $testName) = @_;
     269    $testName .= "_debug" if configuration() eq "Debug_All";
     270    return File::Spec->catfile($productDir, $testName);
     271}
     272
     273sub runTest {
     274    my ($testName, $jsonTestStatusName) = @_;
     275
    229276    chdirWebKit();
    230277    chdir($productDir) or die "Failed to switch directory to '$productDir'\n";
    231     my @command = (testapiPath($productDir));
     278    my @command = (testPath($productDir, $testName));
    232279    unshift @command, ("xcrun", "-sdk", xcodeSDK(), "sim") if willUseIOSSimulatorSDK();
    233280    unshift @command, wrapperPrefixIfNeeded() if shouldUseJhbuild();
     
    243290    # Use an "indirect object" so that system() won't get confused if the path
    244291    # contains spaces (see perldoc -f exec).
    245     my $testapiResult = system { $command[0] } @command;
    246     my $exitStatus = exitStatus($testapiResult);
    247     print "testAPI completed with rc=$testapiResult ($exitStatus)\n";
     292    my $testResult = system { $command[0] } @command;
     293    my $exitStatus = exitStatus($testResult);
     294    print "$testName completed with rc=$testResult ($exitStatus)\n\n";
    248295
    249296    if (defined($jsonFileName)) {
    250         my $apiStatus = ($exitStatus == 0)? JSON::PP::true: JSON::PP::false;
    251         $jsonData{'allApiTestsPassed'} = $apiStatus;
    252     }
    253 
    254     if ($testapiResult && $failFast) {
     297        my $testStatus = ($exitStatus == 0)? JSON::PP::true: JSON::PP::false;
     298        $jsonData{$jsonTestStatusName} = $testStatus;
     299    }
     300
     301    if ($testResult && $failFast) {
    255302        writeJsonDataIfApplicable();
    256         exit exitStatus($testapiResult);
    257     }
    258 }
     303        exit exitStatus($testResult);
     304    }
     305}
     306
     307if ($runTestMasm) { runTest("testmasm", "allMasmTestsPassed") }
     308if ($runTestAir) { runTest("testair", "allAirTestsPassed") }
     309if ($runTestB3) { runTest("testb3", "allB3TestsPassed") }
     310if ($runTestAPI) { runTest("testapi", "allApiTestsPassed") }
     311
    259312
    260313# Find JavaScriptCore directory
Note: See TracChangeset for help on using the changeset viewer.