| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_suite"); | 5 #library("test_suite"); |
| 6 | 6 |
| 7 #import("dart:io"); | 7 #import("dart:io"); |
| 8 #import("status_file_parser.dart"); | 8 #import("status_file_parser.dart"); |
| 9 #import("test_runner.dart"); | 9 #import("test_runner.dart"); |
| 10 #import("multitest.dart"); | 10 #import("multitest.dart"); |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 compilerExecutable = null; | 463 compilerExecutable = null; |
| 464 compilerArgs = null; | 464 compilerArgs = null; |
| 465 break; | 465 break; |
| 466 default: | 466 default: |
| 467 Expect.fail('unimplemented component $component'); | 467 Expect.fail('unimplemented component $component'); |
| 468 } | 468 } |
| 469 | 469 |
| 470 String executable = getFilename(dumpRenderTreeFilename); | 470 String executable = getFilename(dumpRenderTreeFilename); |
| 471 List<String> args; | 471 List<String> args; |
| 472 if (component == 'webdriver') { | 472 if (component == 'webdriver') { |
| 473 executable = 'python'; | 473 executable = '$dartDir/tools/testing/run_selenium.py'; |
| 474 if (new Platform().operatingSystem() == 'windows') { | 474 if (new Platform().operatingSystem() == 'windows') { |
| 475 // For Windows, the first command, must have the Windows | 475 // For Windows, the first command, must have the Windows |
| 476 // slash direction. | 476 // slash direction. |
| 477 // TODO(efortuna): Get rid of this hack when issue 1306 is fixed. | 477 // TODO(efortuna): Get rid of this hack when issue 1306 is fixed. |
| 478 executable = executable.replaceAll('/', '\\'); | 478 executable = executable.replaceAll('/', '\\'); |
| 479 } | 479 } |
| 480 args = ['$dartDir/tools/testing/run_selenium.py', '--out=$htmlPath', | 480 args = ['--out=$htmlPath', '--browser=${configuration["browser"]}']; |
| 481 '--browser=${configuration["browser"]}']; | |
| 482 } else { | 481 } else { |
| 483 args = ['--no-timeout']; | 482 args = ['--no-timeout']; |
| 484 if (component == 'dartium') { | 483 if (component == 'dartium') { |
| 485 var dartFlags = ['--ignore-unrecognized-flags']; | 484 var dartFlags = ['--ignore-unrecognized-flags']; |
| 486 if (configuration["checked"]) { | 485 if (configuration["checked"]) { |
| 487 dartFlags.add('--enable_asserts'); | 486 dartFlags.add('--enable_asserts'); |
| 488 dartFlags.add("--enable_type_checks"); | 487 dartFlags.add("--enable_type_checks"); |
| 489 } | 488 } |
| 490 dartFlags.addAll(vmOptions); | 489 dartFlags.addAll(vmOptions); |
| 491 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); | 490 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', | 892 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', |
| 894 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', | 893 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', |
| 895 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', | 894 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', |
| 896 '$dartDir/third_party/junit/v4_8_2/junit.jar'], | 895 '$dartDir/third_party/junit/v4_8_2/junit.jar'], |
| 897 ':'); // Path separator. | 896 ':'); // Path separator. |
| 898 } | 897 } |
| 899 } | 898 } |
| 900 | 899 |
| 901 | 900 |
| 902 class TestUtils { | 901 class TestUtils { |
| 903 static String executableSuffix(String component) { | 902 static String get executableSuffix() => |
| 904 if (new Platform().operatingSystem() == 'windows') { | 903 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; |
| 905 if (component != 'frogium' && component != 'webdriver') { | |
| 906 return '.exe'; | |
| 907 } else { | |
| 908 return '.bat'; | |
| 909 } | |
| 910 } | |
| 911 return ''; | |
| 912 } | |
| 913 | 904 |
| 914 static String executableName(Map configuration) { | 905 static String executableName(Map configuration) { |
| 915 String suffix = executableSuffix(configuration['component']); | 906 String postfix = executableSuffix; |
| 916 switch (configuration['component']) { | 907 switch (configuration['component']) { |
| 917 case 'vm': | 908 case 'vm': |
| 918 return 'dart$suffix'; | 909 return 'dart$postfix'; |
| 919 case 'dartc': | 910 case 'dartc': |
| 920 return 'compiler/bin/dartc_test$suffix'; | 911 return 'compiler/bin/dartc_test$postfix'; |
| 921 case 'frog': | 912 case 'frog': |
| 922 case 'leg': | 913 case 'leg': |
| 923 return 'frog/bin/frog$suffix'; | 914 return 'frog/bin/frog$postfix'; |
| 924 case 'frogsh': | 915 case 'frogsh': |
| 925 return 'frog/bin/frogsh$suffix'; | 916 return 'frog/bin/frogsh'; |
| 926 default: | 917 default: |
| 927 throw "Unknown executable for: ${configuration['component']}"; | 918 throw "Unknown executable for: ${configuration['component']}"; |
| 928 } | 919 } |
| 929 } | 920 } |
| 930 | 921 |
| 931 static String compilerName(Map configuration) { | 922 static String compilerName(Map configuration) { |
| 932 String suffix = executableSuffix(configuration['component']); | 923 String postfix = executableSuffix; |
| 933 switch (configuration['component']) { | 924 switch (configuration['component']) { |
| 934 case 'chromium': | 925 case 'chromium': |
| 935 case 'dartc': | 926 case 'dartc': |
| 936 return 'compiler/bin/dartc$suffix'; | 927 return 'compiler/bin/dartc$postfix'; |
| 937 case 'frogium': | 928 case 'frogium': |
| 938 case 'webdriver': | 929 case 'webdriver': |
| 939 return 'frog/bin/frogsh$suffix'; | 930 return 'frog/bin/frogsh'; |
| 940 default: | 931 default: |
| 941 throw "Unknown compiler for: ${configuration['component']}"; | 932 throw "Unknown compiler for: ${configuration['component']}"; |
| 942 } | 933 } |
| 943 } | 934 } |
| 944 | 935 |
| 945 static String dartShellFileName(Map configuration) { | 936 static String dartShellFileName(Map configuration) { |
| 946 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 937 var name = '${buildDir(configuration)}/${executableName(configuration)}'; |
| 947 if (!(new File(name)).existsSync()) { | 938 if (!(new File(name)).existsSync()) { |
| 948 throw "Executable '$name' does not exist"; | 939 throw "Executable '$name' does not exist"; |
| 949 } | 940 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 * $noCrash tests are expected to be flaky but not crash | 1049 * $noCrash tests are expected to be flaky but not crash |
| 1059 * $pass tests are expected to pass | 1050 * $pass tests are expected to pass |
| 1060 * $failOk tests are expected to fail that we won't fix | 1051 * $failOk tests are expected to fail that we won't fix |
| 1061 * $fail tests are expected to fail that we should fix | 1052 * $fail tests are expected to fail that we should fix |
| 1062 * $crash tests are expected to crash that we should fix | 1053 * $crash tests are expected to crash that we should fix |
| 1063 * $timeout tests are allowed to timeout | 1054 * $timeout tests are allowed to timeout |
| 1064 """; | 1055 """; |
| 1065 print(report); | 1056 print(report); |
| 1066 } | 1057 } |
| 1067 } | 1058 } |
| OLD | NEW |