OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'package:boolean_selector/boolean_selector.dart'; | 7 import 'package:boolean_selector/boolean_selector.dart'; |
8 import 'package:collection/collection.dart'; | 8 import 'package:collection/collection.dart'; |
9 import 'package:glob/glob.dart'; | 9 import 'package:glob/glob.dart'; |
10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 _disallow("reporter"); | 162 _disallow("reporter"); |
163 _disallow("concurrency"); | 163 _disallow("concurrency"); |
164 _disallow("names"); | 164 _disallow("names"); |
165 _disallow("plain_names"); | 165 _disallow("plain_names"); |
166 _disallow("platforms"); | 166 _disallow("platforms"); |
167 _disallow("add_presets"); | 167 _disallow("add_presets"); |
168 return Configuration.empty; | 168 return Configuration.empty; |
169 } | 169 } |
170 | 170 |
171 var pauseAfterLoad = _getBool("pause_after_load"); | 171 var pauseAfterLoad = _getBool("pause_after_load"); |
| 172 var runSkipped = _getBool("run_skipped"); |
172 | 173 |
173 var reporter = _getString("reporter"); | 174 var reporter = _getString("reporter"); |
174 if (reporter != null && !allReporters.contains(reporter)) { | 175 if (reporter != null && !allReporters.contains(reporter)) { |
175 _error('Unknown reporter "$reporter".', "reporter"); | 176 _error('Unknown reporter "$reporter".', "reporter"); |
176 } | 177 } |
177 | 178 |
178 var concurrency = _getInt("concurrency"); | 179 var concurrency = _getInt("concurrency"); |
179 | 180 |
180 var allPlatformIdentifiers = | 181 var allPlatformIdentifiers = |
181 TestPlatform.all.map((platform) => platform.identifier).toSet(); | 182 TestPlatform.all.map((platform) => platform.identifier).toSet(); |
182 var platforms = _getList("platforms", (platformNode) { | 183 var platforms = _getList("platforms", (platformNode) { |
183 _validate(platformNode, "Platforms must be strings.", | 184 _validate(platformNode, "Platforms must be strings.", |
184 (value) => value is String); | 185 (value) => value is String); |
185 _validate(platformNode, 'Unknown platform "${platformNode.value}".', | 186 _validate(platformNode, 'Unknown platform "${platformNode.value}".', |
186 allPlatformIdentifiers.contains); | 187 allPlatformIdentifiers.contains); |
187 | 188 |
188 return TestPlatform.find(platformNode.value); | 189 return TestPlatform.find(platformNode.value); |
189 }); | 190 }); |
190 | 191 |
191 var chosenPresets = _getList("add_presets", | 192 var chosenPresets = _getList("add_presets", |
192 (presetNode) => _parseIdentifierLike(presetNode, "Preset name")); | 193 (presetNode) => _parseIdentifierLike(presetNode, "Preset name")); |
193 | 194 |
194 return new Configuration( | 195 return new Configuration( |
195 pauseAfterLoad: pauseAfterLoad, | 196 pauseAfterLoad: pauseAfterLoad, |
| 197 runSkipped: runSkipped, |
196 reporter: reporter, | 198 reporter: reporter, |
197 concurrency: concurrency, | 199 concurrency: concurrency, |
198 platforms: platforms, | 200 platforms: platforms, |
199 chosenPresets: chosenPresets); | 201 chosenPresets: chosenPresets); |
200 } | 202 } |
201 | 203 |
202 /// Loads runner configuration that's not allowed in the global configuration | 204 /// Loads runner configuration that's not allowed in the global configuration |
203 /// file. | 205 /// file. |
204 /// | 206 /// |
205 /// If [_runnerConfig] is `false` or if [_global] is `true`, this will error | 207 /// If [_runnerConfig] is `false` or if [_global] is `true`, this will error |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 _document.nodes.keys.firstWhere((key) => key.value == field).span, | 397 _document.nodes.keys.firstWhere((key) => key.value == field).span, |
396 _source); | 398 _source); |
397 } | 399 } |
398 | 400 |
399 /// Throws a [SourceSpanFormatException] with [message] about [field]. | 401 /// Throws a [SourceSpanFormatException] with [message] about [field]. |
400 void _error(String message, String field) { | 402 void _error(String message, String field) { |
401 throw new SourceSpanFormatException( | 403 throw new SourceSpanFormatException( |
402 message, _document.nodes[field].span, _source); | 404 message, _document.nodes[field].span, _source); |
403 } | 405 } |
404 } | 406 } |
OLD | NEW |