+2011-02-03 Adam Roben <aroben@apple.com>
+
+ Add links to Windows crash logs in results.html
+
+ Fixes <http://webkit.org/b/53718> run-webkit-tests should link to Windows crash logs in
+ results.html
+
+ Reviewed by David Kilzer.
+
+ * Scripts/old-run-webkit-tests:
+ (top level): Added $crashLogTag and $windowsCrashLogFilePrefix (which came from
+ createDebuggerCommandFile).
+ (testCrashedOrTimedOut): If the test crashed, capture any saved crash log after the dump
+ tool has exited.
+ (captureSavedCrashLog): Added. Finds the crash log for the test that just crashed and moves
+ it into the test results directory tree. Only implemented for Cygwin currently.
+ (findNewestFileMatchingGlob): Added. Does what it says.
+ (htmlForResultsSection): Only link to files that exist.
+ (linksForErrorTest): Add a link to the crash log.
+ (deleteExpectedAndActualResults): Delete any old crash log for this test.
+ (createDebuggerCommandFile): Use the new $windowsCrashLogFilePrefix constant instead of
+ hardcoding it here.
+
2011-02-03 Adam Roben <aroben@apple.com>
Tell the debugger the path to the WebKit source tree when saving a crash log
sub buildPlatformResultHierarchy();
sub buildPlatformTestHierarchy(@);
+sub captureSavedCrashLog($);
sub checkPythonVersion();
sub closeCygpaths();
sub closeDumpTool();
sub epiloguesAndPrologues($$);
sub expectedDirectoryForTest($;$;$);
sub fileNameWithNumber($$);
+sub findNewestFileMatchingGlob($);
sub htmlForResultsSection(\@$&);
sub isTextOnlyTest($);
sub launchWithEnv(\@\%);
my $prettyDiffTag = "pretty-diff";
my $diffsTag = "diffs";
my $errorTag = "stderr";
+my $crashLogTag = "crash-log";
+
+my $windowsCrashLogFilePrefix = "CrashLog";
# These are defined here instead of closer to where they are used so that they
# will always be accessible from the END block that uses them, even if the user
kill 9, $dumpToolPID unless $didCrash;
closeDumpTool();
-
+
+ captureSavedCrashLog($base) if $didCrash;
+
return unless isCygwin() && !$didCrash && $base =~ /^http/;
# On Cygwin, http tests timing out can be a symptom of a non-responsive httpd.
# If we timed out running an http test, try restarting httpd.
configureAndOpenHTTPDIfNeeded();
}
+sub captureSavedCrashLog($)
+{
+ my ($base) = @_;
+
+ my $crashLog;
+ if (isCygwin()) {
+ # We assume that the newest crash log in $testResultsDirectory is the one that corresponds to the crash that just occurred.
+ my $newestCrashLog = findNewestFileMatchingGlob(File::Spec->catfile($testResultsDirectory, $windowsCrashLogFilePrefix . "*.txt"));
+
+ # The crash log must have been created after this script started running.
+ $crashLog = $newestCrashLog if -M $newestCrashLog < 0;
+ }
+ return unless $crashLog;
+
+ move($crashLog, File::Spec->catfile($testResultsDirectory, "$base-$crashLogTag.txt"));
+}
+
+sub findNewestFileMatchingGlob($)
+{
+ my ($glob) = @_;
+
+ my @paths = glob $glob;
+ return unless @paths;
+
+ my @pathsAndTimes = map { [$_, -M $_] } @paths;
+ @pathsAndTimes = sort { $b->[1] <=> $a->[1] } @pathsAndTimes;
+ return $pathsAndTimes[$#pathsAndTimes]->[0];
+}
+
sub printFailureMessageForTest($$)
{
my ($test, $description) = @_;
push @html, "<tr>";
push @html, "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$test</a></td>";
foreach my $link (@{&{$linkGetter}($test)}) {
- push @html, "<td><a href=\"$link->{href}\">$link->{text}</a></td>";
+ push @html, "<td>";
+ push @html, "<a href=\"$link->{href}\">$link->{text}</a>" if -f File::Spec->catfile($testResultsDirectory, $link->{href});
+ push @html, "</td>";
}
push @html, "</tr>";
}
push @links, @{linksForExpectedAndActualResults($base)};
push @links, { href => "$base-$errorTag.txt", text => "stderr" };
+ push @links, { href => "$base-$crashLogTag.txt", text => "crash log" };
return \@links;
}
unlink "$testResultsDirectory/$base-$actualTag.txt";
unlink "$testResultsDirectory/$base-$diffsTag.txt";
unlink "$testResultsDirectory/$base-$errorTag.txt";
+ unlink "$testResultsDirectory/$base-$crashLogTag.txt";
}
sub recordActualResultsAndDiff($$)
return unless isCygwin();
my @commands = (
- '.logopen /t "' . toWindowsPath($testResultsDirectory) . '\CrashLog.txt"',
+ '.logopen /t "' . toWindowsPath($testResultsDirectory) . "\\" . $windowsCrashLogFilePrefix . '.txt"',
'.srcpath "' . toWindowsPath(sourceDir()) . '"',
'!analyze -vv',
'~*kpn',