Title: [219965] trunk/Tools
Revision
219965
Author
[email protected]
Date
2017-07-26 15:15:21 -0700 (Wed, 26 Jul 2017)

Log Message

Make run-_javascript_core-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-_javascript_core-tests:
(testPath):
(runTest):
(testapiPath): Deleted.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (219964 => 219965)


--- trunk/Tools/ChangeLog	2017-07-26 21:45:22 UTC (rev 219964)
+++ trunk/Tools/ChangeLog	2017-07-26 22:15:21 UTC (rev 219965)
@@ -1,3 +1,24 @@
+2017-07-26  Mark Lam  <[email protected]>
+
+        Make run-_javascript_core-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-_javascript_core-tests:
+        (testPath):
+        (runTest):
+        (testapiPath): Deleted.
+
 2017-07-26  Aakash Jain  <[email protected]>
 
         Remove duplicate code from Buildbot.js in dashboard

Modified: trunk/Tools/Scripts/run-_javascript_core-tests (219964 => 219965)


--- trunk/Tools/Scripts/run-_javascript_core-tests	2017-07-26 21:45:22 UTC (rev 219964)
+++ trunk/Tools/Scripts/run-_javascript_core-tests	2017-07-26 22:15:21 UTC (rev 219965)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Copyright (C) 2005, 2013-2016 Apple Inc.  All rights reserved.
+# Copyright (C) 2005, 2013-2017 Apple Inc.  All rights reserved.
 # Copyright (C) 2007 Eric Seidel <[email protected]>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -56,6 +56,9 @@
 
 my $buildJSC = 1;
 
+my $runTestMasm = 1;
+my $runTestAir = 1;
+my $runTestB3 = 1;
 my $runTestAPI = 1;
 
 my $runJSCStress = 1;
@@ -74,6 +77,39 @@
 my $remoteConfigFile;
 my $jsonFileName;
 
