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 = '$dartDir/tools/testing/run_selenium.py'; | 473 executable = 'python'; |
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 = ['--out=$htmlPath', '--browser=${configuration["browser"]}']; | 480 args = ['$dartDir/tools/testing/run_selenium.py', '--out=$htmlPath', |
| 481 '--browser=${configuration["browser"]}']; |
481 } else { | 482 } else { |
482 args = ['--no-timeout']; | 483 args = ['--no-timeout']; |
483 if (component == 'dartium') { | 484 if (component == 'dartium') { |
484 var dartFlags = ['--ignore-unrecognized-flags']; | 485 var dartFlags = ['--ignore-unrecognized-flags']; |
485 if (configuration["checked"]) { | 486 if (configuration["checked"]) { |
486 dartFlags.add('--enable_asserts'); | 487 dartFlags.add('--enable_asserts'); |
487 dartFlags.add("--enable_type_checks"); | 488 dartFlags.add("--enable_type_checks"); |
488 } | 489 } |
489 dartFlags.addAll(vmOptions); | 490 dartFlags.addAll(vmOptions); |
490 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); | 491 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', | 893 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', |
893 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', | 894 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', |
894 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', | 895 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', |
895 '$dartDir/third_party/junit/v4_8_2/junit.jar'], | 896 '$dartDir/third_party/junit/v4_8_2/junit.jar'], |
896 ':'); // Path separator. | 897 ':'); // Path separator. |
897 } | 898 } |
898 } | 899 } |
899 | 900 |
900 | 901 |
901 class TestUtils { | 902 class TestUtils { |
902 static String get executableSuffix() => | 903 static String executableSuffix(String component) { |
903 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; | 904 if (new Platform().operatingSystem() == 'windows') { |
| 905 if (component != 'frogium' && component != 'webdriver') { |
| 906 return '.exe'; |
| 907 } else { |
| 908 return '.bat'; |
| 909 } |
| 910 } |
| 911 return ''; |
| 912 } |
904 | 913 |
905 static String executableName(Map configuration) { | 914 static String executableName(Map configuration) { |
906 String postfix = executableSuffix; | 915 String suffix = executableSuffix(configuration['component']); |
907 switch (configuration['component']) { | 916 switch (configuration['component']) { |
908 case 'vm': | 917 case 'vm': |
909 return 'dart$postfix'; | 918 return 'dart$suffix'; |
910 case 'dartc': | 919 case 'dartc': |
911 return 'compiler/bin/dartc_test$postfix'; | 920 return 'compiler/bin/dartc_test$suffix'; |
912 case 'frog': | 921 case 'frog': |
913 case 'leg': | 922 case 'leg': |
914 return 'frog/bin/frog$postfix'; | 923 return 'frog/bin/frog$suffix'; |
915 case 'frogsh': | 924 case 'frogsh': |
916 return 'frog/bin/frogsh'; | 925 return 'frog/bin/frogsh$suffix'; |
917 default: | 926 default: |
918 throw "Unknown executable for: ${configuration['component']}"; | 927 throw "Unknown executable for: ${configuration['component']}"; |
919 } | 928 } |
920 } | 929 } |
921 | 930 |
922 static String compilerName(Map configuration) { | 931 static String compilerName(Map configuration) { |
923 String postfix = executableSuffix; | 932 String suffix = executableSuffix(configuration['component']); |
924 switch (configuration['component']) { | 933 switch (configuration['component']) { |
925 case 'chromium': | 934 case 'chromium': |
926 case 'dartc': | 935 case 'dartc': |
927 return 'compiler/bin/dartc$postfix'; | 936 return 'compiler/bin/dartc$suffix'; |
928 case 'frogium': | 937 case 'frogium': |
929 case 'webdriver': | 938 case 'webdriver': |
930 return 'frog/bin/frogsh'; | 939 return 'frog/bin/frogsh$suffix'; |
931 default: | 940 default: |
932 throw "Unknown compiler for: ${configuration['component']}"; | 941 throw "Unknown compiler for: ${configuration['component']}"; |
933 } | 942 } |
934 } | 943 } |
935 | 944 |
936 static String dartShellFileName(Map configuration) { | 945 static String dartShellFileName(Map configuration) { |
937 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 946 var name = '${buildDir(configuration)}/${executableName(configuration)}'; |
938 if (!(new File(name)).existsSync()) { | 947 if (!(new File(name)).existsSync()) { |
939 throw "Executable '$name' does not exist"; | 948 throw "Executable '$name' does not exist"; |
940 } | 949 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 * $noCrash tests are expected to be flaky but not crash | 1058 * $noCrash tests are expected to be flaky but not crash |
1050 * $pass tests are expected to pass | 1059 * $pass tests are expected to pass |
1051 * $failOk tests are expected to fail that we won't fix | 1060 * $failOk tests are expected to fail that we won't fix |
1052 * $fail tests are expected to fail that we should fix | 1061 * $fail tests are expected to fail that we should fix |
1053 * $crash tests are expected to crash that we should fix | 1062 * $crash tests are expected to crash that we should fix |
1054 * $timeout tests are allowed to timeout | 1063 * $timeout tests are allowed to timeout |
1055 """; | 1064 """; |
1056 print(report); | 1065 print(report); |
1057 } | 1066 } |
1058 } | 1067 } |
OLD | NEW |