Commit 4e2c3a91 authored by aroben@apple.com's avatar aroben@apple.com
Browse files

Move code that handles a crash into a subroutine

        Reviewed by Eric Seidel.

        * Scripts/run-webkit-tests:
        (sub testCrashed): Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b19178b3
2008-04-17 Adam Roben <aroben@apple.com>
Move code that handles a crash into a subroutine
Reviewed by Eric Seidel.
* Scripts/run-webkit-tests:
(sub testCrashed): Added.
2008-04-17 Eric Seidel <eric@webkit.org>
 
Reviewed by hyatt.
......
......@@ -81,6 +81,7 @@ sub splitpath($);
sub stripExtension($);
sub isTextOnlyTest($);
sub expectedDirectoryForTest($;$;$);
sub testCrashed($$$$);
sub printFailureMessageForTest($$);
sub toURL($);
sub toWindowsPath($);
......@@ -717,22 +718,7 @@ for my $test (@tests) {
if (dumpToolDidCrash()) {
$result = "crash";
printFailureMessageForTest($test, "crashed");
my $dir = "$testResultsDirectory/$base";
$dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
mkpath $dir;
deleteExpectedAndActualResults($base);
open CRASH, ">", "$testResultsDirectory/$base-$errorTag.txt" or die;
print CRASH $error;
close CRASH;
recordActualResultsAndDiff($base, $actual);
closeDumpTool();
testCrashed($test, $base, $actual, $error);
} elsif (!defined $expected) {
if ($verbose) {
print "new " . ($resetResults ? "result" : "test") ."\n";
......@@ -1467,6 +1453,26 @@ sub expectedDirectoryForTest($;$;$)
return $isText ? $expectedDirectory : $platformHierarchy[$#platformHierarchy];
}
sub testCrashed($$$$) {
my ($test, $base, $actual, $error) = @_;
printFailureMessageForTest($test, "crashed");
my $dir = "$testResultsDirectory/$base";
$dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
mkpath $dir;
deleteExpectedAndActualResults($base);
open CRASH, ">", "$testResultsDirectory/$base-$errorTag.txt" or die;
print CRASH $error;
close CRASH;
recordActualResultsAndDiff($base, $actual);
closeDumpTool();
}
sub printFailureMessageForTest($$)
{
my ($test, $description) = @_;
......
Supports Markdown
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