| 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: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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 'opera']; | 417 'opera']; |
| 418 break; | 418 break; |
| 419 case 'dartc': | 419 case 'dartc': |
| 420 validRuntimes = const ['none']; | 420 validRuntimes = const ['none']; |
| 421 break; | 421 break; |
| 422 case 'none': | 422 case 'none': |
| 423 case 'dart2dart': | 423 case 'dart2dart': |
| 424 validRuntimes = const ['vm', 'drt', 'dartium']; | 424 validRuntimes = const ['vm', 'drt', 'dartium']; |
| 425 break; | 425 break; |
| 426 } | 426 } |
| 427 if (!Contains(config['runtime'], validRuntimes)) { | 427 if (!validRuntimes.contains(config['runtime'])) { |
| 428 isValid = false; | 428 isValid = false; |
| 429 print("Warning: combination of ${config['compiler']} and " | 429 print("Warning: combination of ${config['compiler']} and " |
| 430 "${config['runtime']} is invalid. Skipping this combination."); | 430 "${config['runtime']} is invalid. Skipping this combination."); |
| 431 } | 431 } |
| 432 if ((config['runtime'] == 'ie9' || config['runtime'] == 'ie10') && | 432 if ((config['runtime'] == 'ie9' || config['runtime'] == 'ie10') && |
| 433 Platform.operatingSystem != 'windows') { | 433 Platform.operatingSystem != 'windows') { |
| 434 isValid = false; | 434 isValid = false; |
| 435 print("Warning cannot run Internet Explorer on non-Windows operating" | 435 print("Warning cannot run Internet Explorer on non-Windows operating" |
| 436 " system."); | 436 " system."); |
| 437 } | 437 } |
| 438 if (config['shard'] < 1 || config['shard'] > config['shards']) { | 438 if (config['shard'] < 1 || config['shard'] > config['shards']) { |
| 439 isValid = false; | 439 isValid = false; |
| 440 print("Error: shard index is ${config['shard']} out of " | 440 print("Error: shard index is ${config['shard']} out of " |
| 441 "${config['shards']} shards"); | 441 "${config['shards']} shards"); |
| 442 } | 442 } |
| 443 if (config['runtime'] == 'dartium' && | 443 if (config['runtime'] == 'dartium' && |
| 444 Contains(config['compiler'], const ['none', 'dart2dart']) && | 444 const ['none', 'dart2dart'].contains(config['compiler']) && |
| 445 config['checked']) { | 445 config['checked']) { |
| 446 // TODO(vsm): Set the DART_FLAGS environment appropriately when | 446 // TODO(vsm): Set the DART_FLAGS environment appropriately when |
| 447 // invoking Selenium to support checked mode. It's not clear | 447 // invoking Selenium to support checked mode. It's not clear |
| 448 // the current selenium API supports this. | 448 // the current selenium API supports this. |
| 449 isValid = false; | 449 isValid = false; |
| 450 print("Warning: checked mode is not yet supported for dartium tests."); | 450 print("Warning: checked mode is not yet supported for dartium tests."); |
| 451 } | 451 } |
| 452 return isValid; | 452 return isValid; |
| 453 } | 453 } |
| 454 | 454 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 timeout = 60; | 570 timeout = 60; |
| 571 if (configuration['mode'] == 'debug') { | 571 if (configuration['mode'] == 'debug') { |
| 572 timeout *= 8; | 572 timeout *= 8; |
| 573 } | 573 } |
| 574 if (configuration['host_checked']) { | 574 if (configuration['host_checked']) { |
| 575 timeout *= 16; | 575 timeout *= 16; |
| 576 } | 576 } |
| 577 if (configuration['checked']) { | 577 if (configuration['checked']) { |
| 578 timeout *= 2; | 578 timeout *= 2; |
| 579 } | 579 } |
| 580 if (Contains(configuration['runtime'], | 580 |
| 581 const ['ie9', 'ie10', 'ff', 'chrome', 'safari', | 581 const BROWSERS = const [ |
| 582 'opera'])) { | 582 'ie9', 'ie10', 'ff', 'chrome', 'safari', 'opera' |
| 583 ]; |
| 584 |
| 585 if (BROWSERS.contains(configuration['runtime'])) { |
| 583 timeout *= 8; // Allow additional time for browser testing to run. | 586 timeout *= 8; // Allow additional time for browser testing to run. |
| 584 } | 587 } |
| 585 break; | 588 break; |
| 586 default: | 589 default: |
| 587 if (configuration['mode'] == 'debug') { | 590 if (configuration['mode'] == 'debug') { |
| 588 timeout *= 2; | 591 timeout *= 2; |
| 589 } | 592 } |
| 590 if (Contains(configuration['runtime'], const ['drt', 'dartium'])) { | 593 if (const ['drt', 'dartium'].contains(configuration['runtime'])) { |
| 591 timeout *= 4; // Allow additional time for browser testing to run. | 594 timeout *= 4; // Allow additional time for browser testing to run. |
| 592 } | 595 } |
| 593 break; | 596 break; |
| 594 } | 597 } |
| 595 configuration['timeout'] = timeout; | 598 configuration['timeout'] = timeout; |
| 596 } | 599 } |
| 597 | 600 |
| 598 return [configuration]; | 601 return [configuration]; |
| 599 } | 602 } |
| 600 | 603 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 return option; | 669 return option; |
| 667 } | 670 } |
| 668 } | 671 } |
| 669 print('Unknown test option $name'); | 672 print('Unknown test option $name'); |
| 670 exit(1); | 673 exit(1); |
| 671 } | 674 } |
| 672 | 675 |
| 673 | 676 |
| 674 List<_TestOptionSpecification> _options; | 677 List<_TestOptionSpecification> _options; |
| 675 } | 678 } |
| OLD | NEW |