enable batch mode for dartdevc tests, also fix status so ddc bots pass

R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2987393002 .
This commit is contained in:
Jennifer Messerly 2017-08-03 14:39:41 -07:00
parent 867d682ff5
commit 62303b6711
12 changed files with 188 additions and 103 deletions

View file

@ -3,40 +3,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// Command line entry point for Dart Development Compiler (dartdevc).
///
/// Supported commands are
/// * compile: builds a collection of dart libraries into a single JS module
///
/// Additionally, these commands are being considered
/// * link: combines several JS modules into a single JS file
/// * build: compiles & links a set of code, automatically determining
/// appropriate groupings of libraries to combine into JS modules
/// * watch: watch a directory and recompile build units automatically
/// * serve: uses `watch` to recompile and exposes a simple static file server
/// for local development
///
/// These commands are combined so we have less names to expose on the PATH,
/// and for development simplicity while the precise UI has not been determined.
///
/// A more typical structure for web tools is simply to have the compiler with
/// "watch" as an option. The challenge for us is:
///
/// * Dart used to assume whole-program compiles, so we don't have a
/// user-declared unit of building, and neither "libraries" or "packages" will
/// work,
/// * We do not assume a `node` JS installation, so we cannot easily reuse
/// existing tools for the "link" step, or assume users have a local
/// file server,
/// * We didn't have a file watcher API at first,
/// * We had no conventions about where compiled output should go (or even
/// that we would be compiling at all, vs running on an in-browser Dart VM),
/// * We wanted a good first impression with our simple examples, so we used
/// local file servers, and users have an expectation of it now, even though
/// it doesn't scale to typical apps that need their own real servers.
/// Command line entry point for Dart Development Compiler (dartdevc), used to
/// compile a collection of dart libraries into a single JS module
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:isolate';
import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/src/command_line/arguments.dart';
import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine;
@ -48,7 +21,9 @@ Future main(List<String> args) async {
args = preprocessArgs(PhysicalResourceProvider.INSTANCE, args);
if (args.contains('--persistent_worker')) {
new _CompilerWorker(args..remove('--persistent_worker')).run();
await new _CompilerWorker(args..remove('--persistent_worker')).run();
} else if (args.isNotEmpty && args.last == "--batch") {
await runBatch(args.sublist(0, args.length - 1));
} else {
exitCode = compile(args);
}
@ -73,3 +48,27 @@ class _CompilerWorker extends AsyncWorkerLoop {
..output = output.toString();
}
}
runBatch(List<String> batchArgs) async {
int totalTests = 0;
int testsFailed = 0;
var watch = new Stopwatch()..start();
print('>>> BATCH START');
String line;
while ((line = stdin.readLineSync(encoding: UTF8)).isNotEmpty) {
totalTests++;
var args = batchArgs.toList()..addAll(line.split(new RegExp(r'\s+')));
// We don't try/catch here, since `compile` should handle that.
var compileExitCode = compile(args);
AnalysisEngine.instance.clearCaches();
stderr.writeln('>>> EOF STDERR');
var outcome = compileExitCode == 0
? 'PASS'
: compileExitCode == 70 ? 'CRASH' : 'FAIL';
print('>>> TEST $outcome ${watch.elapsedMilliseconds}ms');
}
int time = watch.elapsedMilliseconds;
print('>>> BATCH END '
'(${totalTests - testsFailed})/$totalTests ${time}ms');
}

View file

@ -281,3 +281,38 @@ class ForceCompileErrorException extends CompileErrorException {
toString() =>
'\nForce-compilation not successful. Please check static errors.';
}
// TODO(jmesserly): fix this function in analyzer
List<String> filterUnknownArguments(List<String> args, ArgParser parser) {
Set<String> knownOptions = new Set<String>();
Set<String> knownAbbreviations = new Set<String>();
parser.options.forEach((String name, option) {
knownOptions.add(name);
String abbreviation = option.abbreviation;
if (abbreviation != null) {
knownAbbreviations.add(abbreviation);
}
});
List<String> filtered = <String>[];
for (int i = 0; i < args.length; i++) {
String argument = args[i];
if (argument.startsWith('--') && argument.length > 2) {
int equalsOffset = argument.lastIndexOf('=');
int end = equalsOffset < 0 ? argument.length : equalsOffset;
if (knownOptions.contains(argument.substring(2, end))) {
filtered.add(argument);
}
} else if (argument.startsWith('-') && argument.length > 1) {
// TODO(jmesserly): fix this line in analyzer
// It was discarding abbreviations such as -Da=b
// Abbreviations must be 1-character (this is enforced by ArgParser),
// so we don't need to use `optionName`
if (knownAbbreviations.contains(argument[1])) {
filtered.add(argument);
}
} else {
filtered.add(argument);
}
}
return filtered;
}

