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

Side by Side Diff: lib/src/runner/engine.dart

Issue 1100873005: Add a --reporter flag and expose the expanded reporter. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 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 unified diff | Download patch
« no previous file with comments | « lib/src/executable.dart ('k') | lib/src/runner/reporter/compact.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library test.runner.engine; 5 library test.runner.engine;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:pool/pool.dart'; 10 import 'package:pool/pool.dart';
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 var controller; 73 var controller;
74 controller = new LiveTestController(suite, test, () { 74 controller = new LiveTestController(suite, test, () {
75 controller.setState(const State(Status.running, Result.success)); 75 controller.setState(const State(Status.running, Result.success));
76 controller.setState(const State(Status.complete, Result.success)); 76 controller.setState(const State(Status.complete, Result.success));
77 controller.completer.complete(); 77 controller.completer.complete();
78 }, () {}); 78 }, () {});
79 return controller.liveTest; 79 return controller.liveTest;
80 } 80 }
81 81
82 /// Creates an [Engine] that will run all tests in [suites]. 82 /// Creates an [Engine] that will run all tests in [suites].
83 ///
84 /// [concurrency] controls how many suites are run at once.
83 Engine(Iterable<Suite> suites, {int concurrency}) 85 Engine(Iterable<Suite> suites, {int concurrency})
84 : _liveTestsBySuite = _computeLiveTestsBySuite(suites), 86 : _liveTestsBySuite = _computeLiveTestsBySuite(suites),
85 _pool = new Pool(concurrency == null ? 1 : concurrency); 87 _pool = new Pool(concurrency == null ? 1 : concurrency);
86 88
87 /// Runs all tests in all suites defined by this engine. 89 /// Runs all tests in all suites defined by this engine.
88 /// 90 ///
89 /// This returns `true` if all tests succeed, and `false` otherwise. It will 91 /// This returns `true` if all tests succeed, and `false` otherwise. It will
90 /// only return once all tests have finished running. 92 /// only return once all tests have finished running.
91 Future<bool> run() { 93 Future<bool> run() {
92 if (_runCalled) { 94 if (_runCalled) {
(...skipping 25 matching lines...) Expand all
118 /// engine should release any resources it has allocated. 120 /// engine should release any resources it has allocated.
119 /// 121 ///
120 /// Any actively-running tests are also closed. VM tests are allowed to finish 122 /// Any actively-running tests are also closed. VM tests are allowed to finish
121 /// running so that any modifications they've made to the filesystem can be 123 /// running so that any modifications they've made to the filesystem can be
122 /// cleaned up. 124 /// cleaned up.
123 Future close() { 125 Future close() {
124 _closed = true; 126 _closed = true;
125 return Future.wait(liveTests.map((liveTest) => liveTest.close())); 127 return Future.wait(liveTests.map((liveTest) => liveTest.close()));
126 } 128 }
127 } 129 }
OLDNEW
« no previous file with comments | « lib/src/executable.dart ('k') | lib/src/runner/reporter/compact.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698