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

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

Issue 9535012: Introduce the legium component in test.dart, and start support for dart:dom and dart:html. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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_options.dart ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * Classes and methods for enumerating and preparing tests. 6 * Classes and methods for enumerating and preparing tests.
7 * 7 *
8 * This library includes: 8 * This library includes:
9 * 9 *
10 * - Creating tests by listing all the Dart files in certain directories, 10 * - Creating tests by listing all the Dart files in certain directories,
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 for (var dummy in optionsFromFile["vmOptions"]) { 324 for (var dummy in optionsFromFile["vmOptions"]) {
325 SummaryReport.add(expectations); 325 SummaryReport.add(expectations);
326 } 326 }
327 } 327 }
328 if (expectations.contains(SKIP)) return; 328 if (expectations.contains(SKIP)) return;
329 329
330 switch (configuration['component']) { 330 switch (configuration['component']) {
331 case 'dartium': 331 case 'dartium':
332 case 'chromium': 332 case 'chromium':
333 case 'frogium': 333 case 'frogium':
334 case 'legium':
334 case 'webdriver': 335 case 'webdriver':
335 enqueueBrowserTest(filename, testName, optionsFromFile, 336 enqueueBrowserTest(filename, testName, optionsFromFile,
336 expectations, isNegative); 337 expectations, isNegative);
337 break; 338 break;
338 default: 339 default:
339 isNegative = isNegative || 340 isNegative = isNegative ||
340 (configuration['checked'] && info.isNegativeIfChecked); 341 (configuration['checked'] && info.isNegativeIfChecked);
341 bool enableFatalTypeErrors = false; 342 bool enableFatalTypeErrors = false;
342 343
343 if (configuration['component'] == 'dartc') { 344 if (configuration['component'] == 'dartc') {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 args.addAll(['--work', dir]); 585 args.addAll(['--work', dir]);
585 args.addAll(vmOptions); 586 args.addAll(vmOptions);
586 args.add('--ignore-unrecognized-flags'); 587 args.add('--ignore-unrecognized-flags');
587 // TODO(zundel): remove assumption of generated code from dartc 588 // TODO(zundel): remove assumption of generated code from dartc
588 args.add('--out'); 589 args.add('--out');
589 args.add(outputFile); 590 args.add(outputFile);
590 args.add(inputFile); 591 args.add(inputFile);
591 // TODO(whesse): Add --fatal-type-errors if needed. 592 // TODO(whesse): Add --fatal-type-errors if needed.
592 break; 593 break;
593 case 'frogium': 594 case 'frogium':
595 case 'legium':
594 case 'webdriver': 596 case 'webdriver':
595 String libdir = configuration['froglib']; 597 String libdir = configuration['froglib'];
596 if (libdir == '') { 598 if (libdir == '') {
597 libdir = '$dartDir/frog/lib'; 599 libdir = '$dartDir/frog/lib';
598 } 600 }
599 args.addAll(['--libdir=$libdir', 601 args.addAll(['--libdir=$libdir',
600 '--compile-only', 602 '--compile-only',
601 '--out=$outputFile']); 603 '--out=$outputFile']);
602 args.addAll(vmOptions); 604 args.addAll(vmOptions);
603 args.add(inputFile); 605 args.add(inputFile);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 } 682 }
681 return tempDir; 683 return tempDir;
682 } 684 }
683 685
684 String get scriptType() { 686 String get scriptType() {
685 switch (configuration['component']) { 687 switch (configuration['component']) {
686 case 'dartium': 688 case 'dartium':
687 return 'application/dart'; 689 return 'application/dart';
688 case 'chromium': 690 case 'chromium':
689 case 'frogium': 691 case 'frogium':
692 case 'legium':
690 case 'webdriver': 693 case 'webdriver':
691 return 'text/javascript'; 694 return 'text/javascript';
692 default: 695 default:
693 Expect.fail('Unimplemented component scriptType'); 696 Expect.fail('Unimplemented component scriptType');
694 return null; 697 return null;
695 } 698 }
696 } 699 }
697 700
698 String getHtmlName(String filename) { 701 String getHtmlName(String filename) {
699 return filename.replaceAll('/', '_').replaceAll(':', '_') 702 return filename.replaceAll('/', '_').replaceAll(':', '_')
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', 1019 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar',
1017 '$dartDir/third_party/junit/v4_8_2/junit.jar'], 1020 '$dartDir/third_party/junit/v4_8_2/junit.jar'],
1018 ':'); // Path separator. 1021 ':'); // Path separator.
1019 } 1022 }
1020 } 1023 }
1021 1024
1022 1025
1023 class TestUtils { 1026 class TestUtils {
1024 static String executableSuffix(String component) { 1027 static String executableSuffix(String component) {
1025 if (new Platform().operatingSystem() == 'windows') { 1028 if (new Platform().operatingSystem() == 'windows') {
1026 if (component != 'frogium' && component != 'webdriver') { 1029 if (component != 'frogium'
1030 && component != 'legium'
1031 && component != 'webdriver') {
1027 return '.exe'; 1032 return '.exe';
1028 } else { 1033 } else {
1029 return '.bat'; 1034 return '.bat';
1030 } 1035 }
1031 } 1036 }
1032 return ''; 1037 return '';
1033 } 1038 }
1034 1039
1035 static String executableName(Map configuration) { 1040 static String executableName(Map configuration) {
1036 String suffix = executableSuffix(configuration['component']); 1041 String suffix = executableSuffix(configuration['component']);
(...skipping 12 matching lines...) Expand all
1049 } 1054 }
1050 } 1055 }
1051 1056
1052 static String compilerName(Map configuration) { 1057 static String compilerName(Map configuration) {
1053 String suffix = executableSuffix(configuration['component']); 1058 String suffix = executableSuffix(configuration['component']);
1054 switch (configuration['component']) { 1059 switch (configuration['component']) {
1055 case 'chromium': 1060 case 'chromium':
1056 case 'dartc': 1061 case 'dartc':
1057 return 'compiler/bin/dartc$suffix'; 1062 return 'compiler/bin/dartc$suffix';
1058 case 'frogium': 1063 case 'frogium':
1064 case 'legium':
1059 case 'webdriver': 1065 case 'webdriver':
1060 return 'frog/bin/frog$suffix'; 1066 return 'frog/bin/frog$suffix';
1061 default: 1067 default:
1062 throw "Unknown compiler for: ${configuration['component']}"; 1068 throw "Unknown compiler for: ${configuration['component']}";
1063 } 1069 }
1064 } 1070 }
1065 1071
1066 static String dartShellFileName(Map configuration) { 1072 static String dartShellFileName(Map configuration) {
1067 var name = '${buildDir(configuration)}/${executableName(configuration)}'; 1073 var name = '${buildDir(configuration)}/${executableName(configuration)}';
1068 if (!(new File(name)).existsSync() && !configuration['list']) { 1074 if (!(new File(name)).existsSync() && !configuration['list']) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/')); 1114 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
1109 return new File('$toolsDir/..').fullPathSync().replaceAll('\\', '/'); 1115 return new File('$toolsDir/..').fullPathSync().replaceAll('\\', '/');
1110 } 1116 }
1111 1117
1112 static List<String> standardOptions(Map configuration) { 1118 static List<String> standardOptions(Map configuration) {
1113 List args = ["--ignore-unrecognized-flags"]; 1119 List args = ["--ignore-unrecognized-flags"];
1114 if (configuration["checked"]) { 1120 if (configuration["checked"]) {
1115 args.add('--enable_asserts'); 1121 args.add('--enable_asserts');
1116 args.add("--enable_type_checks"); 1122 args.add("--enable_type_checks");
1117 } 1123 }
1118 if (configuration["component"] == "leg") { 1124 if (configuration["component"] == "leg"
1125 || configuration["component"] == "legium") {
1119 args.add("--verbose"); 1126 args.add("--verbose");
1120 args.add("--leg"); 1127 args.add("--leg");
1121 } 1128 }
1122 return args; 1129 return args;
1123 } 1130 }
1124 } 1131 }
1125 1132
1126 class SummaryReport { 1133 class SummaryReport {
1127 static int total = 0; 1134 static int total = 0;
1128 static int skipped = 0; 1135 static int skipped = 0;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 * $noCrash tests are expected to be flaky but not crash 1174 * $noCrash tests are expected to be flaky but not crash
1168 * $pass tests are expected to pass 1175 * $pass tests are expected to pass
1169 * $failOk tests are expected to fail that we won't fix 1176 * $failOk tests are expected to fail that we won't fix
1170 * $fail tests are expected to fail that we should fix 1177 * $fail tests are expected to fail that we should fix
1171 * $crash tests are expected to crash that we should fix 1178 * $crash tests are expected to crash that we should fix
1172 * $timeout tests are allowed to timeout 1179 * $timeout tests are allowed to timeout
1173 """; 1180 """;
1174 print(report); 1181 print(report);
1175 } 1182 }
1176 } 1183 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698