Changeset 53763 in webkit
- Timestamp:
- Jan 22, 2010 10:51:42 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r53757 r53763 1 2010-01-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 Make run-webkit-tests work under Cygwin for the Qt port 6 7 setPathForRunningWebKitApp() is implemented for the Qt port 8 by using qmake to query for the location of the Qt libraries. 9 10 This requires the original environment (%ENV) to be untouched, 11 so launchWithCurrentEnv() was refactored to launchWithEnv(), 12 and the code in openDumpTool() to not use %ENV but a %CLEAN_ENV 13 instead. This has the added benefit of getting rid of the temp 14 variables used for storing the current env. 15 16 openDumpTool() is also refactored a bit into platform-spesific, 17 port-spesific, and generic environment variables. 18 19 Checks for undef was added a few places to fix Perl concat 20 warnings when run-webkit-tests is aborted. 21 22 https://bugs.webkit.org/show_bug.cgi?id=33895 23 24 * Scripts/run-webkit-tests: 25 * Scripts/webkitdirs.pm: 26 1 27 2010-01-22 Kevin Watters <kevinwatters@gmail.com> 2 28 -
trunk/WebKitTools/Scripts/run-webkit-tests
r53592 r53763 88 88 sub htmlForResultsSection(\@$&); 89 89 sub isTextOnlyTest($); 90 sub launchWith CurrentEnv(@);90 sub launchWithEnv(\@\%); 91 91 sub resolveAndMakeTestResultsDirectory(); 92 92 sub numericcmp($$); … … 660 660 $testPath = canonpath($testPath); 661 661 } 662 print OUT "$testPath$suffixExpectedHash\n" ;662 print OUT "$testPath$suffixExpectedHash\n" if defined $testPath; 663 663 } 664 664 … … 1028 1028 } elsif (isQt()) { 1029 1029 unshift @configurationArgs, qw(-graphicssystem raster -style windows); 1030 if (isCygwin()) { 1031 $testResults = "/" . toWindowsPath($testResults); 1032 $testResults =~ s/\\/\//g; 1033 } 1030 1034 system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari; 1031 1035 } elsif (isCygwin()) { … … 1211 1215 } 1212 1216 1213 sub launchWith CurrentEnv(@)1214 { 1215 my ( @args) = @_;1217 sub launchWithEnv(\@\%) 1218 { 1219 my ($args, $env) = @_; 1216 1220 1217 1221 # Dump the current environment as perl code and then put it in quotes so it is one parameter. 1218 my $environmentDumper = Data::Dumper->new([\% ENV], [qw(*ENV)]);1222 my $environmentDumper = Data::Dumper->new([\%{$env}], [qw(*ENV)]); 1219 1223 $environmentDumper->Indent(0); 1220 1224 $environmentDumper->Purity(1); 1221 1225 my $allEnvVars = $environmentDumper->Dump(); 1222 unshift @ args, "\"$allEnvVars\"";1226 unshift @{$args}, "\"$allEnvVars\""; 1223 1227 1224 1228 my $execScript = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts execAppWithEnv)); 1225 unshift @ args, $execScript;1226 return @ args;1229 unshift @{$args}, $execScript; 1230 return @{$args}; 1227 1231 } 1228 1232 … … 1239 1243 return if !$pixelTests; 1240 1244 1241 local %ENV; 1242 $ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; 1243 $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithCurrentEnv(@diffToolArgs)) or die "unable to open $imageDiffTool\n"; 1244 $ENV{MallocStackLogging} = 0 if $shouldCheckLeaks; 1245 my %CLEAN_ENV; 1246 $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; 1247 $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithEnv(@diffToolArgs, %CLEAN_ENV)) or die "unable to open $imageDiffTool\n"; 1245 1248 $isDiffToolOpen = 1; 1246 1249 } … … 1250 1253 return if $isDumpToolOpen; 1251 1254 1252 # Save environment variables required for the linux environment. 1253 my $homeDir = $ENV{'HOME'}; 1254 my $libraryPath = $ENV{'LD_LIBRARY_PATH'}; 1255 my $dyldLibraryPath = $ENV{'DYLD_LIBRARY_PATH'}; 1256 my $dbusAddress = $ENV{'DBUS_SESSION_BUS_ADDRESS'}; 1257 my $display = $ENV{'DISPLAY'}; 1258 my $xauthority = $ENV{'XAUTHORITY'}; 1259 my $testfonts = $ENV{'WEBKIT_TESTFONTS'}; 1260 1261 my $homeDrive = $ENV{'HOMEDRIVE'}; 1262 my $homePath = $ENV{'HOMEPATH'}; 1263 1264 local %ENV; 1265 if (isQt() || isGtk()) { 1266 if (defined $display) { 1267 $ENV{DISPLAY} = $display; 1255 my %CLEAN_ENV; 1256 1257 # Generic environment variables 1258 $CLEAN_ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995> 1259 1260 # Platform spesifics 1261 if (isLinux()) { 1262 if (defined $ENV{'DISPLAY'}) { 1263 $CLEAN_ENV{DISPLAY} = $ENV{'DISPLAY'}; 1268 1264 } else { 1269 $ENV{DISPLAY} = ":1"; 1270 } 1271 if (defined $xauthority) { 1272 $ENV{XAUTHORITY} = $xauthority; 1273 } 1274 $ENV{'WEBKIT_TESTFONTS'} = $testfonts if defined($testfonts); 1275 $ENV{HOME} = $homeDir; 1276 if (defined $libraryPath) { 1277 $ENV{LD_LIBRARY_PATH} = $libraryPath; 1278 } 1279 if (defined $dyldLibraryPath) { 1280 $ENV{DYLD_LIBRARY_PATH} = $dyldLibraryPath; 1281 } 1282 if (defined $dbusAddress) { 1283 $ENV{DBUS_SESSION_BUS_ADDRESS} = $dbusAddress; 1284 } 1285 } 1265 $CLEAN_ENV{DISPLAY} = ":1"; 1266 } 1267 if (defined $ENV{'XAUTHORITY'}) { 1268 $CLEAN_ENV{XAUTHORITY} = $ENV{'XAUTHORITY'}; 1269 } 1270 1271 if (defined $ENV{'WEBKIT_TESTFONTS'}) { 1272 $CLEAN_ENV{WEBKIT_TESTFONTS} = $ENV{'WEBKIT_TESTFONTS'}; 1273 } 1274 1275 $CLEAN_ENV{HOME} = $ENV{'HOME'}; 1276 if (defined $ENV{'LD_LIBRARY_PATH'}) { 1277 $CLEAN_ENV{LD_LIBRARY_PATH} = $ENV{'LD_LIBRARY_PATH'}; 1278 } 1279 if (defined $ENV{'DBUS_SESSION_BUS_ADDRESS'}) { 1280 $CLEAN_ENV{DBUS_SESSION_BUS_ADDRESS} = $ENV{'DBUS_SESSION_BUS_ADDRESS'}; 1281 } 1282 } elsif (isDarwin()) { 1283 if (defined $ENV{'DYLD_LIBRARY_PATH'}) { 1284 $CLEAN_ENV{DYLD_LIBRARY_PATH} = $ENV{'DYLD_LIBRARY_PATH'}; 1285 } 1286 1287 $CLEAN_ENV{DYLD_FRAMEWORK_PATH} = $productDir; 1288 $CLEAN_ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc; 1289 } elsif (isCygwin()) { 1290 $CLEAN_ENV{HOMEDRIVE} = $ENV{'HOMEDRIVE'}; 1291 $CLEAN_ENV{HOMEPATH} = $ENV{'HOMEPATH'}; 1292 1293 setPathForRunningWebKitApp(\%CLEAN_ENV); 1294 } 1295 1296 # Port spesifics 1286 1297 if (isQt()) { 1287 $ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins"; 1288 } 1289 $ENV{DYLD_FRAMEWORK_PATH} = $productDir; 1290 $ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995> 1291 $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc; 1298 $CLEAN_ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins"; 1299 } 1292 1300 1293 if (isCygwin()) {1294 $ENV{HOMEDRIVE} = $homeDrive;1295 $ENV{HOMEPATH} = $homePath;1296 if ($testfonts) {1297 $ENV{WEBKIT_TESTFONTS} = $testfonts;1298 }1299 setPathForRunningWebKitApp(\%ENV) if isCygwin();1300 }1301 1302 1301 my @args = ($dumpTool, @toolArgs); 1303 1302 if (isAppleMacWebKit() and !isTiger()) { … … 1308 1307 unshift @args, "valgrind", "--suppressions=$platformBaseDirectory/qt/SuppressedValgrindErrors"; 1309 1308 } 1310 1311 $ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; 1312 $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithCurrentEnv(@args)) or die "Failed to start tool: $dumpTool\n"; 1313 $ENV{MallocStackLogging} = 0 if $shouldCheckLeaks; 1309 1310 $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; 1311 1312 $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithEnv(@args, %CLEAN_ENV)) or die "Failed to start tool: $dumpTool\n"; 1313 if (isCygwin()) { 1314 # Convert '\r\n' => '\n', to match the expected files 1315 binmode(IN, ":crlf"); 1316 binmode(ERROR, ":crlf"); 1317 } 1314 1318 $isDumpToolOpen = 1; 1315 1319 $dumpToolCrashed = 0; … … 1338 1342 return 1 if $dumpToolCrashed; 1339 1343 return 0 unless $isDumpToolOpen; 1340 1341 1344 my $pid = waitpid(-1, WNOHANG); 1342 1345 return 1 if ($pid == $dumpToolPID); … … 1618 1621 local *outFH = $cygpath->{"out"}; 1619 1622 print outFH $path . "\n"; 1620 chomp(my $convertedPath = <inFH>); 1623 my $convertedPath = <inFH>; 1624 chomp($convertedPath) if defined $convertedPath; 1621 1625 return $convertedPath; 1622 1626 } -
trunk/WebKitTools/Scripts/webkitdirs.pm
r53408 r53763 542 542 return "$configurationProductDir/lib/$libraryName.framework/$libraryName"; 543 543 } elsif (isWindows()) { 544 chomp(my $mkspec = `qmake -query QMAKE_MKSPECS`); 544 my $mkspec = `qmake -query QMAKE_MKSPECS`; 545 $mkspec =~ s/[\n|\r]$//g; 545 546 my $qtMajorVersion = retrieveQMakespecVar("$mkspec/qconfig.pri", "QT_MAJOR_VERSION"); 546 if ( $qtMajorVersion eq "unknown") {547 if (not $qtMajorVersion) { 547 548 $qtMajorVersion = ""; 548 549 } … … 1329 1330 my $varname = $_[1]; 1330 1331 1331 my $ compiler = "unknown";1332 my $varvalue = undef; 1332 1333 #print "retrieveMakespecVar " . $mkspec . ", " . $varname . "\n"; 1333 1334 1334 1335 local *SPEC; 1335 open SPEC, "<$mkspec" or return "make";1336 open SPEC, "<$mkspec" or return $varvalue; 1336 1337 while (<SPEC>) { 1337 1338 if ($_ =~ /\s*include\((.+)\)/) { … … 1341 1342 my $newcwd = "$volume$directories"; 1342 1343 chdir $newcwd if $newcwd; 1343 $ compiler= retrieveQMakespecVar($1, $varname);1344 $varvalue = retrieveQMakespecVar($1, $varname); 1344 1345 chdir $oldcwd; 1345 1346 } elsif ($_ =~ /$varname\s*=\s*([^\s]+)/) { 1346 $ compiler= $1;1347 $varvalue = $1; 1347 1348 last; 1348 1349 } 1349 1350 } 1350 1351 close SPEC; 1351 return $ compiler;1352 return $varvalue; 1352 1353 } 1353 1354 … … 1646 1647 my ($env) = @_; 1647 1648 1648 return unless isAppleWinWebKit(); 1649 1650 $env->{PATH} = join(':', productDir(), dirname(installedSafariPath()), appleApplicationSupportPath(), $env->{PATH} || ""); 1649 if (isAppleWinWebKit()) { 1650 $env->{PATH} = join(':', productDir(), dirname(installedSafariPath()), appleApplicationSupportPath(), $env->{PATH} || ""); 1651 } elsif (isQt()) { 1652 my $qtLibs = `qmake -query QT_INSTALL_LIBS`; 1653 $qtLibs =~ s/[\n|\r]$//g; 1654 $env->{PATH} = join(';', $qtLibs, productDir() . "/lib", $env->{PATH} || ""); 1655 } 1651 1656 } 1652 1657
Note: See TracChangeset
for help on using the changeset viewer.