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

Unified Diff: client/testing/unittest/unittest_node.dart

Issue 8742025: Add unittest entrypoint for node/frog. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/testing/unittest/unittest_node.dart
diff --git a/client/testing/unittest/unittest_node.dart b/client/testing/unittest/unittest_node.dart
new file mode 100644
index 0000000000000000000000000000000000000000..108eb91bce500601485a6330768735dd529f2452
--- /dev/null
+++ b/client/testing/unittest/unittest_node.dart
@@ -0,0 +1,46 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * A simple unit test entrypoint for running tests on node compiled with frog.
+ */
+#library("unittest");
+
+#import('../../../frog/lib/node/node.dart');
+
+#source("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}');
+
+ if (test.message != '') {
+ print(' ${test.message}');
+ }
+ }
+
+ // 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');
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698