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

Unified Diff: pkg/unittest/lib/unittest.dart

Issue 13539003: pkg/unittest: handling of runTests being called without any tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | pkg/unittest/test/unittest_test.dart » ('j') | pkg/unittest/test/unittest_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/unittest.dart
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index 9a308ac6a77884d7d0f941ecb71061b77793e158..efe6f8d40f7535b34e12fe33d791b47535a7ab53 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -697,6 +697,7 @@ void filterTests(testFilter) {
/** Runs all queued tests, one at a time. */
void runTests() {
+ _ensureInitialized(false);
_currentTestCaseIndex = 0;
_currentGroup = '';
@@ -805,6 +806,10 @@ String _fullSpec(String spec) {
* Lazily initializes the test library if not already initialized.
*/
void ensureInitialized() {
+ _ensureInitialized(true);
+}
+
+void _ensureInitialized(bool configAutoStart) {
if (_initialized) {
return;
}
@@ -819,7 +824,7 @@ void ensureInitialized() {
}
_config.onInit();
- if (_config.autoStart) {
+ if (configAutoStart && _config.autoStart) {
// Immediately queue the suite up. It will run after a timeout (i.e. after
// main() has returned).
_defer(runTests);
« no previous file with comments | « no previous file | pkg/unittest/test/unittest_test.dart » ('j') | pkg/unittest/test/unittest_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698