Commit 95b313c4 authored by mrowe@apple.com's avatar mrowe@apple.com

Teach run-webkit-tests to always store the actual results in the results directory for new tests.

Reviewed by Adam Treat and Jon Honeycutt.

This allows us to give a working link to the results from the result summary page, even if we're
not generating new results in to the tree.

* Scripts/run-webkit-tests:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 63b2cff9
2009-07-30 Mark Rowe <mrowe@apple.com>
Reviewed by Adam Treat and Jon Honeycutt.
Teach run-webkit-tests to always store the actual results in the results directory for new tests.
This allows us to give a working link to the results from the result summary page, even if we're
not generating new results in to the tree.
* Scripts/run-webkit-tests:
2009-07-30 Mark Rowe <mrowe@apple.com> 2009-07-30 Mark Rowe <mrowe@apple.com>
Add a Qt Linux build bot. Add a Qt Linux build bot.
......
...@@ -822,7 +822,8 @@ for my $test (@tests) { ...@@ -822,7 +822,8 @@ for my $test (@tests) {
writeToFile("$expectedDir/$expectedFileName", $actual); writeToFile("$expectedDir/$expectedFileName", $actual);
} }
deleteExpectedAndActualResults($base); deleteExpectedAndActualResults($base);
if ($generateNewResults && !$resetResults) { recordActualResultsAndDiff($base, $actual);
if (!$resetResults) {
# Always print the file name for new tests, as they will probably need some manual inspection. # Always print the file name for new tests, as they will probably need some manual inspection.
# in verbose mode we already printed the test case, so no need to do it again. # in verbose mode we already printed the test case, so no need to do it again.
unless ($verbose) { unless ($verbose) {
...@@ -830,7 +831,11 @@ for my $test (@tests) { ...@@ -830,7 +831,11 @@ for my $test (@tests) {
print "$test -> "; print "$test -> ";
} }
my $resultsDir = catdir($expectedDir, dirname($base)); my $resultsDir = catdir($expectedDir, dirname($base));
print "new (results generated in $resultsDir)\n"; if ($generateNewResults) {
print "new (results generated in $resultsDir)\n";
} else {
print "new\n";
}
$atLineStart = 1; $atLineStart = 1;
} }
} elsif ($actual eq $expected && $diffResult eq "passed") { } elsif ($actual eq $expected && $diffResult eq "passed") {
...@@ -1748,12 +1753,13 @@ sub linksForNewTest ...@@ -1748,12 +1753,13 @@ sub linksForNewTest
my @links = (); my @links = ();
my $base = stripExtension($test); my $base = stripExtension($test);
my $expectedResultPath = $expectedResultPaths{$base}; my $expectedResultPath = $expectedResultPaths{$base};
my $expectedResultPathMinusExtension = stripExtension($expectedResultPath); my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
push @links, { href => toURL($expectedResultPath), text => "results" }; push @links, { href => "$base-$actualTag$expectedResultExtension", text => "result" };
if ($pixelTests && -f "$expectedResultPathMinusExtension.png") { if ($pixelTests && $imagesPresent{$base}) {
push @links, { href => toURL("$expectedResultPathMinusExtension.png"), text => "image" }; push @links, { href => "$base-$expectedTag.png", text => "image" };
} }
return \@links; return \@links;
...@@ -1779,7 +1785,13 @@ sub recordActualResultsAndDiff($$) ...@@ -1779,7 +1785,13 @@ sub recordActualResultsAndDiff($$)
my $actualResultsPath = "$testResultsDirectory/$base-$actualTag$expectedResultExtension"; my $actualResultsPath = "$testResultsDirectory/$base-$actualTag$expectedResultExtension";
my $copiedExpectedResultsPath = "$testResultsDirectory/$base-$expectedTag$expectedResultExtension"; my $copiedExpectedResultsPath = "$testResultsDirectory/$base-$expectedTag$expectedResultExtension";
writeToFile("$actualResultsPath", $actualResults); writeToFile("$actualResultsPath", $actualResults);
copy("$expectedResultPath", "$copiedExpectedResultsPath");
if (-f $expectedResultPath) {
copy("$expectedResultPath", "$copiedExpectedResultsPath");
} else {
open EMPTY, ">$copiedExpectedResultsPath";
close EMPTY;
}
my $diffOuputBasePath = "$testResultsDirectory/$base"; my $diffOuputBasePath = "$testResultsDirectory/$base";
my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt"; my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment