| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * A simple unit test library for running tests on the VM. | 6 * A simple unit test library for running tests on the VM. |
| 7 */ | 7 */ |
| 8 #library("unittest"); | 8 #library('unittest'); |
| 9 | 9 |
| 10 #source("shared.dart"); | 10 #import('dart:io'); |
| 11 #source('shared.dart'); |
| 11 | 12 |
| 12 _platformInitialize() { | 13 _platformInitialize() { |
| 13 // Do nothing. | 14 // Do nothing. |
| 14 } | 15 } |
| 15 | 16 |
| 16 _platformDefer(void callback()) { | 17 _platformDefer(void callback()) { |
| 17 new Timer((timer) { | 18 new Timer((timer) { |
| 18 callback(); | 19 callback(); |
| 19 }, 0); | 20 }, 0); |
| 20 } | 21 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 } else if (testsFailed == 0 && testsErrors == 0) { | 45 } else if (testsFailed == 0 && testsErrors == 0) { |
| 45 print('All $testsPassed tests passed.'); | 46 print('All $testsPassed tests passed.'); |
| 46 success = true; | 47 success = true; |
| 47 } else { | 48 } else { |
| 48 print('$testsPassed PASSED, $testsFailed FAILED, $testsErrors ERRORS'); | 49 print('$testsPassed PASSED, $testsFailed FAILED, $testsErrors ERRORS'); |
| 49 } | 50 } |
| 50 | 51 |
| 51 // A non-zero exit code is used by the test infrastructure to detect failure. | 52 // A non-zero exit code is used by the test infrastructure to detect failure. |
| 52 if (!success) exit(1); | 53 if (!success) exit(1); |
| 53 } | 54 } |
| OLD | NEW |