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; |