summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
aad3f95)
https://bugs.webkit.org/show_bug.cgi?id=51831
Reviewed by Anders Carlsson.
- Make script quiet by default and add --verbose option (replacing --quiet).
- When not verbose, pipe stdout and stderr to devnull.
* Scripts/run-api-tests:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74906
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-01-03 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Make run-api-tests less chatty.
+ https://bugs.webkit.org/show_bug.cgi?id=51831
+
+ - Make script quiet by default and add --verbose option (replacing --quiet).
+ - When not verbose, pipe stdout and stderr to devnull.
+
+ * Scripts/run-api-tests:
+
2011-01-03 Pratik Solanki <psolanki@apple.com>
Unreviewed. Adding myself to committers.py.
2011-01-03 Pratik Solanki <psolanki@apple.com>
Unreviewed. Adding myself to committers.py.
-# Copyright (C) 2010 Apple Inc. All rights reserved.
+# Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
sub buildTestTool();
my $showHelp = 0;
sub buildTestTool();
my $showHelp = 0;
my $dump = 0;
my $programName = basename($0);
my $usage = <<EOF;
Usage: $programName [options]
--help Show this help message
my $dump = 0;
my $programName = basename($0);
my $usage = <<EOF;
Usage: $programName [options]
--help Show this help message
- -q|--quite Less verbose output
+ -v|--verbose Verbose output
-d|--dump-tests Dump the names of testcases without running them
EOF
GetOptions(
'help' => \$showHelp,
-d|--dump-tests Dump the names of testcases without running them
EOF
GetOptions(
'help' => \$showHelp,
+ 'verbose|v' => \$verbose,
$ENV{DYLD_FRAMEWORK_PATH} = $productDir;
$ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
my $apiTesterPath = "$productDir/TestWebKitAPI";
$ENV{DYLD_FRAMEWORK_PATH} = $productDir;
$ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
my $apiTesterPath = "$productDir/TestWebKitAPI";
+
+ local *DEVNULL;
+ my ($childIn, $childOut, $childErr);
+ unless ($verbose) {
+ open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
+ $childOut = ">&DEVNULL";
+ $childErr = ">&DEVNULL";
+ } else {
+ $childOut = ">&STDOUT";
+ $childErr = ">&STDERR";
+ }
+
+ my $pid;
- $result = system "arch", "-" . architecture(), $apiTesterPath, $test, @ARGV;
+ $pid = open3($childIn, $childOut, $childErr, "arch", "-" . architecture(), $apiTesterPath, $test, @ARGV) or die "Failed to run test: $test.";
- $result = system $apiTesterPath, $test, @ARGV;
+ $pid = open3($childIn, $childOut, $childErr, $apiTesterPath, $test, @ARGV) or die "Failed to run test: $test.";
+
+ close($childIn);
+ close($childOut);
+ close($childErr);
+ close(DEVNULL) unless ($verbose);
+
+ waitpid($pid, 0);
+ my $result = $?;
} elsif (isAppleWinWebKit()) {
my $apiTesterNameSuffix;
if (configurationForVisualStudio() ne "Debug_All") {
} elsif (isAppleWinWebKit()) {
my $apiTesterNameSuffix;
if (configurationForVisualStudio() ne "Debug_All") {
$ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
my $apiTesterPath = "$productDir/TestWebKitAPI";
$ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
my $apiTesterPath = "$productDir/TestWebKitAPI";
- my ($pid, $childIn, $childOut);
+ local *DEVNULL;
+ my ($childIn, $childOut, $childErr);
+ unless ($verbose) {
+ open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
+ $childErr = ">&DEVNULL";
+ } else {
+ $childErr = ">&STDERR";
+ }
+
+ my $pid;
- $pid = open3($childIn, $childOut, ">&STDERR", "arch", "-" . architecture(), $apiTesterPath, "--dump-tests") or die "Failed to build list of tests!";
+ $pid = open3($childIn, $childOut, $childErr, "arch", "-" . architecture(), $apiTesterPath, "--dump-tests") or die "Failed to build list of tests!";
- $pid = open3($childIn, $childOut, ">&STDERR", $apiTesterPath, "--dump-tests") or die "Failed to build list of tests!";
+ $pid = open3($childIn, $childOut, $childErr, $apiTesterPath, "--dump-tests") or die "Failed to build list of tests!";
close($childIn);
@tests = <$childOut>;
close($childOut);
close($childIn);
@tests = <$childOut>;
close($childOut);
+ close($childErr);
+ close(DEVNULL) unless ($verbose);
waitpid($pid, 0);
my $result = $?;
waitpid($pid, 0);
my $result = $?;
local *DEVNULL;
my ($childIn, $childOut, $childErr);
local *DEVNULL;
my ($childIn, $childOut, $childErr);
open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
$childOut = ">&DEVNULL";
$childErr = ">&DEVNULL";
open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
$childOut = ">&DEVNULL";
$childErr = ">&DEVNULL";
my @args = argumentsForConfiguration();
my $buildProcess = open3($childIn, $childOut, $childErr, "Tools/Scripts/$buildTestTool", @args) or die "Failed to run " . $buildTestTool;
my @args = argumentsForConfiguration();
my $buildProcess = open3($childIn, $childOut, $childErr, "Tools/Scripts/$buildTestTool", @args) or die "Failed to run " . $buildTestTool;
- waitpid $buildProcess, 0;
- my $buildResult = $?;
close($childOut);
close($childErr);
close($childOut);
close($childErr);
+ close(DEVNULL) unless ($verbose);
- close DEVNULL if ($quiet);
+ waitpid($buildProcess, 0);
+ my $buildResult = $?;
if ($buildResult) {
print STDERR "Compiling TestWebKitAPI failed!\n";
if ($buildResult) {
print STDERR "Compiling TestWebKitAPI failed!\n";