OLD | NEW |
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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:stack_trace/stack_trace.dart'; | 7 import 'package:stack_trace/stack_trace.dart'; |
8 | 8 |
9 import '../../test.dart'; | 9 import '../../test.dart'; |
10 import '../backend/group.dart'; | 10 import '../backend/group.dart'; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 return newSuite == null ? null : new Pair(newSuite, zone); | 149 return newSuite == null ? null : new Pair(newSuite, zone); |
150 })); | 150 })); |
151 } | 151 } |
152 | 152 |
153 /// Runs the test and returns the suite. | 153 /// Runs the test and returns the suite. |
154 /// | 154 /// |
155 /// Rather than emitting errors through a [LiveTest], this just pipes them | 155 /// Rather than emitting errors through a [LiveTest], this just pipes them |
156 /// through the return value. | 156 /// through the return value. |
157 Future<RunnerSuite> getSuite() async { | 157 Future<RunnerSuite> getSuite() async { |
158 var liveTest = await test.load(this); | 158 var liveTest = await test.load(this); |
159 liveTest.onPrint.listen(print); | 159 liveTest.onMessage.listen((message) => print(message.text)); |
160 await liveTest.run(); | 160 await liveTest.run(); |
161 | 161 |
162 if (liveTest.errors.isEmpty) return await suite; | 162 if (liveTest.errors.isEmpty) return await suite; |
163 | 163 |
164 var error = liveTest.errors.first; | 164 var error = liveTest.errors.first; |
165 await new Future.error(error.error, error.stackTrace); | 165 await new Future.error(error.error, error.stackTrace); |
166 throw 'unreachable'; | 166 throw 'unreachable'; |
167 } | 167 } |
168 | 168 |
169 LoadSuite filter(bool callback(Test test)) { | 169 LoadSuite filter(bool callback(Test test)) { |
170 var filtered = this.group.filter(callback); | 170 var filtered = this.group.filter(callback); |
171 if (filtered == null) filtered = new Group.root([], metadata: metadata); | 171 if (filtered == null) filtered = new Group.root([], metadata: metadata); |
172 return new LoadSuite._filtered(this, filtered); | 172 return new LoadSuite._filtered(this, filtered); |
173 } | 173 } |
174 | 174 |
175 Future close() async {} | 175 Future close() async {} |
176 } | 176 } |
OLD | NEW |