| Index: pkg/unittest/lib/src/config.dart
|
| diff --git a/pkg/unittest/lib/src/config.dart b/pkg/unittest/lib/src/config.dart
|
| index 3bbd7c4cf15db9377265f158f689017665f8d2e0..e01d9335a679b773aa6bb15841da916fef4dbf07 100644
|
| --- a/pkg/unittest/lib/src/config.dart
|
| +++ b/pkg/unittest/lib/src/config.dart
|
| @@ -33,19 +33,17 @@ class Configuration {
|
| * Called as soon as the unittest framework becomes initialized. This is done
|
| * even before tests are added to the test framework. It might be used to
|
| * determine/debug errors that occur before the test harness starts executing.
|
| + * It is also used to tell the vm or browser that tests are going to be run
|
| + * asynchronously and that the process should wait until they are done.
|
| */
|
| - void onInit() {}
|
| -
|
| - /**
|
| - * Called as soon as the unittest framework starts running. Used commonly to
|
| - * tell the vm or browser that tests are still running and the process should
|
| - * wait until they are done.
|
| - */
|
| - void onStart() {
|
| + void onInit() {
|
| _receivePort = new ReceivePort();
|
| _postMessage('unittest-suite-wait-for-done');
|
| }
|
|
|
| + /** Called as soon as the unittest framework starts running. */
|
| + void onStart() {}
|
| +
|
| /**
|
| * Called when each test starts. Useful to show intermediate progress on
|
| * a test suite.
|
| @@ -129,10 +127,11 @@ class Configuration {
|
| print('$passed PASSED, $failed FAILED, $errors ERRORS');
|
| }
|
|
|
| - _receivePort.close();
|
| if (success) {
|
| _postMessage('unittest-suite-success');
|
| + _receivePort.close();
|
| } else {
|
| + _receivePort.close();
|
| throw new Exception('Some tests failed.');
|
| }
|
| }
|
|
|