Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: tools/testing/dart/test_progress.dart

Issue 145273024: Add support for copying coredumps to /tmp (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_progress.dart
===================================================================
--- tools/testing/dart/test_progress.dart (revision 32103)
+++ tools/testing/dart/test_progress.dart (working copy)
@@ -276,6 +276,32 @@
}
}
+
+class UnexpectedCrashDumpArchiver extends EventListener {
+ void done(TestCase test) {
+ if (test.unexpectedOutput && test.result == Expectation.CRASH) {
+ var name = "core.dart.${test.lastCommandOutput.pid}";
+ var file = new File(name);
+ if (file.existsSync()) {
+ // Find the binary - we assume this is the first part of the command
+ var binName = test.lastCommandExecuted.toString().split(' ').first;
+ var binFile = new File(binName);
+ var binBaseName = new Path(binName).filename;
+ if (binFile.existsSync()) {
+ var tmpPath = new Path(Directory.systemTemp.path);
+ var dir = new Path(TestUtils.mkdirRecursive(tmpPath,
+ new Path('coredump_${test.lastCommandOutput.pid}')).path);
+ TestUtils.copyFile(new Path(name), dir.append(name));
+ TestUtils.copyFile(new Path(binName), dir.append(binBaseName));
+ print("\nCopied core dump and binary for unexpected crash to: "
+ "$dir");
+ }
+ }
+ }
+ }
+}
+
+
class SummaryPrinter extends EventListener {
void allTestsKnown() {
if (SummaryReport.total > 0) {
@@ -284,6 +310,7 @@
}
}
+
class TimingPrinter extends EventListener {
final _command2testCases = new Map<Command, List<TestCase>>();
final _commandOutputs = new Set<CommandOutput>();
@@ -456,6 +483,7 @@
}
}
+
class TestFailurePrinter extends EventListener {
bool _printSummary;
var _formatter;
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698