OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_options_parser; | 5 library test_options_parser; |
6 | 6 |
7 import "dart:io"; | 7 import "dart:io"; |
8 import "drt_updater.dart"; | 8 import "drt_updater.dart"; |
9 import "test_suite.dart"; | 9 import "test_suite.dart"; |
10 import "path.dart"; | 10 import "path.dart"; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 Normally, the compiler or runtimes in PRODUCT_DIR is tested, with this | 334 Normally, the compiler or runtimes in PRODUCT_DIR is tested, with this |
335 option, the compiler or runtime in PRODUCT_DIR/dart-sdk/bin is tested. | 335 option, the compiler or runtime in PRODUCT_DIR/dart-sdk/bin is tested. |
336 | 336 |
337 Note: currently only implemented for dart2js.''', | 337 Note: currently only implemented for dart2js.''', |
338 ['--use-sdk'], | 338 ['--use-sdk'], |
339 [], | 339 [], |
340 false, | 340 false, |
341 type: 'bool'), | 341 type: 'bool'), |
342 new _TestOptionSpecification( | 342 new _TestOptionSpecification( |
343 'use_public_packages', | |
344 'For tests using packages: Use pub.dartlang.org packages ' | |
345 'instead the ones in the repository.', | |
346 ['--use-public-packages'], | |
347 [], | |
348 false, | |
349 type: 'bool'), | |
350 new _TestOptionSpecification( | |
351 'use_repository_packages', | |
352 'For tests using packages: Use pub.dartlang.org packages ' | |
353 'but use overrides for the packages available in the ' | |
354 'repository.', | |
355 ['--use-repository-packages'], | |
356 [], | |
357 false, | |
358 type: 'bool'), | |
359 new _TestOptionSpecification( | |
360 'build_directory', | 343 'build_directory', |
361 'The name of the build directory, where products are placed.', | 344 'The name of the build directory, where products are placed.', |
362 ['--build-directory'], | 345 ['--build-directory'], |
363 [], | 346 [], |
364 ''), | 347 ''), |
365 new _TestOptionSpecification('noBatch', 'Do not run tests in batch mode', | 348 new _TestOptionSpecification('noBatch', 'Do not run tests in batch mode', |
366 ['-n', '--nobatch'], [], false, | 349 ['-n', '--nobatch'], [], false, |
367 type: 'bool'), | 350 type: 'bool'), |
368 new _TestOptionSpecification('dart2js_batch', | 351 new _TestOptionSpecification('dart2js_batch', |
369 'Run dart2js tests in batch mode', ['--dart2js-batch'], [], false, | 352 'Run dart2js tests in batch mode', ['--dart2js-batch'], [], false, |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 if (config['ie'] && Platform.operatingSystem != 'windows') { | 728 if (config['ie'] && Platform.operatingSystem != 'windows') { |
746 isValid = false; | 729 isValid = false; |
747 print("Warning: cannot run Internet Explorer on non-Windows operating" | 730 print("Warning: cannot run Internet Explorer on non-Windows operating" |
748 " system."); | 731 " system."); |
749 } | 732 } |
750 if (config['shard'] < 1 || config['shard'] > config['shards']) { | 733 if (config['shard'] < 1 || config['shard'] > config['shards']) { |
751 isValid = false; | 734 isValid = false; |
752 print("Error: shard index is ${config['shard']} out of " | 735 print("Error: shard index is ${config['shard']} out of " |
753 "${config['shards']} shards"); | 736 "${config['shards']} shards"); |
754 } | 737 } |
755 | |
756 if (config['use_repository_packages'] && config['use_public_packages']) { | |
757 isValid = false; | |
758 print("Cannot have both --use-repository-packages and " | |
759 "--use-public-packages"); | |
760 } | |
761 if ((config['runtime'] == 'flutter') && (config['flutter'] == '')) { | 738 if ((config['runtime'] == 'flutter') && (config['flutter'] == '')) { |
762 isValid = false; | 739 isValid = false; |
763 print("-rflutter requires the flutter engine executable to " | 740 print("-rflutter requires the flutter engine executable to " |
764 "be specified using --flutter="); | 741 "be specified using --flutter="); |
765 } | 742 } |
766 if ((config['runtime'] == 'flutter') && (config['arch'] != 'x64')) { | 743 if ((config['runtime'] == 'flutter') && (config['arch'] != 'x64')) { |
767 isValid = false; | 744 isValid = false; |
768 print("-rflutter is applicable only for --arch=x64"); | 745 print("-rflutter is applicable only for --arch=x64"); |
769 } | 746 } |
770 | 747 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 return option; | 996 return option; |
1020 } | 997 } |
1021 } | 998 } |
1022 print('Unknown test option $name'); | 999 print('Unknown test option $name'); |
1023 exit(1); | 1000 exit(1); |
1024 return null; // Unreachable. | 1001 return null; // Unreachable. |
1025 } | 1002 } |
1026 | 1003 |
1027 List<_TestOptionSpecification> _options; | 1004 List<_TestOptionSpecification> _options; |
1028 } | 1005 } |
OLD | NEW |