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

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
Index: tools/testing/dart/test_progress.dart
===================================================================
--- tools/testing/dart/test_progress.dart (revision 32065)
+++ tools/testing/dart/test_progress.dart (working copy)
@@ -276,6 +276,31 @@
}
}
+
+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 (file.existsSync()) {
Bill Hesse 2014/01/29 07:01:52 I think this is always true, since it was true abo
ricow1 2014/01/29 09:41:38 yes, thank you
+ var dir = new Path(TestUtils.mkdirRecursive(new Path('/tmp'),
Bill Hesse 2014/01/29 07:01:52 We don't want to use Directory.systemTemp for this
ricow1 2014/01/29 09:41:38 Done.
+ new Path('coredump_${test.lastCommandOutput.pid}')).path);
+ TestUtils.copyFile(new Path(name), dir.append(name));
+ TestUtils.copyFile(new Path(binName), dir.append(binBaseName));
Bill Hesse 2014/01/29 07:01:52 I hate to see all these new uses of Path go in, bu
ricow1 2014/01/29 09:41:38 Yes I thought about that, but our copy functions t
+ print("\nCopied core dump and binary for unexpected crash to: "
+ "$dir");
+ }
+ }
+ }
+ }
+}
+
+
class SummaryPrinter extends EventListener {
void allTestsKnown() {
if (SummaryReport.total > 0) {
@@ -456,6 +481,7 @@
}
}
+
class TestFailurePrinter extends EventListener {
bool _printSummary;
var _formatter;

Powered by Google App Engine
This is Rietveld 408576698