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

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

Issue 1126363003: Remove dart2dart support from testing scripts and status files (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 5 years, 7 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') | 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 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 var fullHtmlPath = 1321 var fullHtmlPath =
1322 _getUriForBrowserTest(htmlPath_subtest, subtestName).toString(); 1322 _getUriForBrowserTest(htmlPath_subtest, subtestName).toString();
1323 1323
1324 if (runtime == "drt") { 1324 if (runtime == "drt") {
1325 var dartFlags = []; 1325 var dartFlags = [];
1326 var contentShellOptions = []; 1326 var contentShellOptions = [];
1327 1327
1328 contentShellOptions.add('--no-timeout'); 1328 contentShellOptions.add('--no-timeout');
1329 contentShellOptions.add('--dump-render-tree'); 1329 contentShellOptions.add('--dump-render-tree');
1330 1330
1331 if (compiler == 'none' || compiler == 'dart2dart') { 1331 if (compiler == 'none') {
1332 dartFlags.add('--ignore-unrecognized-flags'); 1332 dartFlags.add('--ignore-unrecognized-flags');
1333 if (configuration["checked"]) { 1333 if (configuration["checked"]) {
1334 dartFlags.add('--enable_asserts'); 1334 dartFlags.add('--enable_asserts');
1335 dartFlags.add("--enable_type_checks"); 1335 dartFlags.add("--enable_type_checks");
1336 } 1336 }
1337 dartFlags.addAll(vmOptions); 1337 dartFlags.addAll(vmOptions);
1338 } 1338 }
1339 1339
1340 commandSet.add( 1340 commandSet.add(
1341 CommandBuilder.instance.getContentShellCommand( 1341 CommandBuilder.instance.getContentShellCommand(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 info, 1448 info,
1449 isNegative(info), 1449 isNegative(info),
1450 fullHtmlPath); 1450 fullHtmlPath);
1451 enqueueNewTestCase(testCase); 1451 enqueueNewTestCase(testCase);
1452 return; 1452 return;
1453 } 1453 }
1454 1454
1455 /** Helper to create a compilation command for a single input file. */ 1455 /** Helper to create a compilation command for a single input file. */
1456 Command _compileCommand(String inputFile, String outputFile, 1456 Command _compileCommand(String inputFile, String outputFile,
1457 String compiler, String dir, optionsFromFile) { 1457 String compiler, String dir, optionsFromFile) {
1458 assert (['dart2js', 'dart2dart'].contains(compiler)); 1458 assert (compiler == 'dart2js')
1459 List<String> args; 1459 List<String> args;
1460 if (compilerPath.endsWith('.dart')) { 1460 if (compilerPath.endsWith('.dart')) {
1461 // Run the compiler script via the Dart VM. 1461 // Run the compiler script via the Dart VM.
1462 args = [compilerPath]; 1462 args = [compilerPath];
1463 } else { 1463 } else {
1464 args = []; 1464 args = [];
1465 } 1465 }
1466 args.addAll(TestUtils.standardOptions(configuration)); 1466 args.addAll(TestUtils.standardOptions(configuration));
1467 String packageRoot = 1467 String packageRoot =
1468 packageRootArgument(optionsFromFile['packageRoot']); 1468 packageRootArgument(optionsFromFile['packageRoot']);
(...skipping 19 matching lines...) Expand all
1488 ..add('--file-filter')..add('.svn'); 1488 ..add('--file-filter')..add('.svn');
1489 if (configuration['csp']) args.add('--csp'); 1489 if (configuration['csp']) args.add('--csp');
1490 1490
1491 return CommandBuilder.instance.getProcessCommand( 1491 return CommandBuilder.instance.getProcessCommand(
1492 'polymer_deploy', dartVmBinaryFileName, args, environmentOverrides); 1492 'polymer_deploy', dartVmBinaryFileName, args, environmentOverrides);
1493 } 1493 }
1494 1494
1495 String get scriptType { 1495 String get scriptType {
1496 switch (configuration['compiler']) { 1496 switch (configuration['compiler']) {
1497 case 'none': 1497 case 'none':
1498 case 'dart2dart':
1499 return 'application/dart'; 1498 return 'application/dart';
1500 case 'dart2js': 1499 case 'dart2js':
1501 case 'dartanalyzer': 1500 case 'dartanalyzer':
1502 case 'dart2analyzer': 1501 case 'dart2analyzer':
1503 return 'text/javascript'; 1502 return 'text/javascript';
1504 default: 1503 default:
1505 print('Non-web runtime, so no scriptType for: ' 1504 print('Non-web runtime, so no scriptType for: '
1506 '${configuration["compiler"]}'); 1505 '${configuration["compiler"]}');
1507 exit(1); 1506 exit(1);
1508 return null; 1507 return null;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 * Special options for individual tests are currently specified in various 1584 * Special options for individual tests are currently specified in various
1586 * ways: with comments directly in test files, by using certain imports, or by 1585 * ways: with comments directly in test files, by using certain imports, or by
1587 * creating additional files in the test directories. 1586 * creating additional files in the test directories.
1588 * 1587 *
1589 * Here is a list of options that are used by 'test.dart' today: 1588 * Here is a list of options that are used by 'test.dart' today:
1590 * - Flags can be passed to the vm or dartium process that runs the test by 1589 * - Flags can be passed to the vm or dartium process that runs the test by
1591 * adding a comment to the test file: 1590 * adding a comment to the test file:
1592 * 1591 *
1593 * // VMOptions=--flag1 --flag2 1592 * // VMOptions=--flag1 --flag2
1594 * 1593 *
1595 * - Flags can be passed to dart2js, dart2dart or vm by adding a comment 1594 * - Flags can be passed to dart2js or vm by adding a comment
1596 * to the test file: 1595 * to the test file:
1597 * 1596 *
1598 * // SharedOptions=--flag1 --flag2 1597 * // SharedOptions=--flag1 --flag2
1599 * 1598 *
1600 * - Flags can be passed to the dart script that contains the test also 1599 * - Flags can be passed to the dart script that contains the test also
1601 * using comments, as follows: 1600 * using comments, as follows:
1602 * 1601 *
1603 * // DartOptions=--flag1 --flag2 1602 * // DartOptions=--flag1 --flag2
1604 * 1603 *
1605 * - For tests that depend on compiling other files with dart2js (e.g. 1604 * - For tests that depend on compiling other files with dart2js (e.g.
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 "hasStaticWarning" : false, 1736 "hasStaticWarning" : false,
1738 "otherScripts": otherScripts, 1737 "otherScripts": otherScripts,
1739 "isMultitest": isMultitest, 1738 "isMultitest": isMultitest,
1740 "isMultiHtmlTest": isMultiHtmlTest, 1739 "isMultiHtmlTest": isMultiHtmlTest,
1741 "subtestNames": subtestNames, 1740 "subtestNames": subtestNames,
1742 "isolateStubs": isolateStubs, 1741 "isolateStubs": isolateStubs,
1743 "containsDomImport": containsDomImport }; 1742 "containsDomImport": containsDomImport };
1744 } 1743 }
1745 1744
1746 List<List<String>> getVmOptions(Map optionsFromFile) { 1745 List<List<String>> getVmOptions(Map optionsFromFile) {
1747 var COMPILERS = const ['none', 'dart2dart']; 1746 var COMPILERS = const ['none'];
1748 var RUNTIMES = const ['none', 'vm', 'drt', 'dartium', 1747 var RUNTIMES = const ['none', 'vm', 'drt', 'dartium',
1749 'ContentShellOnAndroid', 'DartiumOnAndroid']; 1748 'ContentShellOnAndroid', 'DartiumOnAndroid'];
1750 var needsVmOptions = COMPILERS.contains(configuration['compiler']) && 1749 var needsVmOptions = COMPILERS.contains(configuration['compiler']) &&
1751 RUNTIMES.contains(configuration['runtime']); 1750 RUNTIMES.contains(configuration['runtime']);
1752 if (!needsVmOptions) return [[]]; 1751 if (!needsVmOptions) return [[]];
1753 final vmOptions = optionsFromFile['vmOptions']; 1752 final vmOptions = optionsFromFile['vmOptions'];
1754 if (configuration['compiler'] != 'dart2dart') return vmOptions; 1753 return vmOptions;
1755 // Temporary workaround for race in test suite: tests with different
1756 // vm options are still compiled into the same output file which
1757 // may lead to reads from empty files.
1758 return [vmOptions[0]];
1759 } 1754 }
1760 1755
1761 /** 1756 /**
1762 * Read options from a co19 test file. 1757 * Read options from a co19 test file.
1763 * 1758 *
1764 * The reason this is different from [readOptionsFromFile] is that 1759 * The reason this is different from [readOptionsFromFile] is that
1765 * co19 is developed based on a contract which defines certain test 1760 * co19 is developed based on a contract which defines certain test
1766 * tags. These tags may appear unused, but should not be removed 1761 * tags. These tags may appear unused, but should not be removed
1767 * without consulting with the co19 team. 1762 * without consulting with the co19 team.
1768 * 1763 *
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 return result; 2191 return result;
2197 } 2192 }
2198 2193
2199 static List<String> standardOptions(Map configuration) { 2194 static List<String> standardOptions(Map configuration) {
2200 List args = ["--ignore-unrecognized-flags"]; 2195 List args = ["--ignore-unrecognized-flags"];
2201 if (configuration["checked"]) { 2196 if (configuration["checked"]) {
2202 args.add('--enable_asserts'); 2197 args.add('--enable_asserts');
2203 args.add("--enable_type_checks"); 2198 args.add("--enable_type_checks");
2204 } 2199 }
2205 String compiler = configuration["compiler"]; 2200 String compiler = configuration["compiler"];
2206 if (compiler == "dart2js" || compiler == "dart2dart") { 2201 if (compiler == "dart2js") {
2207 args = []; 2202 args = [];
2208 if (configuration["checked"]) { 2203 if (configuration["checked"]) {
2209 args.add('--enable-checked-mode'); 2204 args.add('--enable-checked-mode');
2210 } 2205 }
2211 // args.add("--verbose"); 2206 // args.add("--verbose");
2212 if (!isBrowserRuntime(configuration['runtime'])) { 2207 if (!isBrowserRuntime(configuration['runtime'])) {
2213 args.add("--allow-mock-compilation"); 2208 args.add("--allow-mock-compilation");
2214 args.add("--categories=all"); 2209 args.add("--categories=all");
2215 } 2210 }
2216 } 2211 }
2217 if ((compiler == "dart2js" || compiler == "dart2dart") && 2212 if ((compiler == "dart2js") &&
2218 configuration["minified"]) { 2213 configuration["minified"]) {
2219 args.add("--minify"); 2214 args.add("--minify");
2220 } 2215 }
2221 if (compiler == "dart2js" && configuration["csp"]) { 2216 if (compiler == "dart2js" && configuration["csp"]) {
2222 args.add("--csp"); 2217 args.add("--csp");
2223 } 2218 }
2224 if (compiler == "dart2js" && configuration["cps_ir"]) { 2219 if (compiler == "dart2js" && configuration["cps_ir"]) {
2225 args.add("--use-cps-ir"); 2220 args.add("--use-cps-ir");
2226 } 2221 }
2227 if (compiler == "dartanalyzer" || compiler == "dart2analyzer") { 2222 if (compiler == "dartanalyzer" || compiler == "dart2analyzer") {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 for (var key in PATH_REPLACEMENTS.keys) { 2392 for (var key in PATH_REPLACEMENTS.keys) {
2398 if (path.startsWith(key)) { 2393 if (path.startsWith(key)) {
2399 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); 2394 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]);
2400 break; 2395 break;
2401 } 2396 }
2402 } 2397 }
2403 } 2398 }
2404 return path; 2399 return path;
2405 } 2400 }
2406 } 2401 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698