Changeset 25015 in webkit
- Timestamp:
- Aug 11, 2007 1:37:09 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r25011 r25015 1 2007-08-11 Matt Lilek <pewtermoose@gmail.com> 2 3 Reviewed over and over and over by Adam Roben. 4 5 Bug 14740: Hierarchical layout tests and platform organization 6 http://bugs.webkit.org/show_bug.cgi?id=14740 7 8 Add support for platform-specific layout tests and results. 9 New platform structure is as follows: 10 11 * platform: Added. 12 * platform/mac: Added. 13 * mac/leopard/ -> platform/mac-leopard 14 * win/ -> platform/win 15 * qt/ -> platform/qt 16 1 17 2007-08-11 Mitz Pettel <mitz@webkit.org> 2 18 -
trunk/WebKitTools/ChangeLog
r25014 r25015 1 2007-08-11 Matt Lilek <pewtermoose@gmail.com> 2 3 Reviewed over and over and over by Adam Roben. 4 5 Bug 14740: Hierarchical layout tests and platform organization 6 http://bugs.webkit.org/show_bug.cgi?id=14740 7 8 Add support for platform-specific layout tests and results. 9 10 * Scripts/run-webkit-tests: 11 1 12 2007-08-11 David Kilzer <ddkilzer@webkit.org> 2 13 -
trunk/WebKitTools/Scripts/run-webkit-tests
r25013 r25015 3 3 # Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved. 4 4 # Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 5 # Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com) 5 6 # 6 7 # Redistribution and use in source and binary forms, with or without … … 85 86 sub deleteExpectedAndActualResults($); 86 87 sub recordActualResultsAndDiff($$); 88 sub buildPlatformHierarchy(); 87 89 88 90 # Argument handling … … 94 96 my $ignoreTests = ''; 95 97 my $launchSafari = 1; 98 my $platform; 96 99 my $pixelTests = ''; 97 100 my $quiet = ''; … … 119 122 my $errorTag = "stderr"; 120 123 124 my $useWinSkipped = 0; 125 if (isLeopard()) { 126 $platform = "mac-leopard"; 127 } elsif (isOSX()) { 128 $platform = "mac"; 129 } elsif (isQt()) { 130 $platform = "qt"; 131 } elsif (isCygwin()) { 132 # FIXME: The two lines below are a hack to represent that on Windows we 133 # currently want to 134 # 1) use the Mac expected results 135 # 2) use the Windows Skipped file 136 # Once Windows has its own results and/or we come up with a better way of 137 # sharing results with Mac, we should set $platform to "win" and get rid of 138 # $useWinSkipped entirely. 139 $platform = "mac"; 140 $useWinSkipped = 1; 141 } 142 143 if (!defined($platform)) { 144 print "WARNING: Your platform is not recognized. Any platform-specific results will be generated in platform/undefined.\n"; 145 $platform = "undefined"; 146 } 147 121 148 my $programName = basename($0); 122 149 my $launchSafariDefault = $launchSafari ? "launch" : "do not launch"; … … 135 162 --[no-]new-test-results Generate results for new tests 136 163 -p|--pixel-tests Enable pixel tests 164 --platform Override the detected platform to use for tests and results (default: $platform) 137 165 --port Web server port to use with http tests 138 166 -q|--quiet Less verbose output … … 166 194 'leaks|l' => \$shouldCheckLeaks, 167 195 'pixel-tests|p' => \$pixelTests, 196 'platform=s' => \$platform, 168 197 'port=i' => \$httpdPort, 169 198 'quiet|q' => \$quiet, … … 246 275 my $layoutTestsName = "LayoutTests"; 247 276 my $testDirectory = File::Spec->rel2abs($layoutTestsName); 248 my $platformTestDirectory = $testDirectory;249 277 my $expectedDirectory = $testDirectory; 250 if (isLeopard()) { 251 $platformTestDirectory = "$testDirectory/mac/leopard"; 252 } elsif (isQt()) { 253 $expectedDirectory = File::Spec->rel2abs("LayoutTests/qt/"); 254 $platformTestDirectory = $expectedDirectory; 255 } elsif (isCygwin()) { 256 $expectedDirectory = $testDirectory; 257 $platformTestDirectory = File::Spec->rel2abs("LayoutTests/win/"); 258 } 278 my $platformTestDirectory = catdir($testDirectory, "platform", $platform); 279 my @platformHierarchy = buildPlatformHierarchy(); 259 280 260 281 $expectedDirectory = $ENV{"WebKitExpectedTestResultsDirectory"} if $ENV{"WebKitExpectedTestResultsDirectory"}; … … 275 296 276 297 my %ignoredFiles = (); 277 my %ignoredDirectories = ();298 my %ignoredDirectories = map { $_ => 1 } qw(platform); 278 299 my %ignoredLocalDirectories = map { $_ => 1 } qw(.svn _svn resources); 279 300 my %supportedFileExtensions = map { $_ => 1 } qw(html shtml xml xhtml pl php); … … 297 318 } 298 319 299 if (!$ignoreSkipped && open SKIPPED, "<", "$platformTestDirectory/Skipped") { 300 if ($verbose && !$skippedOnly) { 301 print "Skipped tests:\n"; 302 } 303 while (<SKIPPED>) { 304 my $skipped = $_; 305 chomp $skipped; 306 $skipped =~ s/^ +//; 307 $skipped =~ s/ +$//; 308 if ($skipped && $skipped !~ /^#/) { 309 if ($skippedOnly) { 310 push(@ARGV, $skipped); 311 } else { 312 if ($verbose) { 313 print " $skipped\n"; 320 if (!$ignoreSkipped) { 321 # FIXME: See comments where $platform is set for info on why this is needed. 322 my @skippedHierarchy; 323 if ($useWinSkipped) { 324 @skippedHierarchy = (catdir($testDirectory, "platform", "win")); 325 } else { 326 @skippedHierarchy = @platformHierarchy; 327 } 328 329 foreach my $level (@skippedHierarchy) { 330 if (open SKIPPED, "<", "$level/Skipped") { 331 if ($verbose && !$skippedOnly) { 332 my ($dir, $name) = splitpath($level); 333 print "Skipped tests in $name:\n"; 334 } 335 336 while (<SKIPPED>) { 337 my $skipped = $_; 338 chomp $skipped; 339 $skipped =~ s/^ +//; 340 $skipped =~ s/ +$//; 341 if ($skipped && $skipped !~ /^#/) { 342 if ($skippedOnly) { 343 push(@ARGV, $skipped); 344 } else { 345 if ($verbose) { 346 print " $skipped\n"; 347 } 348 processIgnoreTests($skipped); 349 } 314 350 } 315 processIgnoreTests($skipped);316 351 } 317 }318 }319 close SKIPPED;352 close SKIPPED; 353 } 354 } 320 355 } 321 356 … … 351 386 } elsif (-d $fullPath) { 352 387 find({ preprocess => $directoryFilter, wanted => $fileFilter }, $fullPath); 388 389 for my $level (@platformHierarchy) { 390 my $platformPath = catfile($level, $test); 391 find({ preprocess => $directoryFilter, wanted => $fileFilter }, $platformPath) if (-d $platformPath); 392 } 353 393 } else { 354 394 print "test $test not found\n"; … … 357 397 if (!scalar @ARGV) { 358 398 find({ preprocess => $directoryFilter, wanted => $fileFilter }, $testDirectory); 399 400 for my $level (@platformHierarchy) { 401 find({ preprocess => $directoryFilter, wanted => $fileFilter }, $level); 402 } 359 403 } 360 404 … … 477 521 my $expectedDir = expectedDirectoryForTest($base); 478 522 if (isQt() && $isText) { 479 $expectedDir = $testDirectory;523 $expectedDir = $testDirectory; 480 524 } 481 525 … … 509 553 510 554 if ($pixelTests) { 511 die "Pixel tests currently don't work when using a custom expected test results directory" if $testDirectory ne $expectedDir;512 513 555 my $actualHash = ""; 514 556 my $expectedHash = ""; 515 557 my $actualPNGSize = 0; 558 516 559 while (<IN>) { 517 560 last if /#EOF/; … … 526 569 } 527 570 528 if ($expectedHash ne $actualHash && -f "$ testDirectory/$base-$expectedTag.png") {529 my $expectedPNGSize = -s "$ testDirectory/$base-$expectedTag.png";571 if ($expectedHash ne $actualHash && -f "$expectedDir/$base-$expectedTag.png") { 572 my $expectedPNGSize = -s "$expectedDir/$base-$expectedTag.png"; 530 573 my $expectedPNG = ""; 531 open EXPECTEDPNG, "$ testDirectory/$base-$expectedTag.png";574 open EXPECTEDPNG, "$expectedDir/$base-$expectedTag.png"; 532 575 read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize); 533 576 … … 551 594 } 552 595 553 if ($actualPNGSize && ($resetResults || !-f "$testDirectory/$base-$expectedTag.png")) { 554 open EXPECTED, ">", "$testDirectory/$base-expected.png" or die "could not create $testDirectory/$base-expected.png\n"; 596 if ($actualPNGSize && ($resetResults || !-f "$expectedDir/$base-$expectedTag.png")) { 597 mkpath(catfile($expectedDir, dirname($base))) if $testDirectory ne $expectedDir; 598 open EXPECTED, ">", "$expectedDir/$base-expected.png" or die "could not create $expectedDir/$base-expected.png\n"; 555 599 print EXPECTED $actualPNG; 556 600 close EXPECTED; … … 558 602 559 603 # update the expected hash if the image diff said that there was no difference 560 if ($actualHash ne "" && ($resetResults || !-f "$ testDirectory/$base-$expectedTag.checksum")) {561 open EXPECTED, ">", "$ testDirectory/$base-$expectedTag.checksum" or die "could not create $testDirectory/$base-$expectedTag.checksum\n";604 if ($actualHash ne "" && ($resetResults || !-f "$expectedDir/$base-$expectedTag.checksum")) { 605 open EXPECTED, ">", "$expectedDir/$base-$expectedTag.checksum" or die "could not create $expectedDir/$base-$expectedTag.checksum\n"; 562 606 print EXPECTED $actualHash; 563 607 close EXPECTED; … … 661 705 print "$test -> "; 662 706 } 663 print "new \n";707 print "new (results generated in $expectedDir)\n"; 664 708 $atLineStart = 1; 665 709 } … … 945 989 "gldGetString" # leak in OpenGL, Radar 5013699 946 990 ); 947 991 push @typesToExclude, ( 948 992 "THRD", # bug in 'leaks', Radar 3387783 949 993 "DRHT" # ditto (endian little hate i) … … 1259 1303 { 1260 1304 my ($base) = @_; 1261 return (-f "$platformTestDirectory/$base-$expectedTag.txt") ? $platformTestDirectory : $expectedDirectory; 1305 1306 foreach my $level (@platformHierarchy) { 1307 return $level if (-f "$level/$base-$expectedTag.txt"); 1308 } 1309 1310 return $expectedDirectory if (-f "$expectedDirectory/$base-$expectedTag.txt"); 1311 1312 return $platformHierarchy[$#platformHierarchy]; 1262 1313 } 1263 1314 … … 1382 1433 system "diff -u \"$testResultsDirectory/$base-$expectedTag.txt\" \"$testResultsDirectory/$base-$actualTag.txt\" > \"$testResultsDirectory/$base-$diffsTag.txt\""; 1383 1434 } 1435 1436 sub buildPlatformHierarchy() 1437 { 1438 mkpath($platformTestDirectory) if ($platform eq "undefined" && !-d "$platformTestDirectory"); 1439 1440 my @platforms = split('-', $platformTestDirectory); 1441 my @hierarchy; 1442 for (my $i=0; $i < @platforms; $i++) { 1443 my $scoped = join('-', @platforms[0..($#platforms - $i)]); 1444 print "scoped = $scoped\n"; 1445 push(@hierarchy, $scoped) if (-d $scoped); 1446 } 1447 1448 return @hierarchy; 1449 }
Note: See TracChangeset
for help on using the changeset viewer.