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

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
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.
Bill Hesse 2012/01/22 20:52:02 Let's file a bug - this needs to get fixed.
Emily Fortuna 2012/01/23 18:27:41 File a bug on Microsoft? This is a Windows API iss
Emily Fortuna 2012/01/23 19:18:49 Talked to Siggi about this. Once you fix your abov
416 String htmlFilename = getHtmlName(filename);
417 htmlFilename = htmlFilename.substring(htmlFilename.length~/2);
Siggi Cherem (dart-lang) 2012/01/23 00:29:02 could we do this selectively (only when we are clo
418 htmlPath = '${tempDir.path}/../../$htmlFilename';
413 } 419 }
414 final String scriptPath = (component == 'dartium') ? 420 final String scriptPath = (component == 'dartium') ?
415 dartWrapperFilename : compiledDartWrapperFilename; 421 dartWrapperFilename : compiledDartWrapperFilename;
416 // Create the HTML file for the test. 422 // Create the HTML file for the test.
417 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); 423 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE);
418 htmlTest.writeStringSync(GetHtmlContents( 424 htmlTest.writeStringSync(GetHtmlContents(
419 filename, 425 filename,
420 '$dartDir/client/testing/unittest/test_controller.js', 426 '$dartDir/client/testing/unittest/test_controller.js',
421 scriptType, 427 scriptType,
422 scriptPath)); 428 scriptPath));
(...skipping 10 matching lines...) Expand all
433 compilerArgs.addAll(vmOptions); 439 compilerArgs.addAll(vmOptions);
434 compilerArgs.add('--ignore-unrecognized-flags'); 440 compilerArgs.add('--ignore-unrecognized-flags');
435 compilerArgs.add('--out'); 441 compilerArgs.add('--out');
436 compilerArgs.add(compiledDartWrapperFilename); 442 compilerArgs.add(compiledDartWrapperFilename);
437 compilerArgs.add(dartWrapperFilename); 443 compilerArgs.add(dartWrapperFilename);
438 // TODO(whesse): Add --fatal-type-errors if needed. 444 // TODO(whesse): Add --fatal-type-errors if needed.
439 break; 445 break;
440 case 'frogium': 446 case 'frogium':
441 case 'webdriver': 447 case 'webdriver':
442 String libdir = configuration['froglib']; 448 String libdir = configuration['froglib'];
443 if (libdir == '') { 449 if (libdir == '' && ! compilerExecutable.endsWith('frogsh')) {
Siggi Cherem (dart-lang) 2012/01/23 00:29:02 remove space after !
Emily Fortuna 2012/01/23 18:27:41 Done.
444 libdir = '$dartDir/frog/lib'; 450 libdir = '$dartDir/frog/lib';
445 } 451 }
446 compilerArgs.addAll(['--libdir=$libdir', 452 if (!compilerExecutable.endsWith('frogsh')) {
Siggi Cherem (dart-lang) 2012/01/23 00:29:02 I thought there was going to be a different libdir
447 '--compile-only', 453 compilerArgs.add('--libdir=$libdir');
454 }
455 compilerArgs.addAll(['--compile-only',
448 '--out=$compiledDartWrapperFilename']); 456 '--out=$compiledDartWrapperFilename']);
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 executable = executable.replaceAll('/', '\\');
Bill Hesse 2012/01/22 20:52:02 TODO, with bug number.
Emily Fortuna 2012/01/23 18:27:41 Done.
477 }
478 args = ['--out=$htmlPath', '--browser=${configuration["browser"]}'];
467 } else { 479 } else {
468 args = ['--no-timeout']; 480 args = ['--no-timeout'];
469 if (component == 'dartium') { 481 if (component == 'dartium') {
470 var dartFlags = ['--ignore-unrecognized-flags']; 482 var dartFlags = ['--ignore-unrecognized-flags'];
471 if (configuration["checked"]) { 483 if (configuration["checked"]) {
472 dartFlags.add('--enable_asserts'); 484 dartFlags.add('--enable_asserts');
473 dartFlags.add("--enable_type_checks"); 485 dartFlags.add("--enable_type_checks");
474 } 486 }
475 dartFlags.addAll(vmOptions); 487 dartFlags.addAll(vmOptions);
476 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); 488 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'; 912 return 'frog/bin/frog$postfix';
901 case 'frogsh': 913 case 'frogsh':
902 return 'frog/bin/frogsh$postfix'; 914 return 'frog/bin/frogsh$postfix';
903 default: 915 default:
904 throw "Unknown executable for: ${configuration['component']}"; 916 throw "Unknown executable for: ${configuration['component']}";
905 } 917 }
906 } 918 }
907 919
908 static String compilerName(Map configuration) { 920 static String compilerName(Map configuration) {
909 String postfix = 921 String postfix =
910 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; 922 ((new Platform().operatingSystem() == 'windows') &&
923 (configuration['component'] != 'frogium' &&
924 configuration['component'] != 'webdriver')) ? '.exe' : '';
911 switch (configuration['component']) { 925 switch (configuration['component']) {
912 case 'chromium': 926 case 'chromium':
913 case 'dartc': 927 case 'dartc':
914 return 'compiler/bin/dartc$postfix'; 928 return 'compiler/bin/dartc$postfix';
915 case 'frogium': 929 case 'frogium':
916 case 'webdriver': 930 case 'webdriver':
917 return 'frog/bin/frogsh$postfix'; 931 return 'frog/bin/frogsh$postfix';
Bill Hesse 2012/01/22 20:52:02 Can't you just remove $postfix from this line here
Siggi Cherem (dart-lang) 2012/01/23 00:29:02 Also: if there is a postfix, it should be .bat in
Emily Fortuna 2012/01/23 18:27:41 @Siggi: For windows you can call the .bat file wit
918 default: 932 default:
919 throw "Unknown compiler for: ${configuration['component']}"; 933 throw "Unknown compiler for: ${configuration['component']}";
920 } 934 }
921 } 935 }
922 936
923 static String dartShellFileName(Map configuration) { 937 static String dartShellFileName(Map configuration) {
924 var name = '${buildDir(configuration)}/${executableName(configuration)}'; 938 var name = '${buildDir(configuration)}/${executableName(configuration)}';
925 if (!(new File(name)).existsSync()) { 939 if (!(new File(name)).existsSync()) {
926 throw "Executable '$name' does not exist"; 940 throw "Executable '$name' does not exist";
927 } 941 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 * $noCrash tests are expected to be flaky but not crash 1050 * $noCrash tests are expected to be flaky but not crash
1037 * $pass tests are expected to pass 1051 * $pass tests are expected to pass
1038 * $failOk tests are expected to fail that we won't fix 1052 * $failOk tests are expected to fail that we won't fix
1039 * $fail tests are expected to fail that we should fix 1053 * $fail tests are expected to fail that we should fix
1040 * $crash tests are expected to crash that we should fix 1054 * $crash tests are expected to crash that we should fix
1041 * $timeout tests are allowed to timeout 1055 * $timeout tests are allowed to timeout
1042 """; 1056 """;
1043 print(report); 1057 print(report);
1044 } 1058 }
1045 } 1059 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698