| Index: pkg/unittest/lib/src/config.dart
|
| diff --git a/pkg/unittest/lib/src/config.dart b/pkg/unittest/lib/src/config.dart
|
| index cd0f365b3be5d613fdedfb348fde7b4010411d3b..f0cf526e882baff7b58aebc114a0d545c795076f 100644
|
| --- a/pkg/unittest/lib/src/config.dart
|
| +++ b/pkg/unittest/lib/src/config.dart
|
| @@ -12,6 +12,9 @@ part of unittest;
|
| */
|
|
|
| class Configuration {
|
| + // The VM won't shut down if a receive port is open. Use this to make sure
|
| + // we correctly wait for asynchronous tests.
|
| + ReceivePort _receivePort;
|
| TestCase currentTestCase = null;
|
|
|
| /**
|
| @@ -39,6 +42,7 @@ class Configuration {
|
| * wait until they are done.
|
| */
|
| void onStart() {
|
| + _receivePort = new ReceivePort();
|
| _postMessage('unittest-suite-wait-for-done');
|
| }
|
|
|
| @@ -96,7 +100,8 @@ class Configuration {
|
| String uncaughtError) {
|
| // Print each test's result.
|
| for (final t in _tests) {
|
| - print('${t.result.toUpperCase()}: ${t.description}');
|
| + var resultString = "${t.result}".toUpperCase();
|
| + print('$resultString: ${t.description}');
|
|
|
| if (t.message != '') {
|
| print(_indent(t.message));
|
| @@ -126,6 +131,7 @@ class Configuration {
|
|
|
| if (success) {
|
| _postMessage('unittest-suite-success');
|
| + _receivePort.close();
|
| } else {
|
| throw new Exception('Some tests failed.');
|
| }
|
|
|