Chromium Code Reviews| Index: lib/unittest/unittest_vm.dart |
| diff --git a/lib/unittest/unittest_vm.dart b/lib/unittest/unittest_vm.dart |
| index b3219398f503fdbcb647559f332d3e92087d4a5a..31aacc914125c6ed19af9809fd6cd10d42d0ec18 100644 |
| --- a/lib/unittest/unittest_vm.dart |
| +++ b/lib/unittest/unittest_vm.dart |
| @@ -8,47 +8,42 @@ |
| #library('unittest'); |
| #import('dart:io'); |
| -#source('shared.dart'); |
| - |
| -_platformInitialize() { |
| - // Do nothing. |
| -} |
| - |
| -_platformDefer(void callback()) { |
| - new Timer(0, (timer) { |
| - callback(); |
| - }); |
| -} |
| +#import('dart:isolate'); |
| -_platformStartTests() { |
| - // Do nothing. |
| -} |
| +#source('config.dart'); |
| +#source('shared.dart'); |
| -_platformCompleteTests(int testsPassed, int testsFailed, int testsErrors) { |
| - // Print each test's result. |
| - for (final test in _tests) { |
| - print('${test.result.toUpperCase()}: ${test.description}'); |
| +class PlatformConfiguration implements Configuration { |
|
Bob Nystrom
2012/04/10 20:04:25
StandaloneConfiguration
Siggi Cherem (dart-lang)
2012/04/10 21:40:18
see other comments.
|
| + void onInit() {} |
|
Bob Nystrom
2012/04/10 20:04:25
Remove this.
Siggi Cherem (dart-lang)
2012/04/10 21:40:18
Done - :(, forgot to do a git cl upload
|
| + void onStart() {} |
|
Bob Nystrom
2012/04/10 20:04:25
And this.
Siggi Cherem (dart-lang)
2012/04/10 21:40:18
Done.
|
| + void onTestResult(TestCase testCase) {} |
| + void onDone(int testsPassed, int testsFailed, int testsErrors, |
| + List<TestCase> results) { |
| + // Print each test's result. |
| + for (final test in _tests) { |
| + print('${test.result.toUpperCase()}: ${test.description}'); |
| + |
| + if (test.message != '') { |
| + print(' ${test.message}'); |
| + } |
| + } |
| - if (test.message != '') { |
| - print(' ${test.message}'); |
| + // 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'); |
| } |
| - } |
| - // 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. |
|
eub
2012/04/10 18:06:02
80 cols
Siggi Cherem (dart-lang)
2012/04/10 21:40:18
Done.
|
| + if (!success) exit(1); |
| } |
| - |
| - // A non-zero exit code is used by the test infrastructure to detect failure. |
| - if (!success) exit(1); |
| } |