Changeset 70188 in webkit
- Timestamp:
- Oct 20, 2010 4:12:09 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r70187 r70188 1 2010-10-19 Adam Roben <aroben@apple.com> 2 3 Gently nudge old-run-webkit-tests toward working with Win32 Perl 4 5 This makes old-run-webkit-tests able to build DRT and find all the 6 tests to run. It even invokes DRT and passes it the list of tests. But 7 DRT ends up hung blocking on I/O. 8 9 Fixes <http://webkit.org/b/47961> Get old-run-webkit-tests mostly 10 working with Win32 Perl 11 12 Reviewed by David Kilzer. 13 14 * Scripts/old-run-webkit-tests: 15 - Use File::Spec instead of manually concatenating paths 16 - Use dirname instead of manually stripping off the base name 17 - Use isCygwin/isWindows/isAppleWinWebKit more judiciously 18 - Explicitly invoke Perl when running Perl scripts 19 - Quote paths when using them in regular expressions to allow them 20 to include characters that have special meanings in regular 21 expressions 22 23 * Scripts/run-webkit-tests: Use File::Spec instead of manually 24 concatenating paths. 25 26 * Scripts/webkitdirs.pm: 27 - Remove the unused $windowsTmpPath variable 28 - Use isCygwin/isWindows/isAppleWinWebKit more judiciously 29 - Only pass paths to cygpath when using Cygwin Perl 30 - Only use pdevenv when using Cygwin Perl, for now 31 1 32 2010-10-20 Daniel Bates <dbates@rim.com> 2 33 -
trunk/WebKitTools/Scripts/old-run-webkit-tests
r70183 r70188 50 50 use warnings; 51 51 52 use Config; 52 53 use Cwd; 53 54 use Data::Dumper; … … 158 159 my $testMedia = 1; 159 160 my $tmpDir = "/tmp"; 160 my $testResultsDirectory = File::Spec->cat file($tmpDir, "layout-test-results");161 my $testResultsDirectory = File::Spec->catdir($tmpDir, "layout-test-results"); 161 162 my $testsPerDumpTool = 1000; 162 163 my $threaded = 0; … … 180 181 # Default to --no-http for wx for now. 181 182 $testHTTP = 0 if (isWx()); 183 184 my $perlInterpreter = "perl"; 182 185 183 186 my $expectedTag = "expected"; … … 225 228 } elsif (isWx()) { 226 229 $platform = "wx"; 227 } elsif (isCygwin() ) {230 } elsif (isCygwin() || isWindows()) { 228 231 if (isWindowsXP()) { 229 232 $platform = "win-xp"; … … 237 240 } 238 241 239 if (isQt() || is Cygwin()) {242 if (isQt() || isAppleWinWebKit()) { 240 243 my $testfontPath = $ENV{"WEBKIT_TESTFONTS"}; 241 244 if (!$testfontPath || !-d "$testfontPath") { … … 413 416 my $dumpToolName = $useWebKitTestRunner ? "WebKitTestRunner" : "DumpRenderTree"; 414 417 415 $dumpToolName .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/; 416 my $dumpTool = "$productDir/$dumpToolName"; 418 if (isAppleWinWebKit()) { 419 $dumpToolName .= "_debug" if configurationForVisualStudio() !~ /^Release|Debug_Internal$/; 420 $dumpToolName .= $Config{_exe}; 421 } 422 my $dumpTool = File::Spec->catfile($productDir, $dumpToolName); 417 423 die "can't find executable $dumpToolName (looked in $productDir)\n" unless -x $dumpTool; 418 424 … … 685 691 if ($pixelTests && !$resetResults) { 686 692 my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png"); 687 if (open EXPECTEDHASH, "$expectedPixelDir/$base-$expectedTag.checksum") {693 if (open EXPECTEDHASH, File::Spec->catfile($expectedPixelDir, "$base-$expectedTag.checksum")) { 688 694 my $expectedHash = <EXPECTEDHASH>; 689 695 chomp($expectedHash); … … 767 773 768 774 my $expectedDir = expectedDirectoryForTest($base, $isText, $expectedExtension); 769 $expectedResultPaths{$base} = "$expectedDir/$expectedFileName";775 $expectedResultPaths{$base} = File::Spec->catfile($expectedDir, $expectedFileName); 770 776 771 777 unless ($readResults->{status} eq "success") { … … 781 787 my $expected; 782 788 783 if (!$resetResults && open EXPECTED, "<", "$expectedDir/$expectedFileName") {789 if (!$resetResults && open EXPECTED, "<", $expectedResultPaths{$base}) { 784 790 $expected = ""; 785 791 while (<EXPECTED>) { … … 831 837 if ($actualPNGSize > 0) { 832 838 my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png"); 839 my $expectedPNGPath = File::Spec->catfile($expectedPixelDir, "$base-$expectedTag.png"); 833 840 834 841 if (!$resetResults && ($expectedHash ne $actualHash || ($actualHash eq "" && $expectedHash eq ""))) { 835 if (-f "$expectedPixelDir/$base-$expectedTag.png") {836 my $expectedPNGSize = -s "$expectedPixelDir/$base-$expectedTag.png";842 if (-f $expectedPNGPath) { 843 my $expectedPNGSize = -s $expectedPNGPath; 837 844 my $expectedPNG = ""; 838 open EXPECTEDPNG, "$expectedPixelDir/$base-$expectedTag.png";845 open EXPECTEDPNG, $expectedPNGPath; 839 846 read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize); 840 847 … … 867 874 } 868 875 869 if ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.png") {876 if ($resetResults || !-f $expectedPNGPath) { 870 877 mkpath catfile($expectedPixelDir, dirname($base)) if $testDirectory ne $expectedPixelDir; 871 writeToFile("$expectedPixelDir/$base-$expectedTag.png", $actualPNG); 872 } 873 874 if ($actualHash ne "" && ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.checksum")) { 875 writeToFile("$expectedPixelDir/$base-$expectedTag.checksum", $actualHash); 878 writeToFile($expectedPNGPath, $actualPNG); 879 } 880 881 my $expectedChecksumPath = File::Spec->catfile($expectedPixelDir, "$base-$expectedTag.checksum"); 882 if ($actualHash ne "" && ($resetResults || !-f $expectedChecksumPath)) { 883 writeToFile($expectedChecksumPath, $actualHash); 876 884 } 877 885 } … … 1010 1018 1011 1019 if ($error) { 1012 my $dir = "$testResultsDirectory/$base"; 1013 $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n"; 1020 my $dir = dirname(File::Spec->catdir($testResultsDirectory, $base)); 1014 1021 mkpath $dir; 1015 1022 1016 writeToFile( "$testResultsDirectory/$base-$errorTag.txt", $error);1023 writeToFile(File::Spec->catfile($testResultsDirectory, "$base-$errorTag.txt"), $error); 1017 1024 1018 1025 $counts{error}++; … … 1122 1129 } elsif (isCygwin()) { 1123 1130 system "cygstart", $testResults if $launchSafari; 1131 } elsif (isWindows()) { 1132 system "start", $testResults if $launchSafari; 1124 1133 } else { 1125 1134 system "WebKitTools/Scripts/run-safari", @configurationArgs, "-NSOpen", $testResults if $launchSafari; … … 1323 1332 1324 1333 my $execScript = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts execAppWithEnv)); 1325 unshift @{$args}, $ execScript;1334 unshift @{$args}, $perlInterpreter, $execScript; 1326 1335 return @{$args}; 1327 1336 } … … 1365 1374 1366 1375 my @args = argumentsForConfiguration(); 1367 my $buildProcess = open3($childIn, $childOut, $childErr, "WebKitTools/Scripts/$dumpToolBuildScript", @args) or die "Failed to run build-dumprendertree";1376 my $buildProcess = open3($childIn, $childOut, $childErr, $perlInterpreter, File::Spec->catfile(qw(WebKitTools Scripts), $dumpToolBuildScript), @args) or die "Failed to run build-dumprendertree"; 1368 1377 close($childIn); 1369 1378 waitpid $buildProcess, 0; … … 1508 1517 { 1509 1518 # we have not chdir to sourceDir yet. 1510 system sourceDir() . "/WebKitTools/Scripts/ensure-valid-python", "--check-only";1519 system $perlInterpreter, File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts ensure-valid-python)), "--check-only"; 1511 1520 return exitStatus($?) == 0; 1512 1521 } … … 1611 1620 1612 1621 my @directories = @platformResultHierarchy; 1613 push @directories, map { catdir($platformBaseDirectory, $_) } qw(mac-snowleopard mac) if is Cygwin();1622 push @directories, map { catdir($platformBaseDirectory, $_) } qw(mac-snowleopard mac) if isAppleWinWebKit(); 1614 1623 push @directories, $expectedDirectory; 1615 1624 1616 1625 # If we already have expected results, just return their location. 1617 1626 foreach my $directory (@directories) { 1618 return $directory if (-f "$directory/$base-$expectedTag.$expectedExtension");1627 return $directory if -f File::Spec->catfile($directory, "$base-$expectedTag.$expectedExtension"); 1619 1628 } 1620 1629 … … 1632 1641 my $fileName; 1633 1642 if ($testsPerDumpTool == 1) { 1634 $fileName = "$testResultsDirectory/$base-leaks.txt";1643 $fileName = File::Spec->catfile($testResultsDirectory, "$base-leaks.txt"); 1635 1644 } else { 1636 $fileName = "$testResultsDirectory/" . fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt";1645 $fileName = File::Spec->catfile($testResultsDirectory, fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt"); 1637 1646 } 1638 1647 my $leakCount = countAndPrintLeaks($dumpToolName, $dumpToolPID, $fileName); … … 1657 1666 sampleDumpTool() unless $didCrash; 1658 1667 1659 my $dir = "$testResultsDirectory/$base"; 1660 $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n"; 1668 my $dir = dirname(File::Spec->catdir($testResultsDirectory, $base)); 1661 1669 mkpath $dir; 1662 1670 … … 1664 1672 1665 1673 if (defined($error) && length($error)) { 1666 writeToFile( "$testResultsDirectory/$base-$errorTag.txt", $error);1674 writeToFile(File::Spec->catfile($testResultsDirectory, "$base-$errorTag.txt"), $error); 1667 1675 } 1668 1676 … … 1902 1910 my $expectedResultPath = $expectedResultPaths{$base}; 1903 1911 my ($expectedResultFileNameMinusExtension, $expectedResultDirectoryPath, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$}); 1904 my $actualResultsPath = "$testResultsDirectory/$base-$actualTag$expectedResultExtension";1905 my $copiedExpectedResultsPath = "$testResultsDirectory/$base-$expectedTag$expectedResultExtension";1912 my $actualResultsPath = File::Spec->catfile($testResultsDirectory, "$base-$actualTag$expectedResultExtension"); 1913 my $copiedExpectedResultsPath = File::Spec->catfile($testResultsDirectory, "$base-$expectedTag$expectedResultExtension"); 1906 1914 1907 1915 mkpath(dirname($actualResultsPath)); … … 1915 1923 } 1916 1924 1917 my $diffOuputBasePath = "$testResultsDirectory/$base";1925 my $diffOuputBasePath = File::Spec->catfile($testResultsDirectory, $base); 1918 1926 my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt"; 1919 1927 system "diff -u \"$copiedExpectedResultsPath\" \"$actualResultsPath\" > \"$diffOutputPath\""; … … 2275 2283 2276 2284 for my $test (@ARGV) { 2277 $test =~ s/^( $layoutTestsName|$testDirectory)\///;2285 $test =~ s/^(\Q$layoutTestsName\E|\Q$testDirectory\E)\///; 2278 2286 my $fullPath = catfile($testDirectory, $test); 2279 2287 if (file_name_is_absolute($test)) { -
trunk/WebKitTools/Scripts/run-webkit-tests
r58080 r70188 42 42 use warnings; 43 43 44 use File::Spec; 44 45 use FindBin; 45 46 use lib $FindBin::Bin; … … 80 81 } 81 82 82 my $harnessPath = sprintf("%s/%s",relativeScriptsDir(), $harnessName);83 my $harnessPath = File::Spec->catfile(relativeScriptsDir(), $harnessName); 83 84 exec $harnessPath ($harnessPath, @ARGV) or die "Failed to execute $harnessPath"; -
trunk/WebKitTools/Scripts/webkitdirs.pm
r69863 r70188 72 72 # Variables for Win32 support 73 73 my $vcBuildPath; 74 my $windowsTmpPath;75 74 my $windowsSourceDir; 76 75 my $winVersion; … … 174 173 chomp $dosBuildPath; 175 174 $ENV{"WEBKITOUTPUTDIR"} = $dosBuildPath; 176 }177 178 if (isAppleWinWebKit()) {179 175 my $unixBuildPath = `cygpath --unix \"$baseProductDir\"`; 180 176 chomp $unixBuildPath; … … 290 286 return unless $configuration eq "Debug"; 291 287 setupCygwinEnv(); 292 chomp(my $dir = `cygpath -ua '$ENV{WEBKITLIBRARIESDIR}'`); 293 $configurationForVisualStudio = "Debug_Internal" if -f "$dir/bin/CoreFoundation_debug.dll"; 288 my $dir = $ENV{WEBKITLIBRARIESDIR}; 289 chomp($dir = `cygpath -ua '$dir'`) if isCygwin(); 290 $configurationForVisualStudio = "Debug_Internal" if -f File::Spec->catfile($dir, "bin", "CoreFoundation_debug.dll"); 294 291 } 295 292 … … 300 297 determineConfiguration(); 301 298 if (isAppleWinWebKit() && !isWx()) { 302 $configurationProductDir = "$baseProductDir/bin";299 $configurationProductDir = File::Spec->catdir($baseProductDir, "bin"); 303 300 } else { 304 301 # [Gtk][Efl] We don't have Release/Debug configurations in straight … … 530 527 $safariBundle = `"$configurationProductDir/FindSafari.exe"`; 531 528 $safariBundle =~ s/[\r\n]+$//; 532 $safariBundle = `cygpath -u '$safariBundle'` ;529 $safariBundle = `cygpath -u '$safariBundle'` if isCygwin(); 533 530 $safariBundle =~ s/[\r\n]+$//; 534 531 $safariBundle .= "Safari.exe"; … … 625 622 sub checkFrameworks # FIXME: This is a poor name since only the Mac calls built WebCore a Framework. 626 623 { 627 return if isCygwin() ;624 return if isCygwin() || isWindows(); 628 625 my @frameworks = ("JavaScriptCore", "WebCore"); 629 626 push(@frameworks, "WebKit") if isAppleMacWebKit(); # FIXME: This seems wrong, all ports should have a WebKit these days. … … 874 871 sub isAppleWinWebKit() 875 872 { 876 return isAppleWebKit() && isCygwin();873 return isAppleWebKit() && (isCygwin() || isWindows()); 877 874 } 878 875 … … 1010 1007 { 1011 1008 return if $windowsSourceDir; 1012 my $sourceDir = sourceDir();1013 chomp($windowsSourceDir = `cygpath -w '$ sourceDir'`);1009 $windowsSourceDir = sourceDir(); 1010 chomp($windowsSourceDir = `cygpath -w '$windowsSourceDir'`) if isCygwin(); 1014 1011 } 1015 1012 … … 1071 1068 sub setupCygwinEnv() 1072 1069 { 1073 return if !isCygwin() ;1070 return if !isCygwin() && !isWindows(); 1074 1071 return if $vcBuildPath; 1075 1072 1076 1073 my $vsInstallDir; 1077 my $programFilesPath = $ENV{'PROGRAMFILES '} || "C:\\Program Files";1074 my $programFilesPath = $ENV{'PROGRAMFILES(X86)'} || $ENV{'PROGRAMFILES'} || "C:\\Program Files"; 1078 1075 if ($ENV{'VSINSTALLDIR'}) { 1079 1076 $vsInstallDir = $ENV{'VSINSTALLDIR'}; 1080 1077 } else { 1081 $vsInstallDir = "$programFilesPath/Microsoft Visual Studio 8"; 1082 } 1083 $vsInstallDir = `cygpath "$vsInstallDir"`; 1084 chomp $vsInstallDir; 1085 $vcBuildPath = "$vsInstallDir/Common7/IDE/devenv.com"; 1078 $vsInstallDir = File::Spec->catdir($programFilesPath, "Microsoft Visual Studio 8"); 1079 } 1080 chomp($vsInstallDir = `cygpath "$vsInstallDir"`) if isCygwin(); 1081 $vcBuildPath = File::Spec->catfile($vsInstallDir, qw(Common7 IDE devenv.com)); 1086 1082 if (-e $vcBuildPath) { 1087 1083 # Visual Studio is installed; we can use pdevenv to build. 1088 $vcBuildPath = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts pdevenv)); 1084 # FIXME: Make pdevenv work with non-Cygwin Perl. 1085 $vcBuildPath = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts pdevenv)) if isCygwin(); 1089 1086 } else { 1090 1087 # Visual Studio not found, try VC++ Express 1091 $vcBuildPath = "$vsInstallDir/Common7/IDE/VCExpress.exe";1088 $vcBuildPath = File::Spec->catfile($vsInstallDir, qw(Common7 IDE VCExpress.exe)); 1092 1089 if (! -e $vcBuildPath) { 1093 1090 print "*************************************************************\n"; … … 1102 1099 } 1103 1100 1104 my $qtSDKPath = "$programFilesPath/QuickTime SDK";1101 my $qtSDKPath = File::Spec->catdir($programFilesPath, "QuickTime SDK"); 1105 1102 if (0 && ! -e $qtSDKPath) { 1106 1103 print "*************************************************************\n"; … … 1112 1109 } 1113 1110 1114 chomp($ENV{'WEBKITLIBRARIESDIR'} = `cygpath -wa "$sourceDir/WebKitLibraries/win"`) unless $ENV{'WEBKITLIBRARIESDIR'}; 1115 1116 $windowsTmpPath = `cygpath -w /tmp`; 1117 chomp $windowsTmpPath; 1111 unless ($ENV{WEBKITLIBRARIESDIR}) { 1112 $ENV{'WEBKITLIBRARIESDIR'} = File::Spec->catdir($sourceDir, "WebKitLibraries", "win"); 1113 chomp($ENV{WEBKITLIBRARIESDIR} = `cygpath -wa $ENV{WEBKITLIBRARIESDIR}`) if isCygwin(); 1114 } 1115 1118 1116 print "Building results into: ", baseProductDir(), "\n"; 1119 1117 print "WEBKITOUTPUTDIR is set to: ", $ENV{"WEBKITOUTPUTDIR"}, "\n"; … … 1198 1196 dieIfWindowsPlatformSDKNotInstalled() if $willUseVCExpressWhenBuilding; 1199 1197 1200 chomp( my $winProjectPath = `cygpath -w "$project"`);1198 chomp($project = `cygpath -w "$project"`) if isCygwin(); 1201 1199 1202 1200 my $action = "/build"; … … 1205 1203 } 1206 1204 1207 my @command = ($vcBuildPath, $ winProjectPath, $action, $config);1205 my @command = ($vcBuildPath, $project, $action, $config); 1208 1206 1209 1207 print join(" ", @command), "\n";
Note: See TracChangeset
for help on using the changeset viewer.