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

Unified Diff: tools/testing/dart/compiler_configuration.dart

Issue 2986513002: Pass shared options to dartdevc in test.dart. (Closed)
Patch Set: Merge branch 'master' into dartdevc-shared-options Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib_2/corelib_2.status ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/compiler_configuration.dart
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index 116a9ab3c514a39b4fc75595cb0c798b6ff2acc7..009fdfe62bef8ddce681a7d92ccbe1571e5485cb 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -94,7 +94,8 @@ abstract class CompilerConfiguration {
List<Uri> bootstrapDependencies() => const <Uri>[];
/// Creates a [Command] to compile [inputFile] to [outputFile].
- Command createCommand(String inputFile, String outputFile) {
+ Command createCommand(
+ String inputFile, String outputFile, List<String> sharedOptions) {
// TODO(rnystrom): See if this method can be unified with
// computeCompilationArtifact() and/or computeCompilerArguments() for the
// other compilers.
@@ -365,7 +366,18 @@ class DartdevcCompilerConfiguration extends CompilerConfiguration {
return "$dir/bin/dartdevc$executableScriptSuffix";
}
- Command createCommand(String inputFile, String outputFile) {
+ List<String> computeCompilerArguments(
+ List<String> vmOptions, List<String> sharedOptions, List<String> args) {
+ var result = sharedOptions.toList();
+
+ // The file being compiled is the last argument.
+ result.add(args.last);
+
+ return result;
+ }
+
+ Command createCommand(
+ String inputFile, String outputFile, List<String> sharedOptions) {
var moduleRoot =
new Path(outputFile).directoryPath.directoryPath.toNativePath();
@@ -383,6 +395,8 @@ class DartdevcCompilerConfiguration extends CompilerConfiguration {
inputFile,
];
+ args.addAll(sharedOptions);
+
// Link to the summaries for the available packages, so that they don't
// get recompiled into the test's own module.
for (var package in testPackages) {
@@ -402,13 +416,19 @@ class DartdevcCompilerConfiguration extends CompilerConfiguration {
CommandArtifact computeCompilationArtifact(String tempDir,
List<String> arguments, Map<String, String> environmentOverrides) {
- // TODO(rnystrom): Are there other arguments here that we need to keep?
- // What about arguments specified in the test itself?
+ // The list of arguments comes from a call to our own
+ // computeCompilerArguments(). It contains the shared options followed by
+ // the input file path.
+ // TODO(rnystrom): Jamming these into a list in order to pipe them from
+ // computeCompilerArguments() to here seems hacky. Is there a cleaner way?
+ var sharedOptions = arguments.sublist(0, arguments.length - 1);
var inputFile = arguments.last;
var outputFile = "$tempDir/${inputFile.replaceAll('.dart', '.js')}";
- return new CommandArtifact([createCommand(inputFile, outputFile)],
- outputFile, "application/javascript");
+ return new CommandArtifact(
+ [createCommand(inputFile, outputFile, sharedOptions)],
+ outputFile,
+ "application/javascript");
}
}
« no previous file with comments | « tests/corelib_2/corelib_2.status ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698