| 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 "dart:math"; | 8 import "dart:math"; |
| 9 import "drt_updater.dart"; | 9 import "drt_updater.dart"; |
| 10 import "test_suite.dart"; | 10 import "test_suite.dart"; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 d8: Run JavaScript from the command line using v8. | 80 d8: Run JavaScript from the command line using v8. |
| 81 | 81 |
| 82 jsshell: Run JavaScript from the command line using firefox js-shell. | 82 jsshell: Run JavaScript from the command line using firefox js-shell. |
| 83 | 83 |
| 84 drt: Run Dart or JavaScript in the headless version of Chrome, | 84 drt: Run Dart or JavaScript in the headless version of Chrome, |
| 85 Content shell. | 85 Content shell. |
| 86 | 86 |
| 87 dartium: Run Dart or JavaScript in Dartium. | 87 dartium: Run Dart or JavaScript in Dartium. |
| 88 | 88 |
| 89 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell |
| 90 on Android. |
| 91 |
| 89 [ff | chrome | safari | ie9 | ie10 | opera | chromeOnAndroid]: | 92 [ff | chrome | safari | ie9 | ie10 | opera | chromeOnAndroid]: |
| 90 Run JavaScript in the specified browser. | 93 Run JavaScript in the specified browser. |
| 91 | 94 |
| 92 none: No runtime, compile only (for example, used for dartanalyzer static | 95 none: No runtime, compile only (for example, used for dartanalyzer static |
| 93 analysis tests).''', | 96 analysis tests).''', |
| 94 ['-r', '--runtime'], | 97 ['-r', '--runtime'], |
| 95 ['vm', 'd8', 'jsshell', 'drt', 'dartium', 'ff', 'firefox', | 98 ['vm', 'd8', 'jsshell', 'drt', 'dartium', 'ff', 'firefox', |
| 96 'chrome', 'safari', 'ie9', 'ie10', 'opera', 'chromeOnAndroid', | 99 'chrome', 'safari', 'ie9', 'ie10', 'opera', 'chromeOnAndroid', |
| 97 'none'], | 100 'ContentShellOnAndroid', 'none'], |
| 98 'vm'), | 101 'vm'), |
| 99 new _TestOptionSpecification( | 102 new _TestOptionSpecification( |
| 100 'arch', | 103 'arch', |
| 101 'The architecture to run tests for', | 104 'The architecture to run tests for', |
| 102 ['-a', '--arch'], | 105 ['-a', '--arch'], |
| 103 ['all', 'ia32', 'x64', 'simarm', 'simmips', 'arm', 'mips'], | 106 ['all', 'ia32', 'x64', 'simarm', 'simmips', 'arm', 'mips'], |
| 104 'ia32'), | 107 'ia32'), |
| 105 new _TestOptionSpecification( | 108 new _TestOptionSpecification( |
| 106 'system', | 109 'system', |
| 107 'The operating system to run tests on', | 110 'The operating system to run tests on', |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 'bool' | 298 'bool' |
| 296 ), | 299 ), |
| 297 new _TestOptionSpecification( | 300 new _TestOptionSpecification( |
| 298 'local_ip', | 301 'local_ip', |
| 299 'IP address the http servers should listen on.' | 302 'IP address the http servers should listen on.' |
| 300 'This address is also used for browsers to connect.', | 303 'This address is also used for browsers to connect.', |
| 301 ['--local_ip'], | 304 ['--local_ip'], |
| 302 [], | 305 [], |
| 303 '127.0.0.1'), | 306 '127.0.0.1'), |
| 304 new _TestOptionSpecification( | 307 new _TestOptionSpecification( |
| 308 'test_server_port', |
| 309 'Port for test http server.', |
| 310 ['--test_server_port'], |
| 311 [], |
| 312 0, |
| 313 'int'), |
| 314 new _TestOptionSpecification( |
| 315 'test_server_cross_origin_port', |
| 316 'Port for test http server cross origin.', |
| 317 ['--test_server_cross_origin_port'], |
| 318 [], |
| 319 0, |
| 320 'int'), |
| 321 new _TestOptionSpecification( |
| 322 'test_driver_port', |
| 323 'Port for http test driver server.', |
| 324 ['--test_driver_port'], |
| 325 [], |
| 326 0, |
| 327 'int'), |
| 328 new _TestOptionSpecification( |
| 329 'test_driver_error_port', |
| 330 'Port for http test driver server errors.', |
| 331 ['--test_driver_error_port'], |
| 332 [], |
| 333 0, |
| 334 'int'), |
| 335 new _TestOptionSpecification( |
| 305 'record_to_file', | 336 'record_to_file', |
| 306 'Records all the commands that need to be executed and writes it ' | 337 'Records all the commands that need to be executed and writes it ' |
| 307 'out to a file.', | 338 'out to a file.', |
| 308 ['--record_to_file'], | 339 ['--record_to_file'], |
| 309 [], | 340 [], |
| 310 null), | 341 null), |
| 311 new _TestOptionSpecification( | 342 new _TestOptionSpecification( |
| 312 'replay_from_file', | 343 'replay_from_file', |
| 313 'Records all the commands that need to be executed and writes it ' | 344 'Records all the commands that need to be executed and writes it ' |
| 314 'out to a file.', | 345 'out to a file.', |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium', | 537 validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium', |
| 507 'ff', 'chrome', 'safari', 'ie9', 'ie10', | 538 'ff', 'chrome', 'safari', 'ie9', 'ie10', |
| 508 'opera', 'chromeOnAndroid']; | 539 'opera', 'chromeOnAndroid']; |
| 509 break; | 540 break; |
| 510 case 'dartanalyzer': | 541 case 'dartanalyzer': |
| 511 case 'dart2analyzer': | 542 case 'dart2analyzer': |
| 512 validRuntimes = const ['none']; | 543 validRuntimes = const ['none']; |
| 513 break; | 544 break; |
| 514 case 'none': | 545 case 'none': |
| 515 case 'dart2dart': | 546 case 'dart2dart': |
| 516 validRuntimes = const ['vm', 'drt', 'dartium']; | 547 validRuntimes = const ['vm', 'drt', 'dartium', 'ContentShellOnAndroid']; |
| 517 break; | 548 break; |
| 518 } | 549 } |
| 519 if (!validRuntimes.contains(config['runtime'])) { | 550 if (!validRuntimes.contains(config['runtime'])) { |
| 520 isValid = false; | 551 isValid = false; |
| 521 print("Warning: combination of compiler '${config['compiler']}' and " | 552 print("Warning: combination of compiler '${config['compiler']}' and " |
| 522 "runtime '${config['runtime']}' is invalid. " | 553 "runtime '${config['runtime']}' is invalid. " |
| 523 "Skipping this combination."); | 554 "Skipping this combination."); |
| 524 } | 555 } |
| 525 if ((config['runtime'] == 'ie9' || config['runtime'] == 'ie10') && | 556 if ((config['runtime'] == 'ie9' || config['runtime'] == 'ie10') && |
| 526 Platform.operatingSystem != 'windows') { | 557 Platform.operatingSystem != 'windows') { |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 return option; | 777 return option; |
| 747 } | 778 } |
| 748 } | 779 } |
| 749 print('Unknown test option $name'); | 780 print('Unknown test option $name'); |
| 750 exit(1); | 781 exit(1); |
| 751 } | 782 } |
| 752 | 783 |
| 753 | 784 |
| 754 List<_TestOptionSpecification> _options; | 785 List<_TestOptionSpecification> _options; |
| 755 } | 786 } |
| OLD | NEW |