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 import 'dart:io'; | 6 import 'dart:io'; |
7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 _printedNewline = true; | 205 _printedNewline = true; |
206 | 206 |
207 print(line); | 207 print(line); |
208 })); | 208 })); |
209 } | 209 } |
210 | 210 |
211 /// A callback called when [liveTest]'s state becomes [state]. | 211 /// A callback called when [liveTest]'s state becomes [state]. |
212 void _onStateChange(LiveTest liveTest, State state) { | 212 void _onStateChange(LiveTest liveTest, State state) { |
213 if (state.status != Status.complete) return; | 213 if (state.status != Status.complete) return; |
214 | 214 |
215 if (liveTest.test.metadata.skip && | 215 if (state.result == Result.skipped && |
216 liveTest.test.metadata.skipReason != null) { | 216 liveTest.test.metadata.skipReason != null) { |
217 _progressLine(_description(liveTest)); | 217 _progressLine(_description(liveTest)); |
218 print(''); | 218 print(''); |
219 print(indent('${_yellow}Skip: ${liveTest.test.metadata.skipReason}' | 219 print(indent('${_yellow}Skip: ${liveTest.test.metadata.skipReason}' |
220 '$_noColor')); | 220 '$_noColor')); |
221 } else { | 221 } else { |
222 // Always display the name of the oldest active test, unless testing | 222 // Always display the name of the oldest active test, unless testing |
223 // is finished in which case display the last test to complete. | 223 // is finished in which case display the last test to complete. |
224 if (_engine.active.isEmpty) { | 224 if (_engine.active.isEmpty) { |
225 _progressLine(_description(liveTest)); | 225 _progressLine(_description(liveTest)); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 387 |
388 if (_printPlatform && liveTest.suite.platform != null) { | 388 if (_printPlatform && liveTest.suite.platform != null) { |
389 name = "[${liveTest.suite.platform.name}] $name"; | 389 name = "[${liveTest.suite.platform.name}] $name"; |
390 } | 390 } |
391 | 391 |
392 if (liveTest.suite is LoadSuite) name = "$_bold$_gray$name$_noColor"; | 392 if (liveTest.suite is LoadSuite) name = "$_bold$_gray$name$_noColor"; |
393 | 393 |
394 return name; | 394 return name; |
395 } | 395 } |
396 } | 396 } |
OLD | NEW |