Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: frog/tests/frog/src/unittest_node.dart

Issue 10031022: step 1 in making unittest platform independent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/unittest/config.dart » ('j') | lib/unittest/unittest_html.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tests/frog/src/unittest_node.dart
diff --git a/frog/tests/frog/src/unittest_node.dart b/frog/tests/frog/src/unittest_node.dart
index 815150cc74936d1f2a5c7e0228aaad7a6ba7babd..c089a737665b3493af5f8e2a4e17dcd284da68f4 100644
--- a/frog/tests/frog/src/unittest_node.dart
+++ b/frog/tests/frog/src/unittest_node.dart
@@ -7,40 +7,18 @@
// node library.
#library("unittest");
+#import('dart:isolate');
#import('../../../lib/node/node.dart');
-#source('../../../../lib/unittest/shared.dart');
-
-_platformInitialize() {
- // Do nothing.
-}
-_platformDefer(void callback()) {
- setTimeout(callback, 0);
-}
-
-_platformStartTests() {
- // Do nothing.
-}
-
-_platformCompleteTests(int testsPassed, int testsFailed, int testsErrors) {
- // Print each test's result.
- for (final test in _tests) {
- print('${test.result.toUpperCase()}: ${test.description}');
+#source('../../../../lib/unittest/config.dart');
+#source('../../../../lib/unittest/shared.dart');
- if (test.message != '') {
- print(' ${test.message}');
+class PlatformConfiguration extends Configuration {
+ void onDone(int passed, int failed, int errors, List<TestCase> results) {
+ try {
+ super.onDone(passed, failed, errors, results);
+ } catch (Exception e) {
+ process.exit(1);
}
}
-
- // Show the summary.
- print('');
-
- if (testsPassed == 0 && testsFailed == 0 && testsErrors == 0) {
- print('No tests found.');
- } else if (testsFailed == 0 && testsErrors == 0) {
- print('All $testsPassed tests passed.');
- } else {
- print('$testsPassed PASSED, $testsFailed FAILED, $testsErrors ERRORS');
- process.exit(1);
- }
}
« no previous file with comments | « no previous file | lib/unittest/config.dart » ('j') | lib/unittest/unittest_html.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698