View file

@ -1,4 +0,0 @@
#!/bin/bash
set -e
echo warning: this script has been renamed to ./tool/presubmit.sh
$(dirname "${BASH_SOURCE[0]}")/../tool/presubmit.sh

View file

@ -142,6 +142,9 @@ symbol_test/none: RuntimeError # Issue 29921
symbol_reserved_word_test/06: RuntimeError # Issue 29921
symbol_reserved_word_test/09: RuntimeError # Issue 29921
symbol_reserved_word_test/12: RuntimeError # Issue 29921
int_parse_with_limited_ints_test: Skip # dartdevc doesn't know about --limit-ints-to-64-bits
typed_data_with_limited_ints_test: Skip # dartdevc doesn't know about --limit-ints-to-64-bits
int_modulo_arith_test/none: RuntimeError # Issue 29921
[ ($compiler == dart2js || $compiler == dartdevc) && $runtime != none ]
big_integer_arith_vm_test: RuntimeError # Issues 10245, 30170

View file

@ -26,7 +26,7 @@ regexp/regress-regexp-codeflush_test: Skip
regexp/standalones_test: Skip
string_replace_test: Skip
[ $compiler == dartdevc ]
[ $compiler == dartdevc && $runtime != none ]
hash_set_test/01: RuntimeError # Issue 29921
int_parse_radix_test/01: RuntimeError # Issue 29921
int_parse_radix_test/02: RuntimeError # Issue 29921
@ -39,3 +39,12 @@ list_fill_range_test: RuntimeError # Issue 29921
list_insert_test: RuntimeError # Issue 29921
regress_r21715_test: RuntimeError # Issue 29921
string_operations_with_null_test: RuntimeError # Issue 29921
from_environment_const_type_test/01: RuntimeError # Issue 29921
from_environment_const_type_test/05: RuntimeError # Issue 29921
from_environment_const_type_test/10: RuntimeError # Issue 29921
from_environment_const_type_test/15: RuntimeError # Issue 29921
from_environment_const_type_test/none: RuntimeError # Issue 29921
growable_list_test: RuntimeError # Issue 29921
list_test/01: RuntimeError # Issue 29921
list_test/none: RuntimeError # Issue 29921

View file

