From 95b313c479b888047c96fda0af1220f9fa4991d5 Mon Sep 17 00:00:00 2001 From: "mrowe@apple.com" Date: Thu, 30 Jul 2009 22:54:38 +0000 Subject: [PATCH] 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 --- WebKitTools/ChangeLog | 10 ++++++++++ WebKitTools/Scripts/run-webkit-tests | 26 +++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 615d0c5cc41..e6c25464ebd 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,13 @@ +2009-07-30 Mark Rowe + + 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 Add a Qt Linux build bot. diff --git a/WebKitTools/Scripts/run-webkit-tests b/WebKitTools/Scripts/run-webkit-tests index 5ba58ac83f8..f1b2834394e 100755 --- a/WebKitTools/Scripts/run-webkit-tests +++ b/WebKitTools/Scripts/run-webkit-tests @@ -822,7 +822,8 @@ for my $test (@tests) { writeToFile("$expectedDir/$expectedFileName", $actual); } 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. # in verbose mode we already printed the test case, so no need to do it again. unless ($verbose) { @@ -830,7 +831,11 @@ for my $test (@tests) { print "$test -> "; } 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; } } elsif ($actual eq $expected && $diffResult eq "passed") { @@ -1748,12 +1753,13 @@ sub linksForNewTest my @links = (); my $base = stripExtension($test); + my $expectedResultPath = $expectedResultPaths{$base}; - my $expectedResultPathMinusExtension = stripExtension($expectedResultPath); + my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$}); - push @links, { href => toURL($expectedResultPath), text => "results" }; - if ($pixelTests && -f "$expectedResultPathMinusExtension.png") { - push @links, { href => toURL("$expectedResultPathMinusExtension.png"), text => "image" }; + push @links, { href => "$base-$actualTag$expectedResultExtension", text => "result" }; + if ($pixelTests && $imagesPresent{$base}) { + push @links, { href => "$base-$expectedTag.png", text => "image" }; } return \@links; @@ -1779,7 +1785,13 @@ sub recordActualResultsAndDiff($$) my $actualResultsPath = "$testResultsDirectory/$base-$actualTag$expectedResultExtension"; my $copiedExpectedResultsPath = "$testResultsDirectory/$base-$expectedTag$expectedResultExtension"; writeToFile("$actualResultsPath", $actualResults); - copy("$expectedResultPath", "$copiedExpectedResultsPath"); + + if (-f $expectedResultPath) { + copy("$expectedResultPath", "$copiedExpectedResultsPath"); + } else { + open EMPTY, ">$copiedExpectedResultsPath"; + close EMPTY; + } my $diffOuputBasePath = "$testResultsDirectory/$base"; my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt"; -- GitLab