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 test.runner.configuration; | 5 library test.runner.configuration; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
9 | 9 |
10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
(...skipping 38 matching lines...) Loading... |
49 allowMultiple: true); | 49 allowMultiple: true); |
50 parser.addOption("concurrency", | 50 parser.addOption("concurrency", |
51 abbr: 'j', | 51 abbr: 'j', |
52 help: 'The number of concurrent test suites run.\n' | 52 help: 'The number of concurrent test suites run.\n' |
53 '(defaults to $_defaultConcurrency)', | 53 '(defaults to $_defaultConcurrency)', |
54 valueHelp: 'threads'); | 54 valueHelp: 'threads'); |
55 parser.addOption("pub-serve", | 55 parser.addOption("pub-serve", |
56 help: 'The port of a pub serve instance serving "test/".', | 56 help: 'The port of a pub serve instance serving "test/".', |
57 hide: !supportsPubServe, | 57 hide: !supportsPubServe, |
58 valueHelp: 'port'); | 58 valueHelp: 'port'); |
| 59 parser.addFlag("pause-after-load", |
| 60 help: 'Pauses for debugging before any tests execute.\n' |
| 61 'Implies --concurrency=1.\n' |
| 62 'Currently only supported for browser tests.', |
| 63 negatable: false); |
59 parser.addOption("reporter", | 64 parser.addOption("reporter", |
60 abbr: 'r', | 65 abbr: 'r', |
61 help: 'The runner used to print test results.', | 66 help: 'The runner used to print test results.', |
62 allowed: ['compact', 'expanded'], | 67 allowed: ['compact', 'expanded'], |
63 defaultsTo: Platform.isWindows ? 'expanded' : 'compact', | 68 defaultsTo: Platform.isWindows ? 'expanded' : 'compact', |
64 allowedHelp: { | 69 allowedHelp: { |
65 'compact': 'A single line, updated continuously.', | 70 'compact': 'A single line, updated continuously.', |
66 'expanded': 'A separate line for each update.' | 71 'expanded': 'A separate line for each update.' |
67 }); | 72 }); |
68 parser.addFlag("verbose-trace", negatable: false, | 73 parser.addFlag("verbose-trace", negatable: false, |
(...skipping 19 matching lines...) Loading... |
88 bool get version => _options['version']; | 93 bool get version => _options['version']; |
89 | 94 |
90 /// Whether stack traces should be presented as-is or folded to remove | 95 /// Whether stack traces should be presented as-is or folded to remove |
91 /// irrelevant packages. | 96 /// irrelevant packages. |
92 bool get verboseTrace => _options['verbose-trace']; | 97 bool get verboseTrace => _options['verbose-trace']; |
93 | 98 |
94 /// Whether JavaScript stack traces should be left as-is or converted to | 99 /// Whether JavaScript stack traces should be left as-is or converted to |
95 /// Dart-like traces. | 100 /// Dart-like traces. |
96 bool get jsTrace => _options['js-trace']; | 101 bool get jsTrace => _options['js-trace']; |
97 | 102 |
| 103 /// Whether to pause for debugging after loading each test suite. |
| 104 bool get pauseAfterLoad => _options['pause-after-load']; |
| 105 |
98 /// The package root for resolving "package:" URLs. | 106 /// The package root for resolving "package:" URLs. |
99 String get packageRoot => _options['package-root'] == null | 107 String get packageRoot => _options['package-root'] == null |
100 ? p.join(p.current, 'packages') | 108 ? p.join(p.current, 'packages') |
101 : _options['package-root']; | 109 : _options['package-root']; |
102 | 110 |
103 /// The name of the reporter to use to display results. | 111 /// The name of the reporter to use to display results. |
104 String get reporter => _options['reporter']; | 112 String get reporter => _options['reporter']; |
105 | 113 |
106 /// The URL for the `pub serve` instance from which to load tests, or `null` | 114 /// The URL for the `pub serve` instance from which to load tests, or `null` |
107 /// if tests should be loaded from the filesystem. | 115 /// if tests should be loaded from the filesystem. |
(...skipping 51 matching lines...) Loading... |
159 /// [FormatException] it throws with additional information. | 167 /// [FormatException] it throws with additional information. |
160 _wrapFormatException(String name, parse(value)) { | 168 _wrapFormatException(String name, parse(value)) { |
161 try { | 169 try { |
162 return parse(_options[name]); | 170 return parse(_options[name]); |
163 } on FormatException catch (error) { | 171 } on FormatException catch (error) { |
164 throw new FormatException('Couldn\'t parse --$name "${_options[name]}": ' | 172 throw new FormatException('Couldn\'t parse --$name "${_options[name]}": ' |
165 '${error.message}'); | 173 '${error.message}'); |
166 } | 174 } |
167 } | 175 } |
168 } | 176 } |
OLD | NEW |