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:isolate'; | 6 import 'dart:isolate'; |
7 | 7 |
8 import '../../backend/live_test.dart'; | 8 import '../../backend/live_test.dart'; |
9 import '../../backend/state.dart'; | 9 import '../../backend/state.dart'; |
10 import '../../utils.dart'; | 10 import '../../utils.dart'; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 _subscriptions.add(liveTest.onPrint.listen((line) { | 187 _subscriptions.add(liveTest.onPrint.listen((line) { |
188 _progressLine(_description(liveTest)); | 188 _progressLine(_description(liveTest)); |
189 print(line); | 189 print(line); |
190 })); | 190 })); |
191 } | 191 } |
192 | 192 |
193 /// A callback called when [liveTest]'s state becomes [state]. | 193 /// A callback called when [liveTest]'s state becomes [state]. |
194 void _onStateChange(LiveTest liveTest, State state) { | 194 void _onStateChange(LiveTest liveTest, State state) { |
195 if (state.status != Status.complete) return; | 195 if (state.status != Status.complete) return; |
196 | 196 |
197 if (liveTest.test.metadata.skip && | 197 if (state.result == Result.skipped && |
198 liveTest.test.metadata.skipReason != null) { | 198 liveTest.test.metadata.skipReason != null) { |
199 print(indent('${_yellow}Skip: ${liveTest.test.metadata.skipReason}' | 199 print(indent('${_yellow}Skip: ${liveTest.test.metadata.skipReason}' |
200 '$_noColor')); | 200 '$_noColor')); |
201 } else if (_engine.active.isNotEmpty) { | 201 } else if (_engine.active.isNotEmpty) { |
202 // If any tests are running, display the name of the oldest active | 202 // If any tests are running, display the name of the oldest active |
203 // test. | 203 // test. |
204 _progressLine(_description(_engine.active.first)); | 204 _progressLine(_description(_engine.active.first)); |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 if (_printPlatform && liveTest.suite.platform != null) { | 322 if (_printPlatform && liveTest.suite.platform != null) { |
323 name = "[${liveTest.suite.platform.name}] $name"; | 323 name = "[${liveTest.suite.platform.name}] $name"; |
324 } | 324 } |
325 | 325 |
326 if (liveTest.suite is LoadSuite) name = "$_bold$_gray$name$_noColor"; | 326 if (liveTest.suite is LoadSuite) name = "$_bold$_gray$name$_noColor"; |
327 | 327 |
328 return name; | 328 return name; |
329 } | 329 } |
330 } | 330 } |
OLD | NEW |