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("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
8 #import("test_runner.dart"); | 8 #import("test_runner.dart"); |
9 #import("multitest.dart"); | 9 #import("multitest.dart"); |
10 | 10 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 domLibraryImport, | 402 domLibraryImport, |
403 '$dartDir/tests/isolate/src/TestFramework.dart', | 403 '$dartDir/tests/isolate/src/TestFramework.dart', |
404 dartLibraryFilename)); | 404 dartLibraryFilename)); |
405 dartWrapper.closeSync(); | 405 dartWrapper.closeSync(); |
406 } else { | 406 } else { |
407 dartWrapperFilename = testPath; | 407 dartWrapperFilename = testPath; |
408 // TODO(whesse): Once test.py is retired, adjust the relative path in | 408 // TODO(whesse): Once test.py is retired, adjust the relative path in |
409 // the client/samples/dartcombat test to its css file, remove the | 409 // the client/samples/dartcombat test to its css file, remove the |
410 // "../../" from this path, and move this out of the isWebTest guard. | 410 // "../../" from this path, and move this out of the isWebTest guard. |
411 // Also remove getHtmlName, and just use test.html. | 411 // Also remove getHtmlName, and just use test.html. |
412 htmlPath = '${tempDir.path}/../../${getHtmlName(filename)}'; | 412 // TODO(efortuna): this shortening of htmlFilename is a band-aid until |
| 413 // the above TODO gets fixed. Windows cannot have paths that are longer |
| 414 // than 260 characters, and without this hack, we were running past the |
| 415 // the limit. |
| 416 String htmlFilename = getHtmlName(filename); |
| 417 while ('${tempDir.path}/../../$htmlFilename'.length >= 260) { |
| 418 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); |
| 419 } |
| 420 htmlPath = '${tempDir.path}/../../$htmlFilename'; |
413 } | 421 } |
414 final String scriptPath = (component == 'dartium') ? | 422 final String scriptPath = (component == 'dartium') ? |
415 dartWrapperFilename : compiledDartWrapperFilename; | 423 dartWrapperFilename : compiledDartWrapperFilename; |
416 // Create the HTML file for the test. | 424 // Create the HTML file for the test. |
417 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); | 425 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); |
418 htmlTest.writeStringSync(GetHtmlContents( | 426 htmlTest.writeStringSync(GetHtmlContents( |
419 filename, | 427 filename, |
420 '$dartDir/client/testing/unittest/test_controller.js', | 428 '$dartDir/client/testing/unittest/test_controller.js', |
421 scriptType, | 429 scriptType, |
422 scriptPath)); | 430 scriptPath)); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 compilerExecutable = null; | 462 compilerExecutable = null; |
455 compilerArgs = null; | 463 compilerArgs = null; |
456 break; | 464 break; |
457 default: | 465 default: |
458 Expect.fail('unimplemented component $component'); | 466 Expect.fail('unimplemented component $component'); |
459 } | 467 } |
460 | 468 |
461 String executable = getFilename(dumpRenderTreeFilename); | 469 String executable = getFilename(dumpRenderTreeFilename); |
462 List<String> args; | 470 List<String> args; |
463 if (component == 'webdriver') { | 471 if (component == 'webdriver') { |
464 // TODO(efortuna): These paths are not OS independent! | |
465 executable = '$dartDir/tools/testing/run_selenium.py'; | 472 executable = '$dartDir/tools/testing/run_selenium.py'; |
466 args = ['--out', htmlPath, '--browser', configuration['browser']]; | 473 if (new Platform().operatingSystem() == 'windows') { |
| 474 // For Windows, the first command, must have the Windows |
| 475 // slash direction. |
| 476 // TODO(efortuna): Get rid of this hack when issue 1306 is fixed. |
| 477 executable = executable.replaceAll('/', '\\'); |
| 478 } |
| 479 args = ['--out=$htmlPath', '--browser=${configuration["browser"]}']; |
467 } else { | 480 } else { |
468 args = ['--no-timeout']; | 481 args = ['--no-timeout']; |
469 if (component == 'dartium') { | 482 if (component == 'dartium') { |
470 var dartFlags = ['--ignore-unrecognized-flags']; | 483 var dartFlags = ['--ignore-unrecognized-flags']; |
471 if (configuration["checked"]) { | 484 if (configuration["checked"]) { |
472 dartFlags.add('--enable_asserts'); | 485 dartFlags.add('--enable_asserts'); |
473 dartFlags.add("--enable_type_checks"); | 486 dartFlags.add("--enable_type_checks"); |
474 } | 487 } |
475 dartFlags.addAll(vmOptions); | 488 dartFlags.addAll(vmOptions); |
476 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); | 489 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 String postfix = executableSuffix; | 905 String postfix = executableSuffix; |
893 switch (configuration['component']) { | 906 switch (configuration['component']) { |
894 case 'vm': | 907 case 'vm': |
895 return 'dart$postfix'; | 908 return 'dart$postfix'; |
896 case 'dartc': | 909 case 'dartc': |
897 return 'compiler/bin/dartc_test$postfix'; | 910 return 'compiler/bin/dartc_test$postfix'; |
898 case 'frog': | 911 case 'frog': |
899 case 'leg': | 912 case 'leg': |
900 return 'frog/bin/frog$postfix'; | 913 return 'frog/bin/frog$postfix'; |
901 case 'frogsh': | 914 case 'frogsh': |
902 return 'frog/bin/frogsh$postfix'; | 915 return 'frog/bin/frogsh'; |
903 default: | 916 default: |
904 throw "Unknown executable for: ${configuration['component']}"; | 917 throw "Unknown executable for: ${configuration['component']}"; |
905 } | 918 } |
906 } | 919 } |
907 | 920 |
908 static String compilerName(Map configuration) { | 921 static String compilerName(Map configuration) { |
909 String postfix = | 922 String postfix = executableSuffix; |
910 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; | |
911 switch (configuration['component']) { | 923 switch (configuration['component']) { |
912 case 'chromium': | 924 case 'chromium': |
913 case 'dartc': | 925 case 'dartc': |
914 return 'compiler/bin/dartc$postfix'; | 926 return 'compiler/bin/dartc$postfix'; |
915 case 'frogium': | 927 case 'frogium': |
916 case 'webdriver': | 928 case 'webdriver': |
917 return 'frog/bin/frogsh$postfix'; | 929 return 'frog/bin/frogsh'; |
918 default: | 930 default: |
919 throw "Unknown compiler for: ${configuration['component']}"; | 931 throw "Unknown compiler for: ${configuration['component']}"; |
920 } | 932 } |
921 } | 933 } |
922 | 934 |
923 static String dartShellFileName(Map configuration) { | 935 static String dartShellFileName(Map configuration) { |
924 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 936 var name = '${buildDir(configuration)}/${executableName(configuration)}'; |
925 if (!(new File(name)).existsSync()) { | 937 if (!(new File(name)).existsSync()) { |
926 throw "Executable '$name' does not exist"; | 938 throw "Executable '$name' does not exist"; |
927 } | 939 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 * $noCrash tests are expected to be flaky but not crash | 1048 * $noCrash tests are expected to be flaky but not crash |
1037 * $pass tests are expected to pass | 1049 * $pass tests are expected to pass |
1038 * $failOk tests are expected to fail that we won't fix | 1050 * $failOk tests are expected to fail that we won't fix |
1039 * $fail tests are expected to fail that we should fix | 1051 * $fail tests are expected to fail that we should fix |
1040 * $crash tests are expected to crash that we should fix | 1052 * $crash tests are expected to crash that we should fix |
1041 * $timeout tests are allowed to timeout | 1053 * $timeout tests are allowed to timeout |
1042 """; | 1054 """; |
1043 print(report); | 1055 print(report); |
1044 } | 1056 } |
1045 } | 1057 } |
OLD | NEW |