| Index: lib/unittest/unittest_vm.dart
|
| diff --git a/lib/unittest/unittest_vm.dart b/lib/unittest/unittest_vm.dart
|
| index b3219398f503fdbcb647559f332d3e92087d4a5a..46881d48caff0ffe3a39e6ce77ed9317678b2913 100644
|
| --- a/lib/unittest/unittest_vm.dart
|
| +++ b/lib/unittest/unittest_vm.dart
|
| @@ -8,47 +8,17 @@
|
| #library('unittest');
|
|
|
| #import('dart:io');
|
| -#source('shared.dart');
|
| -
|
| -_platformInitialize() {
|
| - // Do nothing.
|
| -}
|
| -
|
| -_platformDefer(void callback()) {
|
| - new Timer(0, (timer) {
|
| - callback();
|
| - });
|
| -}
|
| -
|
| -_platformStartTests() {
|
| - // Do nothing.
|
| -}
|
| +#import('dart:isolate');
|
|
|
| -_platformCompleteTests(int testsPassed, int testsFailed, int testsErrors) {
|
| - // Print each test's result.
|
| - for (final test in _tests) {
|
| - print('${test.result.toUpperCase()}: ${test.description}');
|
| +#source('config.dart');
|
| +#source('shared.dart');
|
|
|
| - if (test.message != '') {
|
| - print(' ${test.message}');
|
| +class PlatformConfiguration implements Configuration {
|
| + void onDone(int passed, int failed, int errors, List<TestCase> results) {
|
| + try {
|
| + super.onDone(passed, failed, errors, results);
|
| + } catch (Exception ex) {
|
| + exit(1);
|
| }
|
| }
|
| -
|
| - // Show the summary.
|
| - print('');
|
| -
|
| - var success = false;
|
| - if (testsPassed == 0 && testsFailed == 0 && testsErrors == 0) {
|
| - print('No tests found.');
|
| - // This is considered a failure too: if this happens you probably have a
|
| - // bug in your unit tests.
|
| - } else if (testsFailed == 0 && testsErrors == 0) {
|
| - print('All $testsPassed tests passed.');
|
| - success = true;
|
| - } else {
|
| - print('$testsPassed PASSED, $testsFailed FAILED, $testsErrors ERRORS');
|
| - }
|
| -
|
| - // A non-zero exit code is used by the test infrastructure to detect failure.
|
| - if (!success) exit(1);
|
| }
|
|
|