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

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

Issue 1507943002: Add ./tools/test.py -c precompiler -r dart_precompiled. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « tools/testing/dart/compiler_configuration.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/runtime_configuration.dart
diff --git a/tools/testing/dart/runtime_configuration.dart b/tools/testing/dart/runtime_configuration.dart
index 1fbf54dc409b23cc2515ef5894eafe2213a47507..55810eb863cba08944176c01626379411743b9de 100644
--- a/tools/testing/dart/runtime_configuration.dart
+++ b/tools/testing/dart/runtime_configuration.dart
@@ -52,6 +52,9 @@ class RuntimeConfiguration {
case 'vm':
return new StandaloneDartRuntimeConfiguration();
+ case 'dart_precompiled':
+ return new DartPrecompiledRuntimeConfiguration();
+
case 'drt':
return new DrtRuntimeConfiguration();
@@ -218,6 +221,32 @@ class StandaloneDartRuntimeConfiguration extends DartVmRuntimeConfiguration {
}
}
+
+class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration {
+ List<Command> computeRuntimeCommands(
+ TestSuite suite,
+ CommandBuilder commandBuilder,
+ CommandArtifact artifact,
+ List<String> arguments,
+ Map<String, String> environmentOverrides) {
+ String script = artifact.filename;
+ String type = artifact.mimeType;
+ if (script != null && type != 'application/dart-precompiled') {
+ throw "dart_precompiled cannot run files of type '$type'.";
+ }
+
+ var augmentedArgs = new List();
+ augmentedArgs.add("--run-precompiled-snapshot=${artifact.filename}");
+ augmentedArgs.addAll(arguments);
+
+ var augmentedEnv = new Map.from(environmentOverrides);
+ augmentedEnv['LD_LIBRARY_PATH'] = artifact.filename;
+
+ return <Command>[commandBuilder.getVmCommand(
+ suite.dartPrecompiledBinaryFileName, augmentedArgs, augmentedEnv)];
+ }
+}
+
/// Temporary runtime configuration for browser runtimes that haven't been
/// migrated yet.
// TODO(ahe): Remove this class.
« no previous file with comments | « tools/testing/dart/compiler_configuration.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698