OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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:builtin"); | 8 #import("dart:builtin"); |
9 #import("drt_updater.dart"); | 9 #import("drt_updater.dart"); |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 '''Where the tests should be run. | 86 '''Where the tests should be run. |
87 vm: Run Dart code on the standalone dart vm. | 87 vm: Run Dart code on the standalone dart vm. |
88 | 88 |
89 d8: Run JavaScript from the command line using v8. | 89 d8: Run JavaScript from the command line using v8. |
90 | 90 |
91 drt: Run Dart or JavaScript in the headless version of Chrome, | 91 drt: Run Dart or JavaScript in the headless version of Chrome, |
92 DumpRenderTree. | 92 DumpRenderTree. |
93 | 93 |
94 dartium: Run Dart or JavaScript in Dartium. | 94 dartium: Run Dart or JavaScript in Dartium. |
95 | 95 |
96 [ff | chrome | safari | ie | opera]: Run JavaScript in the specified | 96 [ff | chrome | safari | ie | opera]: Run JavaScript in the specified |
97 browser. | 97 browser. |
98 | 98 |
99 none: No runtime, compile only (for example, used for dartc static analysis | 99 none: No runtime, compile only (for example, used for dartc static analysis |
100 tests).''', | 100 tests).''', |
101 ['-r', '--runtime'], | 101 ['-r', '--runtime'], |
102 ['vm', 'd8', 'drt', 'dartium', 'ff', 'firefox', 'chrome', | 102 ['vm', 'd8', 'drt', 'dartium', 'ff', 'firefox', 'chrome', |
103 'safari', 'ie', 'opera', 'none'], | 103 'safari', 'ie', 'opera', 'none'], |
104 'vm'), | 104 'vm'), |
105 new _TestOptionSpecification( | 105 new _TestOptionSpecification( |
106 'arch', | 106 'arch', |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 'none']).indexOf(config['runtime']) >= 0; | 407 'none']).indexOf(config['runtime']) >= 0; |
408 break; | 408 break; |
409 case 'dartc': | 409 case 'dartc': |
410 isValid = config['runtime'] == 'none'; | 410 isValid = config['runtime'] == 'none'; |
411 break; | 411 break; |
412 case 'none': | 412 case 'none': |
413 isValid = (const ['vm', 'drt', | 413 isValid = (const ['vm', 'drt', |
414 'dartium']).indexOf(config['runtime']) >= 0; | 414 'dartium']).indexOf(config['runtime']) >= 0; |
415 } | 415 } |
416 if (!isValid) { | 416 if (!isValid) { |
417 print("Warning: combination of ${config['compiler']} and " + | 417 print("Warning: combination of ${config['compiler']} and " |
418 "${config['runtime']} is invalid. Skipping this combination."); | 418 "${config['runtime']} is invalid. Skipping this combination."); |
419 } | 419 } |
420 if (config['runtime'] == 'ie' && | 420 if (config['runtime'] == 'ie' && |
421 Platform.operatingSystem != 'windows') { | 421 Platform.operatingSystem != 'windows') { |
422 isValid = false; | 422 isValid = false; |
423 print("Warning cannot run Internet Explorer on non-Windows operating" + | 423 print("Warning cannot run Internet Explorer on non-Windows operating" |
424 " system."); | 424 " system."); |
425 } | 425 } |
426 if (config['shard'] < 1 || config['shard'] > config['shards']) { | 426 if (config['shard'] < 1 || config['shard'] > config['shards']) { |
427 isValid = false; | 427 isValid = false; |
428 print("Error: shard index is ${config['shard']} out of " + | 428 print("Error: shard index is ${config['shard']} out of " |
429 "${config['shards']} shards"); | 429 "${config['shards']} shards"); |
430 } | 430 } |
431 if (config['runtime'] == 'dartium' && config['compiler'] == 'none' && | 431 if (config['runtime'] == 'dartium' && config['compiler'] == 'none' && |
432 config['checked']) { | 432 config['checked']) { |
433 // TODO(vsm): Set the DART_FLAGS environment appropriately when | 433 // TODO(vsm): Set the DART_FLAGS environment appropriately when |
434 // invoking Selenium to support checked mode. It's not clear | 434 // invoking Selenium to support checked mode. It's not clear |
435 // the current selenium API supports this. | 435 // the current selenium API supports this. |
436 isValid = false; | 436 isValid = false; |
437 print("Warning: checked mode is not yet supported for dartium tests."); | 437 print("Warning: checked mode is not yet supported for dartium tests."); |
438 } | 438 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 var slashLocation = pattern.indexOf('/'); | 493 var slashLocation = pattern.indexOf('/'); |
494 if (slashLocation != -1) { | 494 if (slashLocation != -1) { |
495 suite = pattern.substring(0, slashLocation); | 495 suite = pattern.substring(0, slashLocation); |
496 pattern = pattern.substring(slashLocation + 1); | 496 pattern = pattern.substring(slashLocation + 1); |
497 pattern = pattern.replaceAll('*', '.*'); | 497 pattern = pattern.replaceAll('*', '.*'); |
498 pattern = pattern.replaceAll('/', '.*'); | 498 pattern = pattern.replaceAll('/', '.*'); |
499 } else { | 499 } else { |
500 pattern = ".*"; | 500 pattern = ".*"; |
501 } | 501 } |
502 if (selectorMap.containsKey(suite)) { | 502 if (selectorMap.containsKey(suite)) { |
503 print("Error: '$suite/$pattern'. Only one test selection" + | 503 print("Error: '$suite/$pattern'. Only one test selection" |
504 " pattern is allowed to start with '$suite/'"); | 504 " pattern is allowed to start with '$suite/'"); |
505 exit(1); | 505 exit(1); |
506 } | 506 } |
507 selectorMap[suite] = new RegExp(pattern); | 507 selectorMap[suite] = new RegExp(pattern); |
508 } | 508 } |
509 configuration['selectors'] = selectorMap; | 509 configuration['selectors'] = selectorMap; |
510 } | 510 } |
511 | 511 |
512 // Expand the architectures. | 512 // Expand the architectures. |
513 if (configuration['arch'].contains(',')) { | 513 if (configuration['arch'].contains(',')) { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 return option; | 640 return option; |
641 } | 641 } |
642 } | 642 } |
643 print('Unknown test option $name'); | 643 print('Unknown test option $name'); |
644 exit(1); | 644 exit(1); |
645 } | 645 } |
646 | 646 |
647 | 647 |
648 List<_TestOptionSpecification> _options; | 648 List<_TestOptionSpecification> _options; |
649 } | 649 } |
OLD | NEW |