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

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

Issue 2091173002: Add metadata to messages emitted by live tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 5 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/runner/engine.dart ('k') | lib/src/runner/remote_listener.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 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
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 }
OLDNEW
« no previous file with comments | « lib/src/runner/engine.dart ('k') | lib/src/runner/remote_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698