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 // TODO(efortuna): this shortening of htmlFilename is a band-aid until | 412 htmlPath = '${tempDir.path}/../../${getHtmlName(filename)}'; |
413 // the above gets fixed. Windows cannot have paths that are longer than | |
414 // 260 characters, and without this hack, we were running past the | |
415 // 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'; | |
421 } | 413 } |
422 final String scriptPath = (component == 'dartium') ? | 414 final String scriptPath = (component == 'dartium') ? |
423 dartWrapperFilename : compiledDartWrapperFilename; | 415 dartWrapperFilename : compiledDartWrapperFilename; |
424 // Create the HTML file for the test. | 416 // Create the HTML file for the test. |
425 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); | 417 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); |
426 htmlTest.writeStringSync(GetHtmlContents( | 418 htmlTest.writeStringSync(GetHtmlContents( |
427 filename, | 419 filename, |
428 '$dartDir/client/testing/unittest/test_controller.js', | 420 '$dartDir/client/testing/unittest/test_controller.js', |
429 scriptType, | 421 scriptType, |
430 scriptPath)); | 422 scriptPath)); |
(...skipping 13 matching lines...) Expand all Loading... |
444 compilerArgs.add(compiledDartWrapperFilename); | 436 compilerArgs.add(compiledDartWrapperFilename); |
445 compilerArgs.add(dartWrapperFilename); | 437 compilerArgs.add(dartWrapperFilename); |
446 // TODO(whesse): Add --fatal-type-errors if needed. | 438 // TODO(whesse): Add --fatal-type-errors if needed. |
447 break; | 439 break; |
448 case 'frogium': | 440 case 'frogium': |
449 case 'webdriver': | 441 case 'webdriver': |
450 String libdir = configuration['froglib']; | 442 String libdir = configuration['froglib']; |
451 if (libdir == '') { | 443 if (libdir == '') { |
452 libdir = '$dartDir/frog/lib'; | 444 libdir = '$dartDir/frog/lib'; |
453 } | 445 } |
454 compilerArgs.addAll(['--compile-only', | 446 compilerArgs.addAll(['--libdir=$libdir', |
455 '--out=$compiledDartWrapperFilename', | 447 '--compile-only', |
456 '--libdir=$libdir']); | 448 '--out=$compiledDartWrapperFilename']); |
457 compilerArgs.addAll(vmOptions); | 449 compilerArgs.addAll(vmOptions); |
458 compilerArgs.add(dartWrapperFilename); | 450 compilerArgs.add(dartWrapperFilename); |
459 break; | 451 break; |
460 case 'dartium': | 452 case 'dartium': |
461 // No compilation phase. | 453 // No compilation phase. |
462 compilerExecutable = null; | 454 compilerExecutable = null; |
463 compilerArgs = null; | 455 compilerArgs = null; |
464 break; | 456 break; |
465 default: | 457 default: |
466 Expect.fail('unimplemented component $component'); | 458 Expect.fail('unimplemented component $component'); |
467 } | 459 } |
468 | 460 |
469 String executable = getFilename(dumpRenderTreeFilename); | 461 String executable = getFilename(dumpRenderTreeFilename); |
470 List<String> args; | 462 List<String> args; |
471 if (component == 'webdriver') { | 463 if (component == 'webdriver') { |
| 464 // TODO(efortuna): These paths are not OS independent! |
472 executable = '$dartDir/tools/testing/run_selenium.py'; | 465 executable = '$dartDir/tools/testing/run_selenium.py'; |
473 if (new Platform().operatingSystem() == 'windows') { | 466 args = ['--out', htmlPath, '--browser', configuration['browser']]; |
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"]}']; | |
480 } else { | 467 } else { |
481 args = ['--no-timeout']; | 468 args = ['--no-timeout']; |
482 if (component == 'dartium') { | 469 if (component == 'dartium') { |
483 var dartFlags = ['--ignore-unrecognized-flags']; | 470 var dartFlags = ['--ignore-unrecognized-flags']; |
484 if (configuration["checked"]) { | 471 if (configuration["checked"]) { |
485 dartFlags.add('--enable_asserts'); | 472 dartFlags.add('--enable_asserts'); |
486 dartFlags.add("--enable_type_checks"); | 473 dartFlags.add("--enable_type_checks"); |
487 } | 474 } |
488 dartFlags.addAll(vmOptions); | 475 dartFlags.addAll(vmOptions); |
489 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); | 476 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 return 'frog/bin/frog$postfix'; | 900 return 'frog/bin/frog$postfix'; |
914 case 'frogsh': | 901 case 'frogsh': |
915 return 'frog/bin/frogsh$postfix'; | 902 return 'frog/bin/frogsh$postfix'; |
916 default: | 903 default: |
917 throw "Unknown executable for: ${configuration['component']}"; | 904 throw "Unknown executable for: ${configuration['component']}"; |
918 } | 905 } |
919 } | 906 } |
920 | 907 |
921 static String compilerName(Map configuration) { | 908 static String compilerName(Map configuration) { |
922 String postfix = | 909 String postfix = |
923 ((new Platform().operatingSystem() == 'windows') && | 910 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; |
924 (configuration['component'] != 'frogium' && | |
925 configuration['component'] != 'webdriver')) ? '.exe' : ''; | |
926 switch (configuration['component']) { | 911 switch (configuration['component']) { |
927 case 'chromium': | 912 case 'chromium': |
928 case 'dartc': | 913 case 'dartc': |
929 return 'compiler/bin/dartc$postfix'; | 914 return 'compiler/bin/dartc$postfix'; |
930 case 'frogium': | 915 case 'frogium': |
931 case 'webdriver': | 916 case 'webdriver': |
932 return 'frog/bin/frogsh'; | 917 return 'frog/bin/frogsh$postfix'; |
933 default: | 918 default: |
934 throw "Unknown compiler for: ${configuration['component']}"; | 919 throw "Unknown compiler for: ${configuration['component']}"; |
935 } | 920 } |
936 } | 921 } |
937 | 922 |
938 static String dartShellFileName(Map configuration) { | 923 static String dartShellFileName(Map configuration) { |
939 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 924 var name = '${buildDir(configuration)}/${executableName(configuration)}'; |
940 if (!(new File(name)).existsSync()) { | 925 if (!(new File(name)).existsSync()) { |
941 throw "Executable '$name' does not exist"; | 926 throw "Executable '$name' does not exist"; |
942 } | 927 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 * $noCrash tests are expected to be flaky but not crash | 1036 * $noCrash tests are expected to be flaky but not crash |
1052 * $pass tests are expected to pass | 1037 * $pass tests are expected to pass |
1053 * $failOk tests are expected to fail that we won't fix | 1038 * $failOk tests are expected to fail that we won't fix |
1054 * $fail tests are expected to fail that we should fix | 1039 * $fail tests are expected to fail that we should fix |
1055 * $crash tests are expected to crash that we should fix | 1040 * $crash tests are expected to crash that we should fix |
1056 * $timeout tests are allowed to timeout | 1041 * $timeout tests are allowed to timeout |
1057 """; | 1042 """; |
1058 print(report); | 1043 print(report); |
1059 } | 1044 } |
1060 } | 1045 } |
OLD | NEW |