Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[iOS] Support TestWebKitAPI in the iOS Simulator
<http://webkit.org/b/129535>
<rdar://problem/16203529>

Reviewed by Daniel Bates.

* Scripts/run-api-tests:
(runTest):
(listAllTests):
- Extract common arguments into local variable.
- Use xcrun to find the sim tool in order to invoke
TestWebKitAPI properly in the iOS Simulator.

* Scripts/webkitdirs.pm:
(argumentsForConfiguration): Set --device or --sim as
appropriate to fix buildTestTool() in run-api-tests.


Canonical link: https://commits.webkit.org/151017@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ddkilzer committed May 15, 2014
1 parent 50c3f22 commit ac99cda
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
19 changes: 19 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,22 @@
2014-05-15 David Kilzer <ddkilzer@apple.com>

[iOS] Support TestWebKitAPI in the iOS Simulator
<http://webkit.org/b/129535>
<rdar://problem/16203529>

Reviewed by Daniel Bates.

* Scripts/run-api-tests:
(runTest):
(listAllTests):
- Extract common arguments into local variable.
- Use xcrun to find the sim tool in order to invoke
TestWebKitAPI properly in the iOS Simulator.

* Scripts/webkitdirs.pm:
(argumentsForConfiguration): Set --device or --sim as
appropriate to fix buildTestTool() in run-api-tests.

2014-05-15 Tim Horton <timothy_horton@apple.com>

Fix a logging typo in copy-webkitlibraries-to-product-directory
Expand Down
18 changes: 12 additions & 6 deletions Tools/Scripts/run-api-tests
Expand Up @@ -188,10 +188,13 @@ sub runTest($$$)
}

my $pid;
if (isAppleMacWebKit() && architecture()) {
$pid = open3($childIn, $childOut, $childErr, "arch", "-" . architecture(), testToolPath(), $gtestArg, @ARGV) or die "Failed to run test: $test.";
my @commonArguments = (testToolPath(), $gtestArg, @ARGV);
if (isIOSWebKit()) {
$pid = open3($childIn, $childOut, $childErr, qw(xcrun -sdk iphonesimulator sim --environment=merge), @commonArguments) or die "Failed to run test: $test.";
} elsif (isAppleMacWebKit() && architecture()) {
$pid = open3($childIn, $childOut, $childErr, "arch", "-" . architecture(), @commonArguments) or die "Failed to run test: $test.";
} else {
$pid = open3($childIn, $childOut, $childErr, testToolPath(), $gtestArg, @ARGV) or die "Failed to run test: $test.";
$pid = open3($childIn, $childOut, $childErr, @commonArguments) or die "Failed to run test: $test.";
}

close($childIn);
Expand Down Expand Up @@ -247,10 +250,13 @@ sub listAllTests()
}

my $pid;
if (isAppleMacWebKit() && architecture()) {
$pid = open3($childIn, $childOut, $childErr, "arch", "-" . architecture(), testToolPath(), "--gtest_list_tests") or die "Failed to build list of tests!";
my @commonArguments = (testToolPath(), "--gtest_list_tests");
if (isIOSWebKit()) {
$pid = open3($childIn, $childOut, $childErr, qw(xcrun -sdk iphonesimulator sim --environment=merge), @commonArguments) or die "Failed to build list of tests!";
} elsif (isAppleMacWebKit() && architecture()) {
$pid = open3($childIn, $childOut, $childErr, "arch", "-" . architecture(), @commonArguments) or die "Failed to build list of tests!";
} else {
$pid = open3($childIn, $childOut, $childErr, testToolPath(), "--gtest_list_tests") or die "Failed to build list of tests!";
$pid = open3($childIn, $childOut, $childErr, @commonArguments) or die "Failed to build list of tests!";
}

close($childIn);
Expand Down
3 changes: 3 additions & 0 deletions Tools/Scripts/webkitdirs.pm
Expand Up @@ -371,10 +371,13 @@ sub argumentsForConfiguration()
{
determineConfiguration();
determineArchitecture();
determineXcodeSDK();

my @args = ();
push(@args, '--debug') if ($configuration =~ "^Debug");
push(@args, '--release') if ($configuration =~ "^Release");
push(@args, '--device') if ($xcodeSDK =~ /^iphoneos/);
push(@args, '--sim') if ($xcodeSDK =~ /^iphonesimulator/);
push(@args, '--32-bit') if ($architecture ne "x86_64" and !isWin64());
push(@args, '--64-bit') if (isWin64());
push(@args, '--gtk') if isGtk();
Expand Down

0 comments on commit ac99cda

Please sign in to comment.