@ -242,6 +242,7 @@ arithmetic_smi_overflow_test: Crash
async_star_cancel_while_paused_test: RuntimeError # Issue 29920
async_star_pause_test: RuntimeError
function_type/*: RuntimeError # Issue 28988
async_backwards_compatibility_2_test: RuntimeError # Issue 29920
[ $compiler == dart2js && $dart2js_with_kernel && $use_sdk ]
*: Skip # Issue 29626
@ -363,7 +364,6 @@ assertion_initializer_const_error2_test/none: CompileTimeError
assertion_initializer_const_function_test/01: CompileTimeError
[ $compiler == dartdevc && $runtime != none ]
assert_message_test: RuntimeError # Looks like bug in dartdevc codegen.
bit_operations_test/01: RuntimeError # No bigints on web.
bit_operations_test/02: RuntimeError # No bigints on web.
bit_operations_test/03: RuntimeError # No bigints on web.

View file

@ -690,6 +690,20 @@ try_catch4_test: StaticWarning # Issue 28823
try_catch5_test: StaticWarning # Issue 28823
[ $compiler == dartdevc ]
regress_23089_test: CompileTimeError # Issue 29920
constant_type_literal_test/01: MissingCompileTimeError # DDC allows type parameter type literals in const expressions.
generic_methods_closure_test: CompileTimeError # Issue 29920
generic_methods_overriding_test/01: MissingCompileTimeError # Issue 29920
generic_methods_overriding_test/03: MissingCompileTimeError # Issue 29920
generic_methods_shadowing_test: CompileTimeError # Issue 29920
generic_methods_simple_is_expression_test: CompileTimeError # Issue 29920
reify_typevar_static_test/00: MissingCompileTimeError # Issue 29920
export_private_test/01: MissingCompileTimeError # Issue 29920
generic_methods_local_variable_declaration_test: CompileTimeError # Issue 29920
import_private_test/01: MissingCompileTimeError # Issue 29920
internal_library_test/01: MissingCompileTimeError # Issue 29920
[ $compiler == dartdevc && $runtime != none ]
async_star_cancel_while_paused_test: RuntimeError # Issue 29920
async_star_test/01: RuntimeError # Issue 28969
async_star_test/02: RuntimeError # Issue 28969
@ -713,7 +727,6 @@ compile_time_constant_d_test: RuntimeError # Issue 29920
const_evaluation_test/01: RuntimeError # Issue 29920
const_switch_test/02: RuntimeError # Issue 29920
const_switch_test/04: RuntimeError # Ints and doubles are unified.
constant_type_literal_test/01: MissingCompileTimeError # DDC allows type parameter type literals in const expressions.
constructor12_test: RuntimeError # Issue 29920
covariant_subtyping_test: RuntimeError # Issue 29920
custom_await_stack_trace_test: RuntimeError # Issue 29920
@ -732,7 +745,6 @@ dynamic_test: RuntimeError # Strong mode is-check failure: M1 does not soundly s
exception_test: RuntimeError # DDC doesn't implement NullThrownError?
execute_finally6_test: RuntimeError # Issue 29920
expect_test: RuntimeError # Issue 29920
export_private_test/01: MissingCompileTimeError # Issue 29920
f_bounded_quantification3_test: RuntimeError # Issue 29920
field_increment_bailout_test: RuntimeError # Issue 29920
field_optimization3_test: RuntimeError # Issue 29920
@ -787,20 +799,13 @@ function_type_alias4_test: RuntimeError # Issue 29920
generic_instanceof2_test: RuntimeError # Issue 29920
generic_instanceof_test: RuntimeError # Issue 29920
generic_is_check_test: RuntimeError # Issue 29920
generic_methods_closure_test: CompileTimeError # Issue 29920
generic_methods_generic_class_tearoff_test: RuntimeError # Issue 29920
generic_methods_local_variable_declaration_test: CompileTimeError # Issue 29920
generic_methods_named_parameters_test: RuntimeError # Issue 29920
generic_methods_optional_parameters_test: RuntimeError # Issue 29920
generic_methods_overriding_test/01: MissingCompileTimeError # Issue 29920
generic_methods_overriding_test/03: MissingCompileTimeError # Issue 29920
generic_methods_shadowing_test: CompileTimeError # Issue 29920
generic_methods_simple_is_expression_test: CompileTimeError # Issue 29920
generic_methods_tearoff_specialization_test: RuntimeError # Issue 29920
generic_typedef_test: RuntimeError # Issue 29920
getter_closure_execution_order_test: RuntimeError # Issue 29920
identical_closure2_test: RuntimeError # Issue 29920
import_private_test/01: MissingCompileTimeError # Issue 29920
infinite_switch_label_test: RuntimeError # Issue 29920
infinity_test: RuntimeError # Issue 29920
initializing_formal_final_test: RuntimeError # Issue 29920
@ -809,7 +814,6 @@ instanceof2_test: RuntimeError # Issue 29920
instanceof4_test/01: RuntimeError # Issue 29920
instanceof4_test/none: RuntimeError # Issue 29920
integer_division_by_zero_test: RuntimeError # Issue 29920
internal_library_test/01: MissingCompileTimeError # Issue 29920
issue23244_test: RuntimeError # Issue 29920
lazy_static3_test: RuntimeError # Issue 29920
left_shift_test: RuntimeError # Issue 29920
@ -828,8 +832,6 @@ number_identity2_test: RuntimeError # Issue 29920
numbers_test: RuntimeError # Issue 29920
regress_16640_test: RuntimeError # Issue 29920
regress_22443_test: RuntimeError # Issue 29920
regress_23089_test: CompileTimeError # Issue 29920
reify_typevar_static_test/00: MissingCompileTimeError # Issue 29920
stack_overflow_stacktrace_test: RuntimeError # Issue 29920
stack_overflow_test: RuntimeError # Issue 29920
stacktrace_test: RuntimeError # Issue 29920
@ -839,4 +841,6 @@ switch_try_catch_test: RuntimeError # Issue 29920
throwing_lazy_variable_test: RuntimeError # Issue 29920
truncdiv_test: RuntimeError # Issue 29920
type_variable_nested_test: RuntimeError # Issue 29920
type_variable_typedef_test: RuntimeError # Issue 29920
type_variable_typedef_test: RuntimeError # Issue 29920
field_type_check2_test/01: RuntimeError # Issue 29920
prefix10_negative_test: Fail # Issue 29920

View file

@ -168,22 +168,6 @@ html/deferred_multi_app_htmltest: Skip # Issue 29919
html/no_linked_scripts_htmltest: Skip # Issue 29919
html/scripts_htmltest: Skip # Issue 29919
html/two_scripts_htmltest: Skip # Issue 29919
[ $compiler == dartdevc ]
async/future_or_bad_type_test/none: RuntimeError # Issue 29922
async/future_or_non_strong_test: RuntimeError # Issue 29922
async/future_or_strong_test: RuntimeError # Issue 29922
async/futures_test: RuntimeError # Issue 29922
async/slow_consumer_test: Pass, Timeout # Issue 29922
async/timer_not_available_test: RuntimeError # Issue 29922
async/zone_error_callback_test: RuntimeError # Issue 29922
async/zone_run_unary_test: RuntimeError # Issue 29922
convert/streamed_conversion_json_encode1_test: RuntimeError # Issue 29922
convert/streamed_conversion_json_utf8_encode_test: Pass, Timeout # Issue 29922
convert/streamed_conversion_utf8_decode_test: Pass, Timeout # Issue 29922
convert/streamed_conversion_utf8_encode_test: Pass, Timeout # Issue 29922
html/async_spawnuri_test: RuntimeError # Issue 29922
html/async_test: RuntimeError # Issue 29922
html/custom/attribute_changed_callback_test: Crash # Issue 29922
html/custom/constructor_calls_created_synchronously_test: Crash # Issue 29922
html/custom/created_callback_test: CompileTimeError # Issue 29922
@ -201,36 +185,40 @@ html/custom/entered_left_view_test: Crash # Issue 29922
html/custom/js_custom_test: Crash # Issue 29922
html/custom/mirrors_test: Crash # Issue 29922
html/custom/regress_194523002_test: Crash # Issue 29922
html/custom_element_method_clash_test/test: Timeout # Issue 29922
html/custom_element_name_clash_test/test: Timeout # Issue 29922
html/custom_elements_23127_test/baseline: Timeout # Issue 29922
html/custom_elements_23127_test/c1t: Timeout # Issue 29922
html/custom_elements_23127_test/c2: Timeout # Issue 29922
html/custom_elements_23127_test/c2t: Timeout # Issue 29922
html/custom_elements_test/innerHtml: Timeout # Issue 29922
html/custom_elements_test/lifecycle: Timeout # Issue 29922
html/custom_elements_test/mixins: Timeout # Issue 29922
html/custom_elements_test/preregister: Timeout # Issue 29922
html/custom_elements_test/register: Timeout # Issue 29922
[ $compiler == dartdevc && $runtime != none ]
async/future_or_bad_type_test/none: RuntimeError # Issue 29922
async/future_or_non_strong_test: RuntimeError # Issue 29922
async/future_or_strong_test: RuntimeError # Issue 29922
async/futures_test: RuntimeError # Issue 29922
async/slow_consumer_test: Pass, Timeout # Issue 29922
async/timer_not_available_test: RuntimeError # Issue 29922
async/zone_error_callback_test: RuntimeError # Issue 29922
async/zone_run_unary_test: RuntimeError # Issue 29922
convert/streamed_conversion_json_encode1_test: RuntimeError # Issue 29922
convert/streamed_conversion_json_utf8_encode_test: Pass, Timeout # Issue 29922
convert/streamed_conversion_utf8_decode_test: Pass, Timeout # Issue 29922
convert/streamed_conversion_utf8_encode_test: Pass, Timeout # Issue 29922
html/async_spawnuri_test: RuntimeError # Issue 29922
html/async_test: RuntimeError # Issue 29922
html/custom_element_method_clash_test: Skip # Issue 29922
html/custom_element_name_clash_test: Skip # Issue 29922
html/custom_elements_23127_test: Skip # Issue 29922
html/custom_elements_test: Skip # Issue 29922
html/element_classes_svg_test: RuntimeError # Issue 29922
html/element_classes_test: RuntimeError # Issue 29922
html/input_element_test: RuntimeError # Issue 29922
html/interactive_test/Geolocation: RuntimeError # Issue 29922
html/interactive_test/MediaStream: RuntimeError # Issue 29922
html/isolates_test: RuntimeError # Issue 29922
html/js_typed_interop_default_arg_test/default_value: MissingCompileTimeError # Issue 29922
html/js_util_test: RuntimeError # Issue 29922
html/media_stream_test: RuntimeError # Issue 29922
html/mediasource_test: RuntimeError # Issue 29922
html/svg_test: RuntimeError # Issue 29922
html/typing_test: RuntimeError # Issue 29922
html/websql_test/functional: RuntimeError # Issue 29922
html/worker_api_test: RuntimeError # Issue 29922
html/xhr_cross_origin_test/functional: RuntimeError # Issue 29922
math/double_pow_test: RuntimeError # Issue 29922
math/low_test: RuntimeError # Issue 29922
math/math2_test: RuntimeError # Issue 29922
math/math_test: RuntimeError # Issue 29922
math/random_big_test: RuntimeError # Issue 29922
mirrors/accessor_cache_overflow_test: RuntimeError # Issue 29922
mirrors/basic_types_in_dart_core_test: RuntimeError # Issue 29922
@ -345,3 +333,9 @@ typed_data/int32x4_bigint_test: RuntimeError # Issue 29922
typed_data/int64_list_load_store_test: RuntimeError # Issue 29922
typed_data/typed_data_hierarchy_int64_test: RuntimeError # Issue 29922
typed_data/typed_data_list_test: RuntimeError # Issue 29922
html/cross_domain_iframe_test: RuntimeError # Issue 28326
html/touchevent_test: RuntimeError # Issue 29922
html/css_test: RuntimeError # Issue 29922
html/element_types_test: RuntimeError # Issue 29922
html/element_animate_test/timing_dict: RuntimeError # Issue 29922
html/interactive_test: Skip # requests interactive permissions (camera, geolocation)

View file

@ -698,6 +698,37 @@ class CompilationCommandOutput extends CommandOutput {
}
}
class DevCompilerCommandOutput extends CommandOutput {
DevCompilerCommandOutput(
Command command,
int exitCode,
bool timedOut,
List<int> stdout,
List<int> stderr,
Duration time,
bool compilationSkipped,
int pid)
: super(command, exitCode, timedOut, stdout, stderr, time,
compilationSkipped, pid);
Expectation result(TestCase testCase) {
if (hasCrashed) return Expectation.crash;
if (hasTimedOut) return Expectation.timeout;
if (hasNonUtf8) return Expectation.nonUtf8Error;
// Handle errors / missing errors
if (testCase.expectCompileError) {
return exitCode == 0
? Expectation.missingCompileTimeError
: Expectation.pass;
}
// TODO(jmesserly): should we handle `testCase.isNegative`? Analyzer does
// not, so this behavior is chosen to match.
return exitCode == 0 ? Expectation.pass : Expectation.compileTimeError;
}
}
class KernelCompilationCommandOutput extends CompilationCommandOutput {
KernelCompilationCommandOutput(
Command command,
@ -804,6 +835,9 @@ CommandOutput createCommandOutput(Command command, int exitCode, bool timedOut,
command.displayName == 'app_jit') {
return new VMCommandOutput(
command, exitCode, timedOut, stdout, stderr, time, pid);
} else if (command.displayName == 'dartdevc') {
return new DevCompilerCommandOutput(command, exitCode, timedOut, stdout,
stderr, time, compilationSkipped, pid);
}
return new CompilationCommandOutput(
command, exitCode, timedOut, stdout, stderr, time, compilationSkipped);

View file

@ -54,7 +54,7 @@ abstract class CompilerConfiguration {
return new Dart2jsCompilerConfiguration(configuration);
case Compiler.dartdevc:
return new DartdevcCompilerConfiguration(configuration);
return new DevCompilerConfiguration(configuration);
case Compiler.appJit:
return new AppJitCompilerConfiguration(configuration);
@ -364,8 +364,8 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
}
/// Configuration for dart2js compiler.
class DartdevcCompilerConfiguration extends CompilerConfiguration {
DartdevcCompilerConfiguration(Configuration configuration)
class DevCompilerConfiguration extends CompilerConfiguration {
DevCompilerConfiguration(Configuration configuration)
: super._subclass(configuration);
String computeCompilerPath() {
@ -384,13 +384,20 @@ class DartdevcCompilerConfiguration extends CompilerConfiguration {
}
Command createCommand(
String inputFile, String outputFile, List<String> sharedOptions) {
String inputFile, String outputFile, List<String> sharedOptions,
[Map<String, String> environment = const {}]) {
var moduleRoot =
new Path(outputFile).directoryPath.directoryPath.toNativePath();
var args = [
"--dart-sdk",
"${_configuration.buildDirectory}/dart-sdk",
var args = _useSdk
? ["--dart-sdk", "${_configuration.buildDirectory}/dart-sdk"]
// TODO(jmesserly): once we can build DDC's SDK summary+JS as part of
// the main build, change this to reflect that output path.
: ["--dart-sdk-summary", "pkg/dev_compiler/lib/sdk/ddc_sdk.sum"];
args.addAll(sharedOptions);
args.addAll([
"--ignore-unrecognized-flags",
"--library-root",
new Path(inputFile).directoryPath.toNativePath(),
"--module-root",
@ -400,9 +407,7 @@ class DartdevcCompilerConfiguration extends CompilerConfiguration {
"-o",
outputFile,
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.
@ -418,11 +423,11 @@ class DartdevcCompilerConfiguration extends CompilerConfiguration {
}
return Command.compilation(Compiler.dartdevc.name, outputFile,
bootstrapDependencies(), computeCompilerPath(), args, const {});
bootstrapDependencies(), computeCompilerPath(), args, environment);
}
CommandArtifact computeCompilationArtifact(String tempDir,
List<String> arguments, Map<String, String> environmentOverrides) {
CommandArtifact computeCompilationArtifact(
String tempDir, List<String> arguments, Map<String, String> environment) {
// The list of arguments comes from a call to our own
// computeCompilerArguments(). It contains the shared options followed by
// the input file path.
@ -433,7 +438,7 @@ class DartdevcCompilerConfiguration extends CompilerConfiguration {
var outputFile = "$tempDir/${inputFile.replaceAll('.dart', '.js')}";
return new CommandArtifact(
[createCommand(inputFile, outputFile, sharedOptions)],
[createCommand(inputFile, outputFile, sharedOptions, environment)],
outputFile,
"application/javascript");
}

View file

@ -356,11 +356,6 @@ class Configuration {
print("-rflutter is applicable only for --arch=x64");
}
if (compiler == Compiler.dartdevc && !useSdk) {
isValid = false;
print("--compiler dartdevc requires --use-sdk");
}
if (compiler == Compiler.dartdevc && !isStrong) {
isValid = false;
print("--compiler dartdevc requires --strong");

View file

@ -605,6 +605,7 @@ class BatchRunnerProcess {
String _status;
DateTime _startTime;
Timer _timer;
int _testCount = 0;
Future<CommandOutput> runCommand(String runnerType, ProcessCommand command,
int timeout, List<String> arguments) {
@ -620,12 +621,17 @@ class BatchRunnerProcess {
_arguments = arguments;
_processEnvironmentOverrides = command.environmentOverrides;
// TOOD(jmesserly): this restarts `dartdevc --batch` to work around a
// memory leak, see https://github.com/dart-lang/sdk/issues/30314.
var clearMemoryLeak = command is CompilationCommand &&
command.displayName == 'dartdevc' &&
++_testCount % 100 == 0;
if (_process == null) {
// Start process if not yet started.
_startProcess(() {
doStartTest(command, timeout);
});
} else if (!sameRunnerType) {
} else if (!sameRunnerType || clearMemoryLeak) {
// Restart this runner with the right executable for this test if needed.
_processExitHandler = (_) {
_startProcess(() {
@ -1164,6 +1170,11 @@ class CommandExecutorImpl implements CommandExecutor {
} else if (command is AnalysisCommand && globalConfiguration.batch) {
return _getBatchRunner(command.displayName)
.runCommand(command.displayName, command, timeout, command.arguments);
} else if (command is CompilationCommand &&
command.displayName == 'dartdevc' &&
globalConfiguration.batch) {
return _getBatchRunner(command.displayName)
.runCommand(command.displayName, command, timeout, command.arguments);
} else if (command is ScriptCommand) {
return command.run();
} else if (command is AdbPrecompilationCommand) {