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

Unified Diff: tools/testing/dart/compiler_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/precompilation/precompiler.dart ('k') | tools/testing/dart/runtime_configuration.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 e901344c3edf082133351f3a4da9e50112c58e62..a89aad5659e3be262bfc4ea7b1589690178afd38 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -74,6 +74,9 @@ abstract class CompilerConfiguration {
isHostChecked: isHostChecked, useCps: useCps, useSdk: useSdk,
isCsp: isCsp, extraDart2jsOptions:
TestUtils.getExtraOptions(configuration, 'dart2js_options'));
+ case 'precompiler':
+ return new PrecompilerCompilerConfiguration(
+ isDebug: isDebug, isChecked: isChecked);
case 'none':
return new NoneCompilerConfiguration(
isDebug: isDebug, isChecked: isChecked,
@@ -119,6 +122,12 @@ abstract class CompilerConfiguration {
return new CommandArtifact([], null, null);
}
+ List<String> computeCompilerArguments(vmOptions, sharedOptions, args) {
+ return new List<String>()
+ ..addAll(sharedOptions)
+ ..addAll(args);
+ }
+
List<String> computeRuntimeArguments(
RuntimeConfiguration runtimeConfiguration,
String buildDir,
@@ -294,6 +303,92 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
}
}
+
+class PrecompilerCompilerConfiguration extends CompilerConfiguration {
+ PrecompilerCompilerConfiguration({
+ bool isDebug,
+ bool isChecked})
+ : super._subclass(isDebug: isDebug, isChecked: isChecked);
+
+ int computeTimeoutMultiplier() {
+ int multiplier = 2;
+ if (isDebug) multiplier *= 4;
+ if (isChecked) multiplier *= 2;
+ return multiplier;
+ }
+
+ CommandArtifact computeCompilationArtifact(
+ String buildDir,
+ String tempDir,
+ CommandBuilder commandBuilder,
+ List arguments,
+ Map<String, String> environmentOverrides) {
+ return new CommandArtifact(
+ <Command>[
+ this.computeCompilationCommand(
+ tempDir,
+ buildDir,
+ CommandBuilder.instance,
+ arguments,
+ environmentOverrides)],
+ '$tempDir',
+ 'application/dart-precompiled');
+ }
+
+ CompilationCommand computeCompilationCommand(
+ String tempDir,
+ String buildDir,
+ CommandBuilder commandBuilder,
+ List arguments,
+ Map<String, String> environmentOverrides) {
+ var exec = "$buildDir/dart";
+ var args = new List();
+ args.add("tools/precompilation/precompiler.dart");
+ args.add("$buildDir/dart_no_snapshot");
+ args.add("--gen-precompiled-snapshot=$tempDir");
+ args.addAll(arguments);
+
+ return commandBuilder.getCompilationCommand(
+ 'precompiler.dart', tempDir, !useSdk,
+ bootstrapDependencies(buildDir),
+ exec, args, environmentOverrides);
+ }
+
+ List<String> computeCompilerArguments(vmOptions,
+ sharedOptions,
+ originalArguments) {
+ List<String> args = [];
+ if (isChecked) {
+ args.add('--enable_asserts');
+ args.add('--enable_type_checks');
+ }
+ return args
+ ..addAll(vmOptions)
+ ..addAll(sharedOptions)
+ ..addAll(originalArguments);
+ }
+
+ List<String> computeRuntimeArguments(
+ RuntimeConfiguration runtimeConfiguration,
+ String buildDir,
+ TestInformation info,
+ List<String> vmOptions,
+ List<String> sharedOptions,
+ List<String> originalArguments,
+ CommandArtifact artifact) {
+ List<String> args = [];
+ if (isChecked) {
+ args.add('--enable_asserts');
+ args.add('--enable_type_checks');
+ }
+ return args
+ ..addAll(vmOptions)
+ ..addAll(sharedOptions)
+ ..addAll(originalArguments);
+ }
+}
+
+
class AnalyzerCompilerConfiguration extends CompilerConfiguration {
AnalyzerCompilerConfiguration(
{bool isDebug,
« no previous file with comments | « tools/precompilation/precompiler.dart ('k') | tools/testing/dart/runtime_configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698