#!/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 <eric@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
my $buildJSC = 1;
+my $runTestMasm = 1;
+my $runTestAir = 1;
+my $runTestB3 = 1;
my $runTestAPI = 1;
my $runJSCStress = 1;
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;
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";
--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)
--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-javascriptcore-tests.
'root=s' => \$root,
'extra-tests=s' => \@extraTests,
'build!' => \$buildJSC,
+ 'testmasm!' => \$runTestMasm,
+ 'testair!' => \$runTestAir,
+ 'testb3!' => \$runTestB3,
'testapi!' => \$runTestAPI,
'jsc-stress!' => \$runJSCStress,
'jit-stress-tests!' => \$runJITStressTests,
$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();
# 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 JavaScriptCore directory
chdirWebKit();