diff options
Diffstat (limited to 'WebKitTools/Scripts/run-webkit-tests')
-rwxr-xr-x | WebKitTools/Scripts/run-webkit-tests | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/WebKitTools/Scripts/run-webkit-tests b/WebKitTools/Scripts/run-webkit-tests index bb4fb34..6b21e48 100755 --- a/WebKitTools/Scripts/run-webkit-tests +++ b/WebKitTools/Scripts/run-webkit-tests @@ -87,7 +87,7 @@ sub expectedDirectoryForTest($;$;$); sub fileNameWithNumber($$); sub htmlForResultsSection(\@$&); sub isTextOnlyTest($); -sub launchWithCurrentEnv(@); +sub launchWithEnv(\@\%); sub resolveAndMakeTestResultsDirectory(); sub numericcmp($$); sub openDiffTool(); @@ -659,7 +659,7 @@ for my $test (@tests) { } else { $testPath = canonpath($testPath); } - print OUT "$testPath$suffixExpectedHash\n"; + print OUT "$testPath$suffixExpectedHash\n" if defined $testPath; } # DumpRenderTree is expected to dump two "blocks" to stdout for each test. @@ -1027,6 +1027,10 @@ if (isGtk()) { system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari; } elsif (isQt()) { unshift @configurationArgs, qw(-graphicssystem raster -style windows); + if (isCygwin()) { + $testResults = "/" . toWindowsPath($testResults); + $testResults =~ s/\\/\//g; + } system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari; } elsif (isCygwin()) { system "cygstart", $testResults if $launchSafari; @@ -1210,20 +1214,20 @@ sub slowestcmp($$) return pathcmp($testa, $testb); } -sub launchWithCurrentEnv(@) +sub launchWithEnv(\@\%) { - my (@args) = @_; + my ($args, $env) = @_; # Dump the current environment as perl code and then put it in quotes so it is one parameter. - my $environmentDumper = Data::Dumper->new([\%ENV], [qw(*ENV)]); + my $environmentDumper = Data::Dumper->new([\%{$env}], [qw(*ENV)]); $environmentDumper->Indent(0); $environmentDumper->Purity(1); my $allEnvVars = $environmentDumper->Dump(); - unshift @args, "\"$allEnvVars\""; + unshift @{$args}, "\"$allEnvVars\""; my $execScript = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts execAppWithEnv)); - unshift @args, $execScript; - return @args; + unshift @{$args}, $execScript; + return @{$args}; } sub resolveAndMakeTestResultsDirectory() @@ -1238,10 +1242,9 @@ sub openDiffTool() return if $isDiffToolOpen; return if !$pixelTests; - local %ENV; - $ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; - $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithCurrentEnv(@diffToolArgs)) or die "unable to open $imageDiffTool\n"; - $ENV{MallocStackLogging} = 0 if $shouldCheckLeaks; + my %CLEAN_ENV; + $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; + $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithEnv(@diffToolArgs, %CLEAN_ENV)) or die "unable to open $imageDiffTool\n"; $isDiffToolOpen = 1; } @@ -1249,56 +1252,53 @@ sub openDumpTool() { return if $isDumpToolOpen; - # Save environment variables required for the linux environment. - my $homeDir = $ENV{'HOME'}; - my $libraryPath = $ENV{'LD_LIBRARY_PATH'}; - my $dyldLibraryPath = $ENV{'DYLD_LIBRARY_PATH'}; - my $dbusAddress = $ENV{'DBUS_SESSION_BUS_ADDRESS'}; - my $display = $ENV{'DISPLAY'}; - my $xauthority = $ENV{'XAUTHORITY'}; - my $testfonts = $ENV{'WEBKIT_TESTFONTS'}; - - my $homeDrive = $ENV{'HOMEDRIVE'}; - my $homePath = $ENV{'HOMEPATH'}; - - local %ENV; - if (isQt() || isGtk()) { - if (defined $display) { - $ENV{DISPLAY} = $display; + my %CLEAN_ENV; + + # Generic environment variables + if (defined $ENV{'WEBKIT_TESTFONTS'}) { + $CLEAN_ENV{WEBKIT_TESTFONTS} = $ENV{'WEBKIT_TESTFONTS'}; + } + + $CLEAN_ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995> + + # Platform spesifics + if (isLinux()) { + if (defined $ENV{'DISPLAY'}) { + $CLEAN_ENV{DISPLAY} = $ENV{'DISPLAY'}; } else { - $ENV{DISPLAY} = ":1"; + $CLEAN_ENV{DISPLAY} = ":1"; } - if (defined $xauthority) { - $ENV{XAUTHORITY} = $xauthority; + if (defined $ENV{'XAUTHORITY'}) { + $CLEAN_ENV{XAUTHORITY} = $ENV{'XAUTHORITY'}; } - $ENV{'WEBKIT_TESTFONTS'} = $testfonts if defined($testfonts); - $ENV{HOME} = $homeDir; - if (defined $libraryPath) { - $ENV{LD_LIBRARY_PATH} = $libraryPath; + + $CLEAN_ENV{HOME} = $ENV{'HOME'}; + + if (defined $ENV{'LD_LIBRARY_PATH'}) { + $CLEAN_ENV{LD_LIBRARY_PATH} = $ENV{'LD_LIBRARY_PATH'}; } - if (defined $dyldLibraryPath) { - $ENV{DYLD_LIBRARY_PATH} = $dyldLibraryPath; + if (defined $ENV{'DBUS_SESSION_BUS_ADDRESS'}) { + $CLEAN_ENV{DBUS_SESSION_BUS_ADDRESS} = $ENV{'DBUS_SESSION_BUS_ADDRESS'}; } - if (defined $dbusAddress) { - $ENV{DBUS_SESSION_BUS_ADDRESS} = $dbusAddress; + } elsif (isDarwin()) { + if (defined $ENV{'DYLD_LIBRARY_PATH'}) { + $CLEAN_ENV{DYLD_LIBRARY_PATH} = $ENV{'DYLD_LIBRARY_PATH'}; } + + $CLEAN_ENV{DYLD_FRAMEWORK_PATH} = $productDir; + $CLEAN_ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc; + } elsif (isCygwin()) { + $CLEAN_ENV{HOMEDRIVE} = $ENV{'HOMEDRIVE'}; + $CLEAN_ENV{HOMEPATH} = $ENV{'HOMEPATH'}; + + setPathForRunningWebKitApp(\%CLEAN_ENV); } + + # Port spesifics if (isQt()) { - $ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins"; + $CLEAN_ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins"; } - $ENV{DYLD_FRAMEWORK_PATH} = $productDir; - $ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995> - $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc; - if (isCygwin()) { - $ENV{HOMEDRIVE} = $homeDrive; - $ENV{HOMEPATH} = $homePath; - if ($testfonts) { - $ENV{WEBKIT_TESTFONTS} = $testfonts; - } - setPathForRunningWebKitApp(\%ENV) if isCygwin(); - } - my @args = ($dumpTool, @toolArgs); if (isAppleMacWebKit() and !isTiger()) { unshift @args, "arch", "-" . architecture(); @@ -1307,10 +1307,10 @@ sub openDumpTool() if ($useValgrind) { unshift @args, "valgrind", "--suppressions=$platformBaseDirectory/qt/SuppressedValgrindErrors"; } - - $ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; - $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithCurrentEnv(@args)) or die "Failed to start tool: $dumpTool\n"; - $ENV{MallocStackLogging} = 0 if $shouldCheckLeaks; + + $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; + + $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithEnv(@args, %CLEAN_ENV)) or die "Failed to start tool: $dumpTool\n"; $isDumpToolOpen = 1; $dumpToolCrashed = 0; } @@ -1337,7 +1337,6 @@ sub dumpToolDidCrash() { return 1 if $dumpToolCrashed; return 0 unless $isDumpToolOpen; - my $pid = waitpid(-1, WNOHANG); return 1 if ($pid == $dumpToolPID); @@ -1617,7 +1616,8 @@ sub convertPathUsingCygpath($$) local *inFH = $cygpath->{"in"}; local *outFH = $cygpath->{"out"}; print outFH $path . "\n"; - chomp(my $convertedPath = <inFH>); + my $convertedPath = <inFH>; + chomp($convertedPath) if defined $convertedPath; return $convertedPath; } |