+if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTMASM}) {
+    if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTMASM} eq "true") {
+        $runTestMasm = 1;
+    } elsif ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTMASM} eq "false") {
+        $runTestMasm = 0;
+    } else {
+        print "Don't recognize value for RUN_JAVASCRIPTCORE_TESTS_TESTMASM environment variable: '"
+            . $ENV{RUN_JAVASCRIPTCORE_TESTS_TESTMASM} . "'. Should be set to 'true' or 'false'.\n";
+    }
+}
+
+if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAIR}) {
+    if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAIR} eq "true") {
+        $runTestAir = 1;
+    } elsif ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAIR} eq "false") {
+        $runTestAir = 0;
+    } else {
+        print "Don't recognize value for RUN_JAVASCRIPTCORE_TESTS_TESTAIR environment variable: '"
+            . $ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAIR} . "'. Should be set to 'true' or 'false'.\n";
+    }
+}
+
+if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTB3}) {
+    if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTB3} eq "true") {
+        $runTestB3 = 1;
+    } elsif ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTB3} eq "false") {
+        $runTestB3 = 0;
+    } else {
+        print "Don't recognize value for RUN_JAVASCRIPTCORE_TESTS_TESTB3 environment variable: '"
+            . $ENV{RUN_JAVASCRIPTCORE_TESTS_TESTB3} . "'. Should be set to 'true' or 'false'.\n";
+    }
+}
+
 if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAPI}) {
     if ($ENV{RUN_JAVASCRIPTCORE_TESTS_TESTAPI} eq "true") {
         $runTestAPI = 1;
@@ -102,6 +138,9 @@
 
 my $programName = basename($0);
 my $buildJSCDefault = $buildJSC ? "will check" : "will not check";
+my $testmasmDefault = $runTestMasm ? "will run" : "will not run";
+my $testairDefault = $runTestAir ? "will run" : "will not run";
+my $testb3Default = $runTestB3 ? "will run" : "will not run";
 my $testapiDefault = $runTestAPI ? "will run" : "will not run";
 my $jscStressDefault = $runJSCStress ? "will run" : " will not run";
 my $jitStressTestsDefault = $runJITStressTests ? "will run" : " will not run";
@@ -115,6 +154,9 @@
   --root=                       Path to pre-built root containing jsc
   --[no-]ftl-jit                Turn the FTL JIT on or off
   --[no-]build                  Check (or don't check) to see if the jsc build is up-to-date (default: $buildJSCDefault)
+  --[no-]testmasm               Run (or don't run) testmasm (default: $testmasmDefault)
+  --[no-]testair                Run (or don't run) testair (default: $testairDefault)
+  --[no-]testb3                 Run (or don't run) testb3 (default: $testb3Default)
   --[no-]testapi                Run (or don't run) testapi (default: $testapiDefault)
   --[no-]jsc-stress             Run (or don't run) the JSC stress tests (default: $jscStressDefault)
   --[no-]jit-stress-tests       Run (or don't run) the JIT stress tests (default: $jitStressTestsDefault)
@@ -145,6 +187,9 @@
   --gmalloc:                    Run tests with Guard Malloc enabled (if no path is given: $gmallocDefaultPath is used)
 
 Environment Variables:
+  - set RUN_JAVASCRIPTCORE_TESTS_TESTMASM to "true" or "false" (no quotes) to determine if we run the testmasm tests.
+  - set RUN_JAVASCRIPTCORE_TESTS_TESTAIR to "true" or "false" (no quotes) to determine if we run the testair tests.
+  - set RUN_JAVASCRIPTCORE_TESTS_TESTB3 to "true" or "false" (no quotes) to determine if we run the testb3 tests.
   - set RUN_JAVASCRIPTCORE_TESTS_TESTAPI to "true" or "false" (no quotes) to determine if we run the testapi tests.
   - set RUN_JAVASCRIPTCORE_TESTS_BUILD to "true" or "false" (no quotes) to set the should-we-build-before-running-tests setting.
   - set RUN_JAVASCRIPTCORE_TESTS_EXTRA_TESTS to the path of a yaml file or a directory of JS files to be run as part of run-_javascript_core-tests.
@@ -154,6 +199,9 @@
     'root=s' => \$root,
     'extra-tests=s' => \@extraTests,
     'build!' => \$buildJSC,
+    'testmasm!' => \$runTestMasm,
+    'testair!' => \$runTestAir,
+    'testb3!' => \$runTestB3,
     'testapi!' => \$runTestAPI,
     'jsc-stress!' => \$runJSCStress,
     'jit-stress-tests!' => \$runJITStressTests,
@@ -216,19 +264,18 @@
 $ENV{TZ}="US/Pacific"; # Some tests fail if the time zone is not set to US/Pacific (<https://webkit.org/b/136363>)
 setPathForRunningWebKitApp(\%ENV) if isCygwin();
 
-sub testapiPath($)
-{
-    my ($productDir) = @_;
-    my $jscName = "testapi";
-    $jscName .= "_debug" if configuration() eq "Debug_All";
-    return File::Spec->catfile($productDir, $jscName);
+sub testPath {
+    my ($productDir, $testName) = @_;
+    $testName .= "_debug" if configuration() eq "Debug_All";
+    return File::Spec->catfile($productDir, $testName);
 }
 
-#run api tests
-if ($runTestAPI) {
+sub runTest {
+    my ($testName, $jsonTestStatusName) = @_;
+
     chdirWebKit();
     chdir($productDir) or die "Failed to switch directory to '$productDir'\n";
-    my @command = (testapiPath($productDir));
+    my @command = (testPath($productDir, $testName));
     unshift @command, ("xcrun", "-sdk", xcodeSDK(), "sim") if willUseIOSSimulatorSDK();
     unshift @command, wrapperPrefixIfNeeded() if shouldUseJhbuild();
 
@@ -242,21 +289,27 @@
 
     # Use an "indirect object" so that system() won't get confused if the path
     # contains spaces (see perldoc -f exec).
-    my $testapiResult = system { $command[0] } @command;
-    my $exitStatus = exitStatus($testapiResult);
-    print "testAPI completed with rc=$testapiResult ($exitStatus)\n";
+    my $testResult = system { $command[0] } @command;
+    my $exitStatus = exitStatus($testResult);
+    print "$testName completed with rc=$testResult ($exitStatus)\n\n";
 
     if (defined($jsonFileName)) {
-        my $apiStatus = ($exitStatus == 0)? JSON::PP::true: JSON::PP::false;
-        $jsonData{'allApiTestsPassed'} = $apiStatus;
+        my $testStatus = ($exitStatus == 0)? JSON::PP::true: JSON::PP::false;
+        $jsonData{$jsonTestStatusName} = $testStatus;
     }
 
-    if ($testapiResult && $failFast) {
+    if ($testResult && $failFast) {
         writeJsonDataIfApplicable();
-        exit exitStatus($testapiResult);
+        exit exitStatus($testResult);
     }
 }
 
+if ($runTestMasm) { runTest("testmasm", "allMasmTestsPassed") }
+if ($runTestAir) { runTest("testair", "allAirTestsPassed") }
+if ($runTestB3) { runTest("testb3", "allB3TestsPassed") }
+if ($runTestAPI) { runTest("testapi", "allApiTestsPassed") }
+
+
 # Find _javascript_Core directory
 chdirWebKit();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to