| OLD | NEW |
| 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 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 // Run the compiler script via the Dart VM. | 1462 // Run the compiler script via the Dart VM. |
| 1463 args = [compilerPath]; | 1463 args = [compilerPath]; |
| 1464 } else { | 1464 } else { |
| 1465 args = []; | 1465 args = []; |
| 1466 } | 1466 } |
| 1467 args.addAll(TestUtils.standardOptions(configuration)); | 1467 args.addAll(TestUtils.standardOptions(configuration)); |
| 1468 String packageRoot = | 1468 String packageRoot = |
| 1469 packageRootArgument(optionsFromFile['packageRoot']); | 1469 packageRootArgument(optionsFromFile['packageRoot']); |
| 1470 if (packageRoot != null) args.add(packageRoot); | 1470 if (packageRoot != null) args.add(packageRoot); |
| 1471 args.add('--out=$outputFile'); | 1471 args.add('--out=$outputFile'); |
| 1472 if (configuration['csp']) args.add('--csp'); | |
| 1473 args.add(inputFile); | 1472 args.add(inputFile); |
| 1474 List<String> options = optionsFromFile['sharedOptions']; | 1473 List<String> options = optionsFromFile['sharedOptions']; |
| 1475 if (options != null) args.addAll(options); | 1474 if (options != null) args.addAll(options); |
| 1476 return CommandBuilder.instance.getCompilationCommand( | 1475 return CommandBuilder.instance.getCompilationCommand( |
| 1477 compiler, outputFile, !useSdk, | 1476 compiler, outputFile, !useSdk, |
| 1478 dart2JsBootstrapDependencies, compilerPath, args, environmentOverrides); | 1477 dart2JsBootstrapDependencies, compilerPath, args, environmentOverrides); |
| 1479 } | 1478 } |
| 1480 | 1479 |
| 1481 /** Helper to create a Polymer deploy command for a single HTML file. */ | 1480 /** Helper to create a Polymer deploy command for a single HTML file. */ |
| 1482 Command _polymerDeployCommand(String inputFile, String outputDir, | 1481 Command _polymerDeployCommand(String inputFile, String outputDir, |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2213 // args.add("--verbose"); | 2212 // args.add("--verbose"); |
| 2214 if (!isBrowserRuntime(configuration['runtime'])) { | 2213 if (!isBrowserRuntime(configuration['runtime'])) { |
| 2215 args.add("--allow-mock-compilation"); | 2214 args.add("--allow-mock-compilation"); |
| 2216 args.add("--categories=all"); | 2215 args.add("--categories=all"); |
| 2217 } | 2216 } |
| 2218 } | 2217 } |
| 2219 if ((compiler == "dart2js" || compiler == "dart2dart") && | 2218 if ((compiler == "dart2js" || compiler == "dart2dart") && |
| 2220 configuration["minified"]) { | 2219 configuration["minified"]) { |
| 2221 args.add("--minify"); | 2220 args.add("--minify"); |
| 2222 } | 2221 } |
| 2222 if (compiler == "dart2js" && configuration["csp"]) { |
| 2223 args.add("--csp"); |
| 2224 } |
| 2223 if (compiler == "dartanalyzer" || compiler == "dart2analyzer") { | 2225 if (compiler == "dartanalyzer" || compiler == "dart2analyzer") { |
| 2224 args.add("--show-package-warnings"); | 2226 args.add("--show-package-warnings"); |
| 2225 args.add("--enable-async"); | 2227 args.add("--enable-async"); |
| 2226 } | 2228 } |
| 2227 return args; | 2229 return args; |
| 2228 } | 2230 } |
| 2229 | 2231 |
| 2230 static bool isBrowserRuntime(String runtime) { | 2232 static bool isBrowserRuntime(String runtime) { |
| 2231 const BROWSERS = const [ | 2233 const BROWSERS = const [ |
| 2232 'drt', | 2234 'drt', |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2393 for (var key in PATH_REPLACEMENTS.keys) { | 2395 for (var key in PATH_REPLACEMENTS.keys) { |
| 2394 if (path.startsWith(key)) { | 2396 if (path.startsWith(key)) { |
| 2395 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); | 2397 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
| 2396 break; | 2398 break; |
| 2397 } | 2399 } |
| 2398 } | 2400 } |
| 2399 } | 2401 } |
| 2400 return path; | 2402 return path; |
| 2401 } | 2403 } |
| 2402 } | 2404 } |
| OLD | NEW |