Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: tools/testing/dart/test_suite.dart

Issue 9233015: Make test.dart run web tests on Windows. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | tools/testing/run_selenium.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 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';
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 13 matching lines...) Expand all
436 compilerArgs.add(compiledDartWrapperFilename); 444 compilerArgs.add(compiledDartWrapperFilename);
437 compilerArgs.add(dartWrapperFilename); 445 compilerArgs.add(dartWrapperFilename);
438 // TODO(whesse): Add --fatal-type-errors if needed. 446 // TODO(whesse): Add --fatal-type-errors if needed.
439 break; 447 break;
440 case 'frogium': 448 case 'frogium':
441 case 'webdriver': 449 case 'webdriver':
442 String libdir = configuration['froglib']; 450 String libdir = configuration['froglib'];
443 if (libdir == '') { 451 if (libdir == '') {
444 libdir = '$dartDir/frog/lib'; 452 libdir = '$dartDir/frog/lib';
445 } 453 }
446 compilerArgs.addAll(['--libdir=$libdir', 454 compilerArgs.addAll(['--compile-only',
447 '--compile-only', 455 '--out=$compiledDartWrapperFilename',
448 '--out=$compiledDartWrapperFilename']); 456 '--libdir=$libdir']);
449 compilerArgs.addAll(vmOptions); 457 compilerArgs.addAll(vmOptions);
450 compilerArgs.add(dartWrapperFilename); 458 compilerArgs.add(dartWrapperFilename);
451 break; 459 break;
452 case 'dartium': 460 case 'dartium':
453 // No compilation phase. 461 // No compilation phase.
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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
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$postfix';
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 =
910 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; 923 ((new Platform().operatingSystem() == 'windows') &&
924 (configuration['component'] != 'frogium' &&
925 configuration['component'] != 'webdriver')) ? '.exe' : '';
Bill Hesse 2012/01/24 09:29:22 I meant that 2/3 of the condition here can be elim
Emily Fortuna 2012/01/24 17:20:22 Right. I ended up fixing it in a new CL here (http
911 switch (configuration['component']) { 926 switch (configuration['component']) {
912 case 'chromium': 927 case 'chromium':
913 case 'dartc': 928 case 'dartc':
914 return 'compiler/bin/dartc$postfix'; 929 return 'compiler/bin/dartc$postfix';
915 case 'frogium': 930 case 'frogium':
916 case 'webdriver': 931 case 'webdriver':
917 return 'frog/bin/frogsh$postfix'; 932 return 'frog/bin/frogsh';
918 default: 933 default:
919 throw "Unknown compiler for: ${configuration['component']}"; 934 throw "Unknown compiler for: ${configuration['component']}";
920 } 935 }
921 } 936 }
922 937
923 static String dartShellFileName(Map configuration) { 938 static String dartShellFileName(Map configuration) {
924 var name = '${buildDir(configuration)}/${executableName(configuration)}'; 939 var name = '${buildDir(configuration)}/${executableName(configuration)}';
925 if (!(new File(name)).existsSync()) { 940 if (!(new File(name)).existsSync()) {
926 throw "Executable '$name' does not exist"; 941 throw "Executable '$name' does not exist";
927 } 942 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 * $noCrash tests are expected to be flaky but not crash 1051 * $noCrash tests are expected to be flaky but not crash
1037 * $pass tests are expected to pass 1052 * $pass tests are expected to pass
1038 * $failOk tests are expected to fail that we won't fix 1053 * $failOk tests are expected to fail that we won't fix
1039 * $fail tests are expected to fail that we should fix 1054 * $fail tests are expected to fail that we should fix
1040 * $crash tests are expected to crash that we should fix 1055 * $crash tests are expected to crash that we should fix
1041 * $timeout tests are allowed to timeout 1056 * $timeout tests are allowed to timeout
1042 """; 1057 """;
1043 print(report); 1058 print(report);
1044 } 1059 }
1045 } 1060 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | tools/testing/run_selenium.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698