| 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.addFlag("version", negatable: false, | 80 _parser.addFlag("version", negatable: false, |
| 78 help: "Shows the package's version."); | 81 help: "Shows the package's version."); |
| 79 _parser.addOption("package-root", hide: true); | 82 _parser.addOption("package-root", hide: true); |
| 80 _parser.addOption("name", | 83 _parser.addOption("name", |
| 81 abbr: 'n', | 84 abbr: 'n', |
| 82 help: 'A substring of the name of the test to run.\n' | 85 help: 'A substring of the name of the test to run.\n' |
| 83 'Regular expression syntax is supported.'); | 86 'Regular expression syntax is supported.'); |
| 84 _parser.addOption("plain-name", | 87 _parser.addOption("plain-name", |
| 85 abbr: 'N', | 88 abbr: 'N', |
| 86 help: 'A plain-text substring of the name of the test to run.'); | 89 help: 'A plain-text substring of the name of the test to run.'); |
| 87 _parser.addOption("platform", | 90 _parser.addOption("platform", |
| 88 abbr: 'p', | 91 abbr: 'p', |
| 89 help: 'The platform(s) on which to run the tests.', | 92 help: 'The platform(s) on which to run the tests.', |
| 90 allowed: TestPlatform.all.map((platform) => platform.identifier).toList(), | 93 allowed: allPlatforms.map((platform) => platform.identifier).toList(), |
| 91 defaultsTo: 'vm', | 94 defaultsTo: 'vm', |
| 92 allowMultiple: true); | 95 allowMultiple: true); |
| 93 _parser.addOption("concurrency", | 96 _parser.addOption("concurrency", |
| 94 abbr: 'j', | 97 abbr: 'j', |
| 95 help: 'The number of concurrent test suites run.\n' | 98 help: 'The number of concurrent test suites run.\n' |
| 96 '(defaults to $_defaultConcurrency)', | 99 '(defaults to $_defaultConcurrency)', |
| 97 valueHelp: 'threads'); | 100 valueHelp: 'threads'); |
| 98 _parser.addOption("pub-serve", | 101 _parser.addOption("pub-serve", |
| 99 help: 'The port of a pub serve instance serving "test/".', | 102 help: 'The port of a pub serve instance serving "test/".', |
| 100 hide: !supportsPubServe, | 103 hide: !supportsPubServe, |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 if (description is! Map) return false; | 356 if (description is! Map) return false; |
| 354 var path = description["path"]; | 357 var path = description["path"]; |
| 355 if (path is! String) return false; | 358 if (path is! String) return false; |
| 356 | 359 |
| 357 print("$version (from $path)"); | 360 print("$version (from $path)"); |
| 358 return true; | 361 return true; |
| 359 | 362 |
| 360 default: return false; | 363 default: return false; |
| 361 } | 364 } |
| 362 } | 365 } |
| OLD | NEW |