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 // TODO(nweiz): This is under lib so that it can be used by the unittest dummy | 5 // TODO(nweiz): This is under lib so that it can be used by the unittest dummy |
6 // package. Once that package is no longer being updated, move this back into | 6 // package. Once that package is no longer being updated, move this back into |
7 // bin. | 7 // bin. |
8 library test.executable; | 8 library test.executable; |
9 | 9 |
10 import 'dart:async'; | 10 import 'dart:async'; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 return transformers.any((transformer) { | 66 return transformers.any((transformer) { |
67 if (transformer is String) return transformer == 'test/pub_serve'; | 67 if (transformer is String) return transformer == 'test/pub_serve'; |
68 if (transformer is! Map) return false; | 68 if (transformer is! Map) return false; |
69 if (transformer.keys.length != 1) return false; | 69 if (transformer.keys.length != 1) return false; |
70 return transformer.keys.single == 'test/pub_serve'; | 70 return transformer.keys.single == 'test/pub_serve'; |
71 }); | 71 }); |
72 } | 72 } |
73 | 73 |
74 void main(List<String> args) { | 74 void main(List<String> args) { |
| 75 var allPlatforms = TestPlatform.all.toList(); |
| 76 if (!Platform.isMacOS) allPlatforms.remove(TestPlatform.safari); |
| 77 |
75 _parser.addFlag("help", abbr: "h", negatable: false, | 78 _parser.addFlag("help", abbr: "h", negatable: false, |
76 help: "Shows this usage information."); | 79 help: "Shows this usage information."); |
77 _parser.addOption("package-root", hide: true); | 80 _parser.addOption("package-root", hide: true); |
78 _parser.addOption("name", | 81 _parser.addOption("name", |
79 abbr: 'n', | 82 abbr: 'n', |
80 help: 'A substring of the name of the test to run.\n' | 83 help: 'A substring of the name of the test to run.\n' |
81 'Regular expression syntax is supported.'); | 84 'Regular expression syntax is supported.'); |
82 _parser.addOption("plain-name", | 85 _parser.addOption("plain-name", |
83 abbr: 'N', | 86 abbr: 'N', |
84 help: 'A plain-text substring of the name of the test to run.'); | 87 help: 'A plain-text substring of the name of the test to run.'); |
85 _parser.addOption("platform", | 88 _parser.addOption("platform", |
86 abbr: 'p', | 89 abbr: 'p', |
87 help: 'The platform(s) on which to run the tests.', | 90 help: 'The platform(s) on which to run the tests.', |
88 allowed: TestPlatform.all.map((platform) => platform.identifier).toList(), | 91 allowed: allPlatforms.map((platform) => platform.identifier).toList(), |
89 defaultsTo: 'vm', | 92 defaultsTo: 'vm', |
90 allowMultiple: true); | 93 allowMultiple: true); |
91 _parser.addOption("concurrency", | 94 _parser.addOption("concurrency", |
92 abbr: 'j', | 95 abbr: 'j', |
93 help: 'The number of concurrent test suites run.\n' | 96 help: 'The number of concurrent test suites run.\n' |
94 '(defaults to $_defaultConcurrency)', | 97 '(defaults to $_defaultConcurrency)', |
95 valueHelp: 'threads'); | 98 valueHelp: 'threads'); |
96 _parser.addOption("pub-serve", | 99 _parser.addOption("pub-serve", |
97 help: 'The port of a pub serve instance serving "test/".', | 100 help: 'The port of a pub serve instance serving "test/".', |
98 hide: !supportsPubServe, | 101 hide: !supportsPubServe, |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 output = stderr; | 288 output = stderr; |
286 } | 289 } |
287 | 290 |
288 output.write("""$message | 291 output.write("""$message |
289 | 292 |
290 Usage: pub run test:test [files or directories...] | 293 Usage: pub run test:test [files or directories...] |
291 | 294 |
292 ${_parser.usage} | 295 ${_parser.usage} |
293 """); | 296 """); |
294 } | 297 } |
OLD | NEW |