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 library unittest.runner.reporter.no_io_compact; | 5 library unittest.runner.reporter.no_io_compact; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import '../../backend/live_test.dart'; | 9 import '../../backend/live_test.dart'; |
10 import '../../backend/state.dart'; | 10 import '../../backend/state.dart'; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 _progressLine(_description(liveTest)); | 87 _progressLine(_description(liveTest)); |
88 }); | 88 }); |
89 | 89 |
90 liveTest.onError.listen((error) { | 90 liveTest.onError.listen((error) { |
91 if (liveTest.state.status != Status.complete) return; | 91 if (liveTest.state.status != Status.complete) return; |
92 | 92 |
93 _progressLine(_description(liveTest)); | 93 _progressLine(_description(liveTest)); |
94 print(indent(error.error.toString())); | 94 print(indent(error.error.toString())); |
95 print(indent(terseChain(error.stackTrace).toString())); | 95 print(indent(terseChain(error.stackTrace).toString())); |
96 }); | 96 }); |
| 97 |
| 98 liveTest.onPrint.listen((line) { |
| 99 _progressLine(_description(liveTest)); |
| 100 print(line); |
| 101 }); |
97 }); | 102 }); |
98 } | 103 } |
99 | 104 |
100 /// Runs all tests in all provided suites. | 105 /// Runs all tests in all provided suites. |
101 /// | 106 /// |
102 /// This returns `true` if all tests succeed, and `false` otherwise. It will | 107 /// This returns `true` if all tests succeed, and `false` otherwise. It will |
103 /// only return once all tests have finished running. | 108 /// only return once all tests have finished running. |
104 Future<bool> run() { | 109 Future<bool> run() { |
105 if (_stopwatch.isRunning) { | 110 if (_stopwatch.isRunning) { |
106 throw new StateError("CompactReporter.run() may not be called more than " | 111 throw new StateError("CompactReporter.run() may not be called more than " |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 name = "${liveTest.suite.path}: $name"; | 200 name = "${liveTest.suite.path}: $name"; |
196 } | 201 } |
197 | 202 |
198 if (_multiplePlatforms && liveTest.suite.platform != null) { | 203 if (_multiplePlatforms && liveTest.suite.platform != null) { |
199 name = "[$liveTest.suite.platform] $name"; | 204 name = "[$liveTest.suite.platform] $name"; |
200 } | 205 } |
201 | 206 |
202 return name; | 207 return name; |
203 } | 208 } |
204 } | 209 } |
OLD | NEW |