mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[pkg/test_runner] analyze with package:lints/recommended.yaml
Change-Id: Iab61ff9f67b40157657fde2d732e970d67c9fcac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290607 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Devon Carew <devoncarew@google.com>
This commit is contained in:
parent
db80d18ad4
commit
85cf783fe8
|
@ -1,4 +1,4 @@
|
|||
include: package:lints/core.yaml
|
||||
include: package:lints/recommended.yaml
|
||||
|
||||
analyzer:
|
||||
language:
|
||||
|
@ -6,9 +6,6 @@ analyzer:
|
|||
errors:
|
||||
# TODO: These issues should be addressed.
|
||||
exhaustive_cases: ignore
|
||||
# Disabled due to existing violations.
|
||||
only_throw_errors: ignore
|
||||
prefer_single_quotes: ignore
|
||||
|
||||
linter:
|
||||
rules:
|
||||
|
|
|
@ -73,8 +73,7 @@ final gsutilPool = Pool(math.max(1, Platform.numberOfProcessors ~/ 2));
|
|||
/// Returns null if the requested URL didn't exist.
|
||||
Future<String> runGsutil(List<String> arguments) async {
|
||||
return gsutilPool.withResource(() async {
|
||||
var processResult = await Process.run(
|
||||
"python3", [gsutilPy]..addAll(arguments),
|
||||
var processResult = await Process.run("python3", [gsutilPy, ...arguments],
|
||||
runInShell: Platform.isWindows);
|
||||
if (processResult.exitCode != 0) {
|
||||
var stderr = processResult.stderr as String;
|
||||
|
@ -127,7 +126,7 @@ Future cpRecursiveGsutil(String source, String destination) =>
|
|||
runGsutil(["-m", "cp", "-r", "-Z", source, destination]);
|
||||
|
||||
/// Lists the bots in cloud storage.
|
||||
Future<Iterable<String>> listBots() => lsGsutil("$testResultsStoragePath");
|
||||
Future<Iterable<String>> listBots() => lsGsutil(testResultsStoragePath);
|
||||
|
||||
/// Returns the cloud storage path for the [bot].
|
||||
String botCloudPath(String bot) => "$testResultsStoragePath/$bot";
|
||||
|
|
|
@ -108,7 +108,7 @@ class AndroidEmulator {
|
|||
|
||||
static Future<AndroidEmulator> launchNewEmulator(String avdName) {
|
||||
var portNumber = AdbServerPortPool.next();
|
||||
var args = ['-avd', '$avdName', '-port', "$portNumber" /*, '-gpu', 'on'*/];
|
||||
var args = ['-avd', avdName, '-port', "$portNumber" /*, '-gpu', 'on'*/];
|
||||
return Process.start("emulator64-arm", args).then((Process process) {
|
||||
var adbDevice = AdbDevice('emulator-$portNumber');
|
||||
return AndroidEmulator._private(portNumber, adbDevice, process);
|
||||
|
@ -158,9 +158,9 @@ class AndroidHelper {
|
|||
'create',
|
||||
'avd',
|
||||
'--name',
|
||||
'$name',
|
||||
name,
|
||||
'--target',
|
||||
'$target',
|
||||
target,
|
||||
'--force',
|
||||
'--abi',
|
||||
'armeabi-v7a'
|
||||
|
@ -187,14 +187,14 @@ class AdbDevice {
|
|||
|
||||
/// Polls the 'sys.boot_completed' property. Returns as soon as the property
|
||||
/// is 1.
|
||||
Future<Null> waitForBootCompleted() async {
|
||||
Future<void> waitForBootCompleted() async {
|
||||
while (true) {
|
||||
try {
|
||||
var result =
|
||||
await _adbCommand(['shell', 'getprop', 'sys.boot_completed']);
|
||||
if (result.stdout.trim() == '1') return;
|
||||
} catch (_) {}
|
||||
await Future<Null>.delayed(const Duration(seconds: 2));
|
||||
await Future<void>.delayed(const Duration(seconds: 2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -160,8 +160,8 @@ abstract class Browser {
|
|||
var doneCompleter = Completer<bool>();
|
||||
done = doneCompleter.future;
|
||||
|
||||
var stdoutDone = Completer<Null>();
|
||||
var stderrDone = Completer<Null>();
|
||||
var stdoutDone = Completer<void>();
|
||||
var stderrDone = Completer<void>();
|
||||
|
||||
var stdoutIsDone = false;
|
||||
var stderrIsDone = false;
|
||||
|
@ -564,6 +564,7 @@ class AndroidChrome extends Browser {
|
|||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
void logBrowserInfoToTestBrowserOutput() {
|
||||
_testBrowserOutput.stdout
|
||||
.write('Android device id: ${_adbDevice.deviceId}\n');
|
||||
|
@ -624,10 +625,10 @@ class Firefox extends Browser {
|
|||
};
|
||||
var args = [
|
||||
"-profile",
|
||||
"${userDir.path}",
|
||||
userDir.path,
|
||||
"-no-remote",
|
||||
"-new-instance",
|
||||
url
|
||||
url,
|
||||
];
|
||||
var environment = Map<String, String>.from(Platform.environment);
|
||||
environment["MOZ_CRASHREPORTER_DISABLE"] = "1";
|
||||
|
|
|
@ -22,6 +22,8 @@ class Co19TestSuite extends StandardTestSuite {
|
|||
"tests/$selector/$selector-kernel.status"
|
||||
]);
|
||||
|
||||
@override
|
||||
bool isTestFile(String filename) => _testRegExp.hasMatch(filename);
|
||||
@override
|
||||
bool get listRecursively => true;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ abstract class Command {
|
|||
CommandOutput(this, exitCode, timedOut, stdout, stderr, time,
|
||||
compilationSkipped, pid);
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
if (_cachedHashCode == null) {
|
||||
var builder = HashCodeBuilder();
|
||||
|
@ -55,6 +56,7 @@ abstract class Command {
|
|||
return _cachedHashCode!;
|
||||
}
|
||||
|
||||
@override
|
||||
operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
(runtimeType == other.runtimeType && _equal(other as Command));
|
||||
|
@ -69,6 +71,7 @@ abstract class Command {
|
|||
displayName == other.displayName &&
|
||||
index == other.index;
|
||||
|
||||
@override
|
||||
String toString() => reproductionCommand;
|
||||
|
||||
bool get outputIsUpToDate => false;
|
||||
|
@ -100,11 +103,13 @@ class ProcessCommand extends Command {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ProcessCommand indexedCopy(int index) {
|
||||
return ProcessCommand(displayName, executable, arguments,
|
||||
environmentOverrides, workingDirectory, index);
|
||||
}
|
||||
|
||||
@override
|
||||
void _buildHashCode(HashCodeBuilder builder) {
|
||||
super._buildHashCode(builder);
|
||||
builder.addJson(executable);
|
||||
|
@ -113,6 +118,7 @@ class ProcessCommand extends Command {
|
|||
builder.addJson(environmentOverrides);
|
||||
}
|
||||
|
||||
@override
|
||||
bool _equal(ProcessCommand other) =>
|
||||
super._equal(other) &&
|
||||
executable == other.executable &&
|
||||
|
@ -120,15 +126,14 @@ class ProcessCommand extends Command {
|
|||
workingDirectory == other.workingDirectory &&
|
||||
deepJsonCompare(environmentOverrides, other.environmentOverrides);
|
||||
|
||||
@override
|
||||
String get reproductionCommand {
|
||||
var env = StringBuffer();
|
||||
environmentOverrides.forEach((key, value) =>
|
||||
(io.Platform.operatingSystem == 'windows')
|
||||
? env.write('set $key=${escapeCommandLineArgument(value)} & ')
|
||||
: env.write('$key=${escapeCommandLineArgument(value)} '));
|
||||
var command = ([executable]
|
||||
..addAll(nonBatchArguments)
|
||||
..addAll(arguments))
|
||||
var command = [executable, ...nonBatchArguments, ...arguments]
|
||||
.map(escapeCommandLineArgument)
|
||||
.join(' ');
|
||||
if (workingDirectory != null) {
|
||||
|
@ -137,6 +142,7 @@ class ProcessCommand extends Command {
|
|||
return "$env$command";
|
||||
}
|
||||
|
||||
@override
|
||||
bool get outputIsUpToDate => false;
|
||||
|
||||
/// Additional arguments to prepend before [arguments] when running the
|
||||
|
@ -171,6 +177,7 @@ class CompilationCommand extends ProcessCommand {
|
|||
super(displayName, executable, arguments, environmentOverrides,
|
||||
workingDirectory, index);
|
||||
|
||||
@override
|
||||
CompilationCommand indexedCopy(int index) => CompilationCommand(
|
||||
displayName,
|
||||
outputFile,
|
||||
|
@ -182,6 +189,7 @@ class CompilationCommand extends ProcessCommand {
|
|||
workingDirectory: workingDirectory,
|
||||
index: index);
|
||||
|
||||
@override
|
||||
CommandOutput createOutput(int exitCode, bool timedOut, List<int> stdout,
|
||||
List<int> stderr, Duration time, bool compilationSkipped,
|
||||
[int pid = 0]) {
|
||||
|
@ -197,6 +205,7 @@ class CompilationCommand extends ProcessCommand {
|
|||
this, exitCode, timedOut, stdout, stderr, time, compilationSkipped);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get outputIsUpToDate {
|
||||
if (_alwaysCompile) return false;
|
||||
|
||||
|
@ -233,6 +242,7 @@ class CompilationCommand extends ProcessCommand {
|
|||
return [...arguments.where((arg) => arg.startsWith('--enable-experiment'))];
|
||||
}
|
||||
|
||||
@override
|
||||
void _buildHashCode(HashCodeBuilder builder) {
|
||||
super._buildHashCode(builder);
|
||||
builder.addJson(outputFile);
|
||||
|
@ -240,6 +250,7 @@ class CompilationCommand extends ProcessCommand {
|
|||
builder.addJson(_bootstrapDependencies);
|
||||
}
|
||||
|
||||
@override
|
||||
bool _equal(CompilationCommand other) =>
|
||||
super._equal(other) &&
|
||||
outputFile == other.outputFile &&
|
||||
|
@ -407,6 +418,7 @@ class FastaCompilationCommand extends CompilationCommand {
|
|||
workingDirectory,
|
||||
index: index);
|
||||
|
||||
@override
|
||||
FastaCommandOutput createOutput(int exitCode, bool timedOut, List<int> stdout,
|
||||
List<int> stderr, Duration time, bool compilationSkipped,
|
||||
[int? pid = 0]) =>
|
||||
|
@ -451,11 +463,10 @@ class FastaCompilationCommand extends CompilationCommand {
|
|||
buffer.write(" ");
|
||||
});
|
||||
buffer.writeAll(
|
||||
(<String>[executable]
|
||||
..add(_compilerLocation.toFilePath())
|
||||
..addAll(arguments))
|
||||
.map(relativizeAndEscape),
|
||||
" ");
|
||||
[executable, _compilerLocation.toFilePath(), ...arguments]
|
||||
.map(relativizeAndEscape),
|
||||
" ",
|
||||
);
|
||||
if (workingDirectory != null) {
|
||||
if (io.Platform.isWindows) {
|
||||
buffer.write(" (working directory: $workingDirectory)");
|
||||
|
@ -491,11 +502,13 @@ class VMKernelCompilationCommand extends CompilationCommand {
|
|||
executable, arguments, environmentOverrides,
|
||||
alwaysCompile: alwaysCompile, index: index);
|
||||
|
||||
@override
|
||||
VMKernelCompilationCommand indexedCopy(int index) =>
|
||||
VMKernelCompilationCommand(outputFile, _bootstrapDependencies, executable,
|
||||
arguments, environmentOverrides,
|
||||
alwaysCompile: _alwaysCompile, index: index);
|
||||
|
||||
@override
|
||||
VMKernelCompilationCommandOutput createOutput(
|
||||
int exitCode,
|
||||
bool timedOut,
|
||||
|
@ -507,6 +520,7 @@ class VMKernelCompilationCommand extends CompilationCommand {
|
|||
VMKernelCompilationCommandOutput(
|
||||
this, exitCode, timedOut, stdout, stderr, time, compilationSkipped);
|
||||
|
||||
@override
|
||||
int get maxNumRetries => 1;
|
||||
}
|
||||
|
||||
|
@ -516,8 +530,10 @@ class AddFlagsKey {
|
|||
final Map env;
|
||||
AddFlagsKey(this.flags, this.env);
|
||||
// Just use object identity for environment map
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
other is AddFlagsKey && flags == other.flags && env == other.env;
|
||||
@override
|
||||
int get hashCode => flags.hashCode ^ env.hashCode;
|
||||
}
|
||||
|
||||
|
@ -529,9 +545,11 @@ class BrowserTestCommand extends Command {
|
|||
BrowserTestCommand(this.url, this.configuration, {int index = 0})
|
||||
: super._(configuration.runtime.name, index: index);
|
||||
|
||||
@override
|
||||
BrowserTestCommand indexedCopy(int index) =>
|
||||
BrowserTestCommand(url, configuration, index: index);
|
||||
|
||||
@override
|
||||
void _buildHashCode(HashCodeBuilder builder) {
|
||||
super._buildHashCode(builder);
|
||||
builder.addJson(browser.name);
|
||||
|
@ -539,12 +557,14 @@ class BrowserTestCommand extends Command {
|
|||
builder.add(configuration);
|
||||
}
|
||||
|
||||
@override
|
||||
bool _equal(BrowserTestCommand other) =>
|
||||
super._equal(other) &&
|
||||
browser == other.browser &&
|
||||
url == other.url &&
|
||||
identical(configuration, other.configuration);
|
||||
|
||||
@override
|
||||
String get reproductionCommand {
|
||||
var parts = [
|
||||
io.Platform.resolvedExecutable,
|
||||
|
@ -555,6 +575,7 @@ class BrowserTestCommand extends Command {
|
|||
return parts.map(escapeCommandLineArgument).join(' ');
|
||||
}
|
||||
|
||||
@override
|
||||
int get maxNumRetries => 4;
|
||||
}
|
||||
|
||||
|
@ -567,10 +588,12 @@ class AnalysisCommand extends ProcessCommand {
|
|||
: super('dart2analyzer', executable, arguments, environmentOverrides,
|
||||
null, index);
|
||||
|
||||
@override
|
||||
AnalysisCommand indexedCopy(int index) => AnalysisCommand(
|
||||
executable, arguments, commonAnalyzerCliArguments, environmentOverrides,
|
||||
index: index);
|
||||
|
||||
@override
|
||||
CommandOutput createOutput(int exitCode, bool timedOut, List<int> stdout,
|
||||
List<int> stderr, Duration time, bool compilationSkipped,
|
||||
[int? pid = 0]) =>
|
||||
|
@ -598,10 +621,12 @@ class CompareAnalyzerCfeCommand extends ProcessCommand {
|
|||
: super('compare_analyzer_cfe', executable, arguments,
|
||||
environmentOverrides, null, index);
|
||||
|
||||
@override
|
||||
CompareAnalyzerCfeCommand indexedCopy(int index) =>
|
||||
CompareAnalyzerCfeCommand(executable, arguments, environmentOverrides,
|
||||
index: index);
|
||||
|
||||
@override
|
||||
CompareAnalyzerCfeCommandOutput createOutput(
|
||||
int exitCode,
|
||||
bool timedOut,
|
||||
|
@ -620,10 +645,12 @@ class SpecParseCommand extends ProcessCommand {
|
|||
: super('spec_parser', executable, arguments, environmentOverrides, null,
|
||||
index);
|
||||
|
||||
@override
|
||||
SpecParseCommand indexedCopy(int index) =>
|
||||
SpecParseCommand(executable, arguments, environmentOverrides,
|
||||
index: index);
|
||||
|
||||
@override
|
||||
SpecParseCommandOutput createOutput(
|
||||
int exitCode,
|
||||
bool timedOut,
|
||||
|
@ -642,9 +669,11 @@ class VMCommand extends ProcessCommand {
|
|||
{int index = 0})
|
||||
: super('vm', executable, arguments, environmentOverrides, null, index);
|
||||
|
||||
@override
|
||||
VMCommand indexedCopy(int index) =>
|
||||
VMCommand(executable, arguments, environmentOverrides, index: index);
|
||||
|
||||
@override
|
||||
CommandOutput createOutput(int exitCode, bool timedOut, List<int> stdout,
|
||||
List<int> stderr, Duration time, bool compilationSkipped,
|
||||
[int pid = 0]) =>
|
||||
|
@ -664,14 +693,14 @@ class RRCommand extends Command {
|
|||
|
||||
RRCommand(this.originalCommand)
|
||||
: super._("rr", index: originalCommand.index) {
|
||||
final suffix = "/rr-trace-" + originalCommand.hashCode.toString();
|
||||
final suffix = "/rr-trace-${originalCommand.hashCode}";
|
||||
recordingDir = io.Directory(io.Directory.systemTemp.path + suffix);
|
||||
savedDir = io.Directory("out" + suffix);
|
||||
savedDir = io.Directory("out$suffix");
|
||||
final executable = "rr";
|
||||
final arguments = <String>[
|
||||
"record",
|
||||
"--chaos",
|
||||
"--output-trace-dir=" + recordingDir.path,
|
||||
"--output-trace-dir=${recordingDir.path}",
|
||||
];
|
||||
arguments.add(originalCommand.executable);
|
||||
arguments.addAll(originalCommand.arguments);
|
||||
|
@ -680,6 +709,7 @@ class RRCommand extends Command {
|
|||
index: originalCommand.index);
|
||||
}
|
||||
|
||||
@override
|
||||
RRCommand indexedCopy(int index) =>
|
||||
RRCommand(originalCommand.indexedCopy(index));
|
||||
|
||||
|
@ -698,10 +728,10 @@ class RRCommand extends Command {
|
|||
await savedDir.delete(recursive: true);
|
||||
}
|
||||
await recordingDir.rename(savedDir.path);
|
||||
await io.File(savedDir.path + "/command.txt")
|
||||
await io.File("${savedDir.path}/command.txt")
|
||||
.writeAsString(wrappedCommand.reproductionCommand);
|
||||
await io.File(savedDir.path + "/stdout.txt").writeAsBytes(output.stdout);
|
||||
await io.File(savedDir.path + "/stderr.txt").writeAsBytes(output.stderr);
|
||||
await io.File("${savedDir.path}/stdout.txt").writeAsBytes(output.stdout);
|
||||
await io.File("${savedDir.path}/stderr.txt").writeAsBytes(output.stderr);
|
||||
} else {
|
||||
await recordingDir.delete(recursive: true);
|
||||
}
|
||||
|
@ -710,14 +740,17 @@ class RRCommand extends Command {
|
|||
output.stdout, output.stderr, output.time, output.pid);
|
||||
}
|
||||
|
||||
@override
|
||||
String get reproductionCommand =>
|
||||
wrappedCommand.reproductionCommand + " (rr replay " + savedDir.path + ")";
|
||||
"${wrappedCommand.reproductionCommand} (rr replay ${savedDir.path})";
|
||||
|
||||
@override
|
||||
void _buildHashCode(HashCodeBuilder builder) {
|
||||
originalCommand._buildHashCode(builder);
|
||||
builder.add(42);
|
||||
}
|
||||
|
||||
@override
|
||||
bool _equal(RRCommand other) =>
|
||||
hashCode == other.hashCode &&
|
||||
originalCommand._equal(other.originalCommand);
|
||||
|
@ -729,12 +762,14 @@ abstract class AdbCommand {
|
|||
}
|
||||
|
||||
class AdbPrecompilationCommand extends Command implements AdbCommand {
|
||||
@override
|
||||
final String buildPath; // Path to the output directory of the build.
|
||||
final String processTestFilename;
|
||||
final String abstractSocketTestFilename;
|
||||
final String precompiledTestDirectory;
|
||||
final List<String> arguments;
|
||||
final bool useElf;
|
||||
@override
|
||||
final List<String> extraLibraries;
|
||||
|
||||
AdbPrecompilationCommand(
|
||||
|
@ -748,6 +783,7 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
|
|||
{int index = 0})
|
||||
: super._("adb_precompilation", index: index);
|
||||
|
||||
@override
|
||||
AdbPrecompilationCommand indexedCopy(int index) => AdbPrecompilationCommand(
|
||||
buildPath,
|
||||
processTestFilename,
|
||||
|
@ -758,11 +794,13 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
|
|||
extraLibraries,
|
||||
index: index);
|
||||
|
||||
@override
|
||||
VMCommandOutput createOutput(int exitCode, bool timedOut, List<int> stdout,
|
||||
List<int> stderr, Duration time, bool compilationSkipped,
|
||||
[int pid = 0]) =>
|
||||
VMCommandOutput(this, exitCode, timedOut, stdout, stderr, time, pid);
|
||||
|
||||
@override
|
||||
_buildHashCode(HashCodeBuilder builder) {
|
||||
super._buildHashCode(builder);
|
||||
builder.add(buildPath);
|
||||
|
@ -772,6 +810,7 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
|
|||
extraLibraries.forEach(builder.add);
|
||||
}
|
||||
|
||||
@override
|
||||
bool _equal(AdbPrecompilationCommand other) =>
|
||||
super._equal(other) &&
|
||||
buildPath == other.buildPath &&
|
||||
|
@ -780,6 +819,7 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
|
|||
precompiledTestDirectory == other.precompiledTestDirectory &&
|
||||
deepJsonCompare(extraLibraries, other.extraLibraries);
|
||||
|
||||
@override
|
||||
String toString() => 'Steps to push precompiled runner and precompiled code '
|
||||
'to an attached device. Uses (and requires) adb.';
|
||||
|
||||
|
@ -788,11 +828,13 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
|
|||
}
|
||||
|
||||
class AdbDartkCommand extends Command implements AdbCommand {
|
||||
@override
|
||||
final String buildPath;
|
||||
final String processTestFilename;
|
||||
final String abstractSocketTestFilename;
|
||||
final String kernelFile;
|
||||
final List<String> arguments;
|
||||
@override
|
||||
final List<String> extraLibraries;
|
||||
|
||||
AdbDartkCommand(
|
||||
|
@ -805,6 +847,7 @@ class AdbDartkCommand extends Command implements AdbCommand {
|
|||
{int index = 0})
|
||||
: super._("adb_precompilation", index: index);
|
||||
|
||||
@override
|
||||
AdbDartkCommand indexedCopy(int index) => AdbDartkCommand(
|
||||
buildPath,
|
||||
processTestFilename,
|
||||
|
@ -814,6 +857,7 @@ class AdbDartkCommand extends Command implements AdbCommand {
|
|||
extraLibraries,
|
||||
index: index);
|
||||
|
||||
@override
|
||||
_buildHashCode(HashCodeBuilder builder) {
|
||||
super._buildHashCode(builder);
|
||||
builder.add(buildPath);
|
||||
|
@ -822,6 +866,7 @@ class AdbDartkCommand extends Command implements AdbCommand {
|
|||
builder.add(extraLibraries);
|
||||
}
|
||||
|
||||
@override
|
||||
bool _equal(AdbDartkCommand other) =>
|
||||
super._equal(other) &&
|
||||
buildPath == other.buildPath &&
|
||||
|
@ -829,11 +874,13 @@ class AdbDartkCommand extends Command implements AdbCommand {
|
|||
extraLibraries == other.extraLibraries &&
|
||||
kernelFile == other.kernelFile;
|
||||
|
||||
@override
|
||||
VMCommandOutput createOutput(int exitCode, bool timedOut, List<int> stdout,
|
||||
List<int> stderr, Duration time, bool compilationSkipped,
|
||||
[int pid = 0]) =>
|
||||
VMCommandOutput(this, exitCode, timedOut, stdout, stderr, time, pid);
|
||||
|
||||
@override
|
||||
String toString() => 'Steps to push Dart VM and Dill file '
|
||||
'to an attached device. Uses (and requires) adb.';
|
||||
|
||||
|
@ -848,9 +895,11 @@ class JSCommandLineCommand extends ProcessCommand {
|
|||
: super(displayName, executable, arguments, environmentOverrides, null,
|
||||
index);
|
||||
|
||||
@override
|
||||
JSCommandLineCommand indexedCopy(int index) => JSCommandLineCommand(
|
||||
displayName, executable, arguments, environmentOverrides, index);
|
||||
|
||||
@override
|
||||
JSCommandLineOutput createOutput(
|
||||
int exitCode,
|
||||
bool timedOut,
|
||||
|
@ -869,10 +918,12 @@ class Dart2WasmCommandLineCommand extends ProcessCommand {
|
|||
: super(displayName, executable, arguments, environmentOverrides, null,
|
||||
index);
|
||||
|
||||
@override
|
||||
Dart2WasmCommandLineCommand indexedCopy(int index) =>
|
||||
Dart2WasmCommandLineCommand(
|
||||
displayName, executable, arguments, environmentOverrides, index);
|
||||
|
||||
@override
|
||||
Dart2WasmCommandLineOutput createOutput(
|
||||
int exitCode,
|
||||
bool timedOut,
|
||||
|
|
|
@ -337,6 +337,7 @@ class BrowserCommandOutput extends CommandOutput
|
|||
super(command, 0, result.didTimeout, stdout, stderr, result.duration,
|
||||
false, 0);
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// Handle timeouts first.
|
||||
if (_result.didTimeout) {
|
||||
|
@ -357,6 +358,7 @@ class BrowserCommandOutput extends CommandOutput
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
// Handle timeouts first.
|
||||
if (_result.didTimeout) {
|
||||
|
@ -368,6 +370,7 @@ class BrowserCommandOutput extends CommandOutput
|
|||
return _outcome;
|
||||
}
|
||||
|
||||
@override
|
||||
void describe(TestCase testCase, Progress progress, OutputWriter output) {
|
||||
if (_jsonResult != null) {
|
||||
_describeEvents(progress, output);
|
||||
|
@ -392,15 +395,15 @@ class BrowserCommandOutput extends CommandOutput
|
|||
|
||||
void _describeEvents(Progress progress, OutputWriter output) {
|
||||
// Always show the error events since those are most useful.
|
||||
var showedError = false;
|
||||
var errorShown = false;
|
||||
|
||||
void _showError(String header, event) {
|
||||
void showError(String header, event) {
|
||||
output.subsection(header);
|
||||
var value = event["value"] as String?;
|
||||
if (event["stack_trace"] != null) {
|
||||
value = '$value\n${event["stack_trace"]}';
|
||||
}
|
||||
showedError = true;
|
||||
errorShown = true;
|
||||
output.write(value);
|
||||
|
||||
// Skip deobfuscation if there is no indication that there is a stack
|
||||
|
@ -419,15 +422,15 @@ class BrowserCommandOutput extends CommandOutput
|
|||
|
||||
for (var event in _jsonResult!.events) {
|
||||
if (event["type"] == "sync_exception") {
|
||||
_showError("Runtime error", event);
|
||||
showError("Runtime error", event);
|
||||
} else if (event["type"] == "window_onerror") {
|
||||
_showError("Runtime window.onerror", event);
|
||||
showError("Runtime window.onerror", event);
|
||||
}
|
||||
}
|
||||
|
||||
// Show the events unless the above error was sufficient.
|
||||
// TODO(rnystrom): Let users enable or disable this explicitly?
|
||||
if (showedError &&
|
||||
if (errorShown &&
|
||||
progress != Progress.buildbot &&
|
||||
progress != Progress.verbose) {
|
||||
return;
|
||||
|
@ -451,7 +454,7 @@ class BrowserCommandOutput extends CommandOutput
|
|||
case "window_onerror":
|
||||
var value = event["value"] as String;
|
||||
value = indent(value.trim(), 2);
|
||||
value = "- " + value.substring(2);
|
||||
value = "- ${value.substring(2)}";
|
||||
output.write(value);
|
||||
break;
|
||||
|
||||
|
@ -637,6 +640,7 @@ class AnalysisCommandOutput extends CommandOutput with _StaticErrorOutput {
|
|||
: super(command, exitCode, timedOut, stdout, stderr, time,
|
||||
compilationSkipped, 0);
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// TODO(kustermann): If we run the analyzer not in batch mode, make sure
|
||||
// that command.exitCodes matches 2 (errors), 1 (warnings), 0 (no warnings,
|
||||
|
@ -684,6 +688,7 @@ class AnalysisCommandOutput extends CommandOutput with _StaticErrorOutput {
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
// TODO(kustermann): If we run the analyzer not in batch mode, make sure
|
||||
// that command.exitCodes matches 2 (errors), 1 (warnings), 0 (no warnings,
|
||||
|
@ -786,6 +791,7 @@ class CompareAnalyzerCfeCommandOutput extends CommandOutput {
|
|||
: super(command, exitCode, timedOut, stdout, stderr, time,
|
||||
compilationSkipped, 0);
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// Handle crashes and timeouts first
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -803,6 +809,7 @@ class CompareAnalyzerCfeCommandOutput extends CommandOutput {
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
// Handle crashes and timeouts first
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -833,6 +840,7 @@ class SpecParseCommandOutput extends CommandOutput {
|
|||
|
||||
bool get hasSyntaxError => exitCode == parseFailExitCode;
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// Handle crashes and timeouts first.
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -860,6 +868,7 @@ class SpecParseCommandOutput extends CommandOutput {
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
if (hasTimedOut) return Expectation.timeout;
|
||||
|
@ -883,6 +892,7 @@ class VMCommandOutput extends CommandOutput with _UnittestSuiteMessagesMixin {
|
|||
List<int> stdout, List<int> stderr, Duration time, int pid)
|
||||
: super(command, exitCode, timedOut, stdout, stderr, time, false, pid);
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// Handle crashes and timeouts first.
|
||||
if (exitCode == _dfeErrorExitCode) return Expectation.dartkCrash;
|
||||
|
@ -924,6 +934,7 @@ class VMCommandOutput extends CommandOutput with _UnittestSuiteMessagesMixin {
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
// Handle crashes and timeouts first.
|
||||
if (exitCode == _dfeErrorExitCode) return Expectation.dartkCrash;
|
||||
|
@ -984,6 +995,7 @@ class CompilationCommandOutput extends CommandOutput {
|
|||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
/// This code can return Expectation.ignore - we may want to fix that.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
// Handle general crash/timeout detection.
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -1009,6 +1021,7 @@ class CompilationCommandOutput extends CommandOutput {
|
|||
return Expectation.pass;
|
||||
}
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// Handle general crash/timeout detection.
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -1160,6 +1173,7 @@ class DevCompilerCommandOutput extends CommandOutput with _StaticErrorOutput {
|
|||
: super(command, exitCode, timedOut, stdout, stderr, time,
|
||||
compilationSkipped, pid);
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
if (hasTimedOut) return Expectation.timeout;
|
||||
|
@ -1183,6 +1197,7 @@ class DevCompilerCommandOutput extends CommandOutput with _StaticErrorOutput {
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
if (hasTimedOut) return Expectation.timeout;
|
||||
|
@ -1220,6 +1235,7 @@ class VMKernelCompilationCommandOutput extends CompilationCommandOutput {
|
|||
: super(command, exitCode, timedOut, stdout, stderr, time,
|
||||
compilationSkipped);
|
||||
|
||||
@override
|
||||
bool get canRunDependentCommands {
|
||||
// See [BatchRunnerProcess]: 0 means success, 1 means compile-time error.
|
||||
// TODO(asgerf): When the frontend supports it, continue running even if
|
||||
|
@ -1227,6 +1243,7 @@ class VMKernelCompilationCommandOutput extends CompilationCommandOutput {
|
|||
return !hasCrashed && !hasTimedOut && exitCode == 0;
|
||||
}
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// TODO(kustermann): Currently the batch mode runner (which can be found
|
||||
// in `test_runner.dart:BatchRunnerProcess`) does not really distinguish
|
||||
|
@ -1270,6 +1287,7 @@ class VMKernelCompilationCommandOutput extends CompilationCommandOutput {
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
// TODO(kustermann): Currently the batch mode runner (which can be found
|
||||
// in `test_runner.dart:BatchRunnerProcess`) does not really distinguish
|
||||
|
@ -1309,6 +1327,7 @@ class VMKernelCompilationCommandOutput extends CompilationCommandOutput {
|
|||
///
|
||||
/// This ensures we test that the DartVM produces correct CompileTime errors
|
||||
/// as it is supposed to for our test suites.
|
||||
@override
|
||||
bool get successful => canRunDependentCommands;
|
||||
}
|
||||
|
||||
|
@ -1318,6 +1337,7 @@ class JSCommandLineOutput extends CommandOutput
|
|||
List<int> stdout, List<int> stderr, Duration time)
|
||||
: super(command, exitCode, timedOut, stdout, stderr, time, false, 0);
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// Handle crashes and timeouts first.
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -1336,6 +1356,7 @@ class JSCommandLineOutput extends CommandOutput
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
// Handle crashes and timeouts first.
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -1351,6 +1372,7 @@ class JSCommandLineOutput extends CommandOutput
|
|||
return Expectation.pass;
|
||||
}
|
||||
|
||||
@override
|
||||
void describe(TestCase testCase, Progress progress, OutputWriter output) {
|
||||
super.describe(testCase, progress, output);
|
||||
var decodedOut = decodeUtf8(stdout)
|
||||
|
@ -1368,6 +1390,7 @@ class Dart2WasmCommandLineOutput extends CommandOutput
|
|||
List<int> stdout, List<int> stderr, Duration time)
|
||||
: super(command, exitCode, timedOut, stdout, stderr, time, false, 0);
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
// Handle crashes and timeouts first.
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -1386,6 +1409,7 @@ class Dart2WasmCommandLineOutput extends CommandOutput
|
|||
|
||||
/// Cloned code from member result(), with changes.
|
||||
/// Delete existing result() function and rename, when status files are gone.
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
// Handle crashes and timeouts first.
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
|
@ -1412,12 +1436,16 @@ class ScriptCommandOutput extends CommandOutput {
|
|||
diagnostics.addAll(lines);
|
||||
}
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) => _result;
|
||||
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) => _result;
|
||||
|
||||
@override
|
||||
bool get canRunDependentCommands => _result == Expectation.pass;
|
||||
|
||||
@override
|
||||
bool get successful => _result == Expectation.pass;
|
||||
}
|
||||
|
||||
|
@ -1582,6 +1610,7 @@ mixin _StaticErrorOutput on CommandOutput {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Expectation result(TestCase testCase) {
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
if (hasTimedOut) return Expectation.timeout;
|
||||
|
@ -1596,6 +1625,7 @@ mixin _StaticErrorOutput on CommandOutput {
|
|||
return super.result(testCase);
|
||||
}
|
||||
|
||||
@override
|
||||
Expectation realResult(TestCase testCase) {
|
||||
if (hasCrashed) return Expectation.crash;
|
||||
if (hasTimedOut) return Expectation.timeout;
|
||||
|
|
|
@ -171,6 +171,7 @@ class NoneCompilerConfiguration extends CompilerConfiguration {
|
|||
@override
|
||||
final bool hasCompiler = false;
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -206,6 +207,7 @@ class VMKernelCompilerConfiguration extends CompilerConfiguration
|
|||
VMKernelCompilerConfiguration(TestConfiguration configuration)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
bool get _isAot => false;
|
||||
|
||||
// Issue(http://dartbug.com/29840): Currently fasta sometimes does not emit a
|
||||
|
@ -219,8 +221,10 @@ class VMKernelCompilerConfiguration extends CompilerConfiguration
|
|||
// The corresponding http://dartbug.com/29840 tracks to get the frontend to
|
||||
// emit all necessary compile-time errors (and *additionally* encode them
|
||||
// in the AST in certain cases).
|
||||
@override
|
||||
bool get runRuntimeDespiteMissingCompileTimeError => true;
|
||||
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
final commands = <Command>[
|
||||
|
@ -243,6 +247,7 @@ class VMKernelCompilerConfiguration extends CompilerConfiguration
|
|||
];
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -324,6 +329,7 @@ class ComposedCompilerConfiguration extends CompilerConfiguration {
|
|||
TestConfiguration configuration, this.pipelineCommands)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
var allCommands = <Command>[];
|
||||
|
@ -352,6 +358,7 @@ class ComposedCompilerConfiguration extends CompilerConfiguration {
|
|||
return CommandArtifact(allCommands, artifact.filename, artifact.mimeType);
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeCompilerArguments(
|
||||
TestFile testFile, List<String> vmOptions, List<String> args) {
|
||||
// The result will be passed as an input to [extractArguments]
|
||||
|
@ -365,6 +372,7 @@ class ComposedCompilerConfiguration extends CompilerConfiguration {
|
|||
];
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -384,6 +392,7 @@ class Dart2jsCompilerConfiguration extends CompilerConfiguration {
|
|||
Dart2jsCompilerConfiguration(TestConfiguration configuration)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
String computeCompilerPath() {
|
||||
if (_isHostChecked && _useSdk) {
|
||||
// When [_useSdk] is true, dart2js is compiled into a snapshot that was
|
||||
|
@ -417,6 +426,7 @@ class Dart2jsCompilerConfiguration extends CompilerConfiguration {
|
|||
useSdk: _useSdk, alwaysCompile: !_useSdk);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Uri> bootstrapDependencies() {
|
||||
if (!_useSdk) return const <Uri>[];
|
||||
return _bootstrapDependenciesCache.putIfAbsent(
|
||||
|
@ -428,6 +438,7 @@ class Dart2jsCompilerConfiguration extends CompilerConfiguration {
|
|||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeCompilerArguments(
|
||||
TestFile testFile, List<String> vmOptions, List<String> args) {
|
||||
return [
|
||||
|
@ -440,6 +451,7 @@ class Dart2jsCompilerConfiguration extends CompilerConfiguration {
|
|||
];
|
||||
}
|
||||
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
var compilerArguments = [
|
||||
|
@ -466,6 +478,7 @@ class Dart2jsCompilerConfiguration extends CompilerConfiguration {
|
|||
return CommandArtifact(commands, babelOut, 'application/javascript');
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -502,6 +515,7 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
|
|||
Dart2WasmCompilerConfiguration(TestConfiguration configuration)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
String computeCompilerPath() {
|
||||
var prefix = 'sdk/bin';
|
||||
if (_isHostChecked) {
|
||||
|
@ -519,6 +533,7 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
|
|||
return '$prefix/dart2wasm$shellScriptExtension';
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeCompilerArguments(
|
||||
TestFile testFile, List<String> vmOptions, List<String> args) {
|
||||
return [
|
||||
|
@ -534,7 +549,7 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
|
|||
Command computeCompilationCommand(String outputFileName,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
arguments = arguments.toList();
|
||||
arguments.add('$outputFileName');
|
||||
arguments.add(outputFileName);
|
||||
|
||||
return CompilationCommand(
|
||||
'dart2wasm',
|
||||
|
@ -546,6 +561,7 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
|
|||
alwaysCompile: !_useSdk);
|
||||
}
|
||||
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
var compilerArguments = [
|
||||
|
@ -562,6 +578,7 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
|
|||
return CommandArtifact(commands, out, 'application/wasm');
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -588,6 +605,7 @@ class DevCompilerConfiguration extends CompilerConfiguration {
|
|||
DevCompilerConfiguration(TestConfiguration configuration)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
String computeCompilerPath() {
|
||||
// DDC is a Dart program and not an executable itself, so the command to
|
||||
// spawn as a subprocess is a Dart VM.
|
||||
|
@ -598,6 +616,7 @@ class DevCompilerConfiguration extends CompilerConfiguration {
|
|||
return '$dir/bin/dart$executableExtension';
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeCompilerArguments(
|
||||
TestFile testFile, List<String> vmOptions, List<String> args) {
|
||||
return [
|
||||
|
@ -683,6 +702,7 @@ class DevCompilerConfiguration extends CompilerConfiguration {
|
|||
compilerPath: compilerPath, alwaysCompile: false);
|
||||
}
|
||||
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
// The list of arguments comes from a call to our own
|
||||
|
@ -754,6 +774,7 @@ class DevCompilerConfiguration extends CompilerConfiguration {
|
|||
], runFile, "application/javascript");
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -803,11 +824,13 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
bool get _isSimRiscv64 =>
|
||||
_configuration.architecture == Architecture.simriscv64;
|
||||
|
||||
@override
|
||||
bool get _isAot => true;
|
||||
|
||||
PrecompilerCompilerConfiguration(TestConfiguration configuration)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
int get timeoutMultiplier {
|
||||
var multiplier = 2;
|
||||
if (_isDebug) multiplier *= 4;
|
||||
|
@ -815,6 +838,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
return multiplier;
|
||||
}
|
||||
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
var commands = <Command>[];
|
||||
|
@ -853,8 +877,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
return CommandArtifact(
|
||||
commands, '$tempDir', 'application/dart-precompiled');
|
||||
return CommandArtifact(commands, tempDir, 'application/dart-precompiled');
|
||||
}
|
||||
|
||||
/// Creates a command to clean up large temporary kernel files.
|
||||
|
@ -1084,6 +1107,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
return filtered;
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeCompilerArguments(
|
||||
TestFile testFile, List<String> vmOptions, List<String> args) {
|
||||
return [
|
||||
|
@ -1101,6 +1125,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
|
|||
];
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -1133,6 +1158,7 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
|
|||
AppJitCompilerConfiguration(TestConfiguration configuration)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
int get timeoutMultiplier {
|
||||
var multiplier = 1;
|
||||
if (_isDebug) multiplier *= 2;
|
||||
|
@ -1140,6 +1166,7 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
|
|||
return multiplier;
|
||||
}
|
||||
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
var snapshot = "$tempDir/out.jitsnapshot";
|
||||
|
@ -1169,6 +1196,7 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
|
|||
alwaysCompile: !_useSdk);
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeCompilerArguments(
|
||||
TestFile testFile, List<String> vmOptions, List<String> args) {
|
||||
return [
|
||||
|
@ -1183,6 +1211,7 @@ class AppJitCompilerConfiguration extends CompilerConfiguration {
|
|||
];
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -1207,6 +1236,7 @@ class AnalyzerCompilerConfiguration extends CompilerConfiguration {
|
|||
AnalyzerCompilerConfiguration(TestConfiguration configuration)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
int get timeoutMultiplier => 4;
|
||||
|
||||
@override
|
||||
|
@ -1242,6 +1272,7 @@ class AnalyzerCompilerConfiguration extends CompilerConfiguration {
|
|||
];
|
||||
|
||||
/// [arguments].last must be the Dart source file.
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
// Since this is not a real compilation, no artifacts are produced.
|
||||
|
@ -1275,8 +1306,10 @@ class SpecParserCompilerConfiguration extends CompilerConfiguration {
|
|||
SpecParserCompilerConfiguration(TestConfiguration configuration)
|
||||
: super._subclass(configuration);
|
||||
|
||||
@override
|
||||
String computeCompilerPath() => 'tools/spec_parse.py';
|
||||
|
||||
@override
|
||||
CommandArtifact computeCompilationArtifact(String tempDir,
|
||||
List<String> arguments, Map<String, String> environmentOverrides) {
|
||||
// Since this is not a real compilation, no artifacts are produced.
|
||||
|
@ -1286,6 +1319,7 @@ class SpecParserCompilerConfiguration extends CompilerConfiguration {
|
|||
'application/vnd.dart');
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> computeRuntimeArguments(
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
TestFile testFile,
|
||||
|
@ -1315,7 +1349,7 @@ abstract class VMKernelCompilerMixin {
|
|||
var pkgVmDir = Platform.script.resolve('../../../pkg/vm').toFilePath();
|
||||
var genKernel = '$pkgVmDir/tool/gen_kernel$shellScriptExtension';
|
||||
|
||||
var kernelBinariesFolder = '${_configuration.buildDirectory}';
|
||||
var kernelBinariesFolder = _configuration.buildDirectory;
|
||||
if (_useSdk) {
|
||||
kernelBinariesFolder += '/dart-sdk/lib/_internal';
|
||||
}
|
||||
|
|
|
@ -484,5 +484,6 @@ class Progress {
|
|||
|
||||
const Progress._(this.name);
|
||||
|
||||
@override
|
||||
String toString() => "Progress($name)";
|
||||
}
|
||||
|
|
|
@ -23,13 +23,13 @@ class Graph<T> {
|
|||
final StreamController<StateChangedEvent<T>> _changedController;
|
||||
|
||||
/// Notifies when the graph is sealed.
|
||||
final Stream<Null> sealed;
|
||||
final StreamController<Null> _sealedController;
|
||||
final Stream<void> sealed;
|
||||
final StreamController<void> _sealedController;
|
||||
|
||||
factory Graph() {
|
||||
var added = StreamController<Node<T>>();
|
||||
var changed = StreamController<StateChangedEvent<T>>();
|
||||
var sealed = StreamController<Null>();
|
||||
var sealed = StreamController<void>();
|
||||
|
||||
return Graph._(
|
||||
added,
|
||||
|
@ -134,6 +134,7 @@ class NodeState {
|
|||
|
||||
const NodeState._(this.name);
|
||||
|
||||
@override
|
||||
String toString() => name;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ String _runtimeName(TestConfiguration configuration) {
|
|||
return configuration.runtime.name;
|
||||
}
|
||||
|
||||
List<String> _runtimeNames = ['ff', 'drt']..addAll(Runtime.names);
|
||||
List<String> _runtimeNames = ['ff', 'drt', ...Runtime.names];
|
||||
|
||||
/// Gets the name of the runtime as it appears in status files.
|
||||
String _systemName(TestConfiguration configuration) {
|
||||
|
@ -60,7 +60,7 @@ String _systemName(TestConfiguration configuration) {
|
|||
return configuration.system.name;
|
||||
}
|
||||
|
||||
List<String> _systemNames = ['windows', 'macos']..addAll(System.names);
|
||||
List<String> _systemNames = ['windows', 'macos', ...System.names];
|
||||
|
||||
/// Defines the variables that are available for use inside a status file
|
||||
/// section header.
|
||||
|
@ -77,6 +77,7 @@ class ConfigurationEnvironment implements Environment {
|
|||
/// against [value].
|
||||
///
|
||||
/// If any errors are found, adds them to [errors].
|
||||
@override
|
||||
void validate(String name, String value, List<String> errors) {
|
||||
var variable = _variables[name];
|
||||
if (variable == null) {
|
||||
|
@ -89,13 +90,13 @@ class ConfigurationEnvironment implements Environment {
|
|||
|
||||
if (!variable.allowedValues.contains(value)) {
|
||||
errors.add(
|
||||
'Variable "$name" cannot have value "$value". Allowed values are:\n' +
|
||||
variable.allowedValues.join(', ') +
|
||||
'.');
|
||||
'Variable "$name" cannot have value "$value". Allowed values are:\n'
|
||||
'${variable.allowedValues.join(', ')}.');
|
||||
}
|
||||
}
|
||||
|
||||
/// Looks up the value of the variable with [name].
|
||||
@override
|
||||
String lookUp(String name) {
|
||||
var variable = _variables[name];
|
||||
if (variable == null) {
|
||||
|
|
|
@ -58,7 +58,7 @@ class ExpectationSet {
|
|||
for (var part in entry.path.split('/')) {
|
||||
if (part.contains("*")) {
|
||||
var regExp = _globCache.putIfAbsent(part, () {
|
||||
return RegExp("^" + part.replaceAll("*", ".*") + r"$");
|
||||
return RegExp("^${part.replaceAll("*", ".*")}" r"$");
|
||||
});
|
||||
tree = tree.regExpChildren.putIfAbsent(regExp, () => _PathNode());
|
||||
} else {
|
||||
|
|
|
@ -31,5 +31,6 @@ class Feature {
|
|||
|
||||
const Feature._(this.name);
|
||||
|
||||
@override
|
||||
String toString() => name;
|
||||
}
|
||||
|
|
|
@ -72,8 +72,8 @@ class FuchsiaEmulator {
|
|||
}, onDone: () {
|
||||
if (!deviceNameFuture.isCompleted) {
|
||||
deviceNameFuture.completeError(
|
||||
'Fuchsia emulator terminated unexpectedly.\n\n' +
|
||||
_formatOutputs(emuStdout.toString(), emuStderr.toString()));
|
||||
'Fuchsia emulator terminated unexpectedly.\n\n'
|
||||
'${_formatOutputs(emuStdout.toString(), emuStderr.toString())}');
|
||||
}
|
||||
_stop();
|
||||
});
|
||||
|
@ -118,9 +118,9 @@ class FuchsiaEmulator {
|
|||
}, onDone: () {
|
||||
if (!serverReadyFuture.isCompleted) {
|
||||
serverReadyFuture.completeError(
|
||||
'Fuchsia package server terminated unexpectedly.\n\n' +
|
||||
_formatOutputs(
|
||||
serverStdout.toString(), serverStderr.toString()));
|
||||
'Fuchsia package server terminated unexpectedly.\n\n'
|
||||
'${_formatOutputs(serverStdout.toString(), serverStderr.toString())}',
|
||||
);
|
||||
}
|
||||
_stop();
|
||||
});
|
||||
|
@ -220,7 +220,7 @@ class FuchsiaEmulator {
|
|||
}
|
||||
|
||||
String _formatFailedResult(String name, ProcessResult result) {
|
||||
return '$name failed with exit code: ${result.exitCode}\n\n' +
|
||||
_formatOutputs(result.stdout as String, result.stderr as String);
|
||||
return '$name failed with exit code: ${result.exitCode}\n\n'
|
||||
'${_formatOutputs(result.stdout as String, result.stderr as String)}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,10 @@ class Path {
|
|||
return Platform.operatingSystem == 'windows' && source.startsWith('\\\\');
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(other) => other is Path && _path == other._path;
|
||||
|
||||
@override
|
||||
int get hashCode => _path.hashCode;
|
||||
bool get isEmpty => _path.isEmpty;
|
||||
bool get isAbsolute => _path.startsWith('/');
|
||||
|
@ -61,6 +63,7 @@ class Path {
|
|||
return Path.workingDirectory.join(this);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => _path;
|
||||
|
||||
Path relativeTo(Path base) {
|
||||
|
@ -140,7 +143,7 @@ class Path {
|
|||
segments.add('..');
|
||||
}
|
||||
for (var i = common; i < pathSegments.length; i++) {
|
||||
segments.add('${pathSegments[i]}');
|
||||
segments.add(pathSegments[i]);
|
||||
}
|
||||
if (segments.isEmpty) {
|
||||
segments.add('.');
|
||||
|
|
|
@ -48,7 +48,7 @@ class ProcessQueue {
|
|||
[bool verbose = false,
|
||||
AdbDevicePool? adbDevicePool]) {
|
||||
void setupForListing(TestCaseEnqueuer testCaseEnqueuer) {
|
||||
_graph.sealed.listen((Null _) {
|
||||
_graph.sealed.listen((_) {
|
||||
var testCases = testCaseEnqueuer.remainingTestCases.toList();
|
||||
testCases.sort((a, b) => a.displayName.compareTo(b.displayName));
|
||||
|
||||
|
@ -70,20 +70,18 @@ class ProcessQueue {
|
|||
late CommandQueue commandQueue;
|
||||
|
||||
void setupForRunning(TestCaseEnqueuer testCaseEnqueuer) {
|
||||
Timer? _debugTimer;
|
||||
Timer? debugTimer;
|
||||
// If we haven't seen a single test finishing during a 10 minute period
|
||||
// something is definitely wrong, so we dump the debugging information.
|
||||
final debugTimerDuration = const Duration(minutes: 10);
|
||||
|
||||
void cancelDebugTimer() {
|
||||
if (_debugTimer != null) {
|
||||
_debugTimer!.cancel();
|
||||
}
|
||||
debugTimer?.cancel();
|
||||
}
|
||||
|
||||
void resetDebugTimer() {
|
||||
cancelDebugTimer();
|
||||
_debugTimer = Timer(debugTimerDuration, () {
|
||||
debugTimer = Timer(debugTimerDuration, () {
|
||||
print("The debug timer of test.dart expired. Please report this issue"
|
||||
" to dart-engprod@ and provide the following information:");
|
||||
print("");
|
||||
|
@ -124,7 +122,7 @@ class ProcessQueue {
|
|||
}
|
||||
|
||||
// When the graph building is finished, notify event listeners.
|
||||
_graph.sealed.listen((Null _) {
|
||||
_graph.sealed.listen((_) {
|
||||
eventAllTestsKnown();
|
||||
});
|
||||
|
||||
|
@ -358,7 +356,7 @@ class CommandQueue {
|
|||
|
||||
final _runQueue = Queue<Command>();
|
||||
final _commandOutputStream = StreamController<CommandOutput>(sync: true);
|
||||
final _completer = Completer<Null>();
|
||||
final _completer = Completer<void>();
|
||||
|
||||
int _numProcesses = 0;
|
||||
final int _maxProcesses;
|
||||
|
@ -390,7 +388,7 @@ class CommandQueue {
|
|||
// state (Successful, Failed or UnableToRun).
|
||||
// So we're calling '_checkDone()' to check whether that condition is met
|
||||
// and we can cleanup.
|
||||
graph.sealed.listen((Null _) {
|
||||
graph.sealed.listen((_) {
|
||||
_checkDone();
|
||||
});
|
||||
}
|
||||
|
@ -513,11 +511,12 @@ class CommandExecutorImpl implements CommandExecutor {
|
|||
this.globalConfiguration, this.maxProcesses, this.maxBrowserProcesses,
|
||||
{this.adbDevicePool});
|
||||
|
||||
@override
|
||||
Future cleanup() {
|
||||
assert(!_finishing);
|
||||
_finishing = true;
|
||||
|
||||
Future _terminateBatchRunners() {
|
||||
Future terminateBatchRunners() {
|
||||
var futures = <Future>[];
|
||||
for (var runners in _batchProcesses.values) {
|
||||
futures.addAll(runners.map((runner) => runner.terminate()));
|
||||
|
@ -525,18 +524,19 @@ class CommandExecutorImpl implements CommandExecutor {
|
|||
return Future.wait(futures);
|
||||
}
|
||||
|
||||
Future _terminateBrowserRunners() async {
|
||||
Future terminateBrowserRunners() async {
|
||||
var futures = _browserTestRunners.values
|
||||
.map((runner) async => (await runner).terminate());
|
||||
return Future.wait(futures);
|
||||
}
|
||||
|
||||
return Future.wait([
|
||||
_terminateBatchRunners(),
|
||||
_terminateBrowserRunners(),
|
||||
terminateBatchRunners(),
|
||||
terminateBrowserRunners(),
|
||||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<CommandOutput> runCommand(Command command, int timeout) {
|
||||
assert(!_finishing);
|
||||
|
||||
|
@ -664,13 +664,12 @@ class CommandExecutorImpl implements CommandExecutor {
|
|||
.runAdbCommand(['push', '$testdir/$file', '$deviceTestDir/$file']));
|
||||
}
|
||||
|
||||
steps.add(() => device.runAdbShellCommand(
|
||||
[
|
||||
steps.add(() => device.runAdbShellCommand([
|
||||
'export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$deviceTestDir;'
|
||||
'$devicedir/dart_precompiled_runtime',
|
||||
'--android-log-to-stderr'
|
||||
]..addAll(arguments),
|
||||
timeout: timeoutDuration));
|
||||
'--android-log-to-stderr',
|
||||
...arguments,
|
||||
], timeout: timeoutDuration));
|
||||
|
||||
var stopwatch = Stopwatch()..start();
|
||||
var writer = StringBuffer();
|
||||
|
@ -724,13 +723,12 @@ class CommandExecutorImpl implements CommandExecutor {
|
|||
|
||||
steps.addAll(_pushLibraries(command, device, devicedir, deviceTestDir));
|
||||
|
||||
steps.add(() => device.runAdbShellCommand(
|
||||
[
|
||||
steps.add(() => device.runAdbShellCommand([
|
||||
'export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$deviceTestDir;'
|
||||
'$devicedir/dart',
|
||||
'--android-log-to-stderr'
|
||||
]..addAll(arguments),
|
||||
timeout: timeoutDuration));
|
||||
'--android-log-to-stderr',
|
||||
...arguments,
|
||||
], timeout: timeoutDuration));
|
||||
|
||||
var stopwatch = Stopwatch()..start();
|
||||
var writer = StringBuffer();
|
||||
|
@ -904,7 +902,7 @@ class TestCaseCompleter {
|
|||
|
||||
// Listen also for GraphSealedEvents. If there is not a single node in the
|
||||
// graph, we still want to finish after the graph was sealed.
|
||||
_graph.sealed.listen((Null _) {
|
||||
_graph.sealed.listen((_) {
|
||||
if (!_closed && _enqueuer.remainingTestCases.isEmpty) {
|
||||
_controller.close();
|
||||
_closed = true;
|
||||
|
@ -964,8 +962,8 @@ class BatchRunnerProcess {
|
|||
|
||||
io.Process? _process;
|
||||
Map<String, String>? _processEnvironmentOverrides;
|
||||
late Completer<Null> _stdoutCompleter;
|
||||
late Completer<Null> _stderrCompleter;
|
||||
late Completer<void> _stdoutCompleter;
|
||||
late Completer<void> _stderrCompleter;
|
||||
late StreamSubscription<String> _stdoutSubscription;
|
||||
late StreamSubscription<String> _stderrSubscription;
|
||||
late Function _processExitHandler;
|
||||
|
@ -1058,7 +1056,7 @@ class BatchRunnerProcess {
|
|||
if (_useJson) {
|
||||
return "${jsonEncode(arguments)}\n";
|
||||
} else {
|
||||
return arguments.join(' ') + '\n';
|
||||
return '${arguments.join(' ')}\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -150,6 +150,7 @@ abstract class RuntimeConfiguration {
|
|||
class NoneRuntimeConfiguration extends RuntimeConfiguration {
|
||||
NoneRuntimeConfiguration() : super._subclass();
|
||||
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
@ -179,6 +180,7 @@ class D8RuntimeConfiguration extends CommandLineJavaScriptRuntime {
|
|||
|
||||
D8RuntimeConfiguration(this.compiler) : super('d8');
|
||||
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
@ -200,6 +202,7 @@ class D8RuntimeConfiguration extends CommandLineJavaScriptRuntime {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> dart2jsPreambles(Uri preambleDir) {
|
||||
return [preambleDir.resolve('d8.js').toFilePath()];
|
||||
}
|
||||
|
@ -211,6 +214,7 @@ class JsshellRuntimeConfiguration extends CommandLineJavaScriptRuntime {
|
|||
|
||||
JsshellRuntimeConfiguration(this.compiler) : super('jsshell');
|
||||
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
@ -231,6 +235,7 @@ class JsshellRuntimeConfiguration extends CommandLineJavaScriptRuntime {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
List<String> dart2jsPreambles(Uri preambleDir) {
|
||||
return ['-f', preambleDir.resolve('jsshell.js').toFilePath(), '-f'];
|
||||
}
|
||||
|
@ -262,6 +267,7 @@ class QemuConfig {
|
|||
class DartVmRuntimeConfiguration extends RuntimeConfiguration {
|
||||
DartVmRuntimeConfiguration() : super._subclass();
|
||||
|
||||
@override
|
||||
int timeoutMultiplier(
|
||||
{required Mode mode,
|
||||
bool isChecked = false,
|
||||
|
@ -304,6 +310,7 @@ class DartVmRuntimeConfiguration extends RuntimeConfiguration {
|
|||
|
||||
//// The standalone Dart VM binary, "dart" or "dart.exe".
|
||||
class StandaloneDartRuntimeConfiguration extends DartVmRuntimeConfiguration {
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
@ -344,6 +351,7 @@ class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration {
|
|||
final bool useElf;
|
||||
DartPrecompiledRuntimeConfiguration(this.useElf);
|
||||
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
@ -377,6 +385,7 @@ class DartkAdbRuntimeConfiguration extends DartVmRuntimeConfiguration {
|
|||
static const String deviceDir = '/data/local/tmp/testing';
|
||||
static const String deviceTestDir = '/data/local/tmp/testing/test';
|
||||
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
@ -407,6 +416,7 @@ class DartPrecompiledAdbRuntimeConfiguration
|
|||
final bool useElf;
|
||||
DartPrecompiledAdbRuntimeConfiguration(this.useElf);
|
||||
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
@ -430,6 +440,7 @@ class DartPrecompiledAdbRuntimeConfiguration
|
|||
|
||||
class DartkFuchsiaEmulatorRuntimeConfiguration
|
||||
extends DartVmRuntimeConfiguration {
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
@ -461,6 +472,7 @@ class DartkFuchsiaEmulatorRuntimeConfiguration
|
|||
/// migrated yet.
|
||||
// TODO(ahe): Remove this class.
|
||||
class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration {
|
||||
@override
|
||||
List<Command> computeRuntimeCommands(
|
||||
CommandArtifact? artifact,
|
||||
List<String> arguments,
|
||||
|
|
|
@ -315,6 +315,7 @@ class StaticError implements Comparable<StaticError> {
|
|||
throw UnsupportedError("ErrorSource ${source.name}");
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
var buffer = StringBuffer("StaticError(");
|
||||
buffer.write("line: $line, column: $column");
|
||||
|
@ -599,7 +600,7 @@ class _ErrorExpectationParser {
|
|||
var messageMatch = _errorMessageRestRegExp.firstMatch(nextLine);
|
||||
if (messageMatch == null) break;
|
||||
|
||||
message += "\n" + messageMatch[1]!;
|
||||
message += "\n${messageMatch[1]!}";
|
||||
_advance();
|
||||
sourceLines.add(_currentLine);
|
||||
}
|
||||
|
|
|
@ -287,8 +287,12 @@ class RunningProcess {
|
|||
command.executable.contains("SIMARM64C") ||
|
||||
command.executable.contains("SIMRISCV64");
|
||||
if (configuration.windowsSdkPath != null) {
|
||||
executable = configuration.windowsSdkPath! +
|
||||
"\\Debuggers\\${isX64 ? 'x64' : 'x86'}\\cdb.exe";
|
||||
executable = [
|
||||
configuration.windowsSdkPath!,
|
||||
'Debuggers',
|
||||
if (isX64) 'x64' else 'x86',
|
||||
'cdb.exe',
|
||||
].join('\\');
|
||||
diagnostics.add("Using $executable to print stack traces");
|
||||
} else {
|
||||
diagnostics.add("win_sdk_path not found");
|
||||
|
|
|
@ -122,7 +122,7 @@ abstract class _TestFileBase {
|
|||
}
|
||||
|
||||
var result = "$directory";
|
||||
result = concat(result, "$filenameWithoutExt");
|
||||
result = concat(result, filenameWithoutExt);
|
||||
result = concat(result, multitestKey);
|
||||
return result;
|
||||
}
|
||||
|
@ -400,8 +400,10 @@ class TestFile extends _TestFileBase {
|
|||
assert(!isMultitest || dartOptions.isEmpty);
|
||||
}
|
||||
|
||||
@override
|
||||
Path get originPath => path;
|
||||
|
||||
@override
|
||||
String get multitestKey => "";
|
||||
|
||||
final String? packages;
|
||||
|
@ -453,6 +455,7 @@ class TestFile extends _TestFileBase {
|
|||
hasStaticWarning: hasStaticWarning,
|
||||
hasSyntaxError: hasSyntaxError);
|
||||
|
||||
@override
|
||||
String toString() => """TestFile(
|
||||
packages: $packages
|
||||
environment: $environment
|
||||
|
@ -483,13 +486,20 @@ class _MultitestFile extends _TestFileBase implements TestFile {
|
|||
/// The authored test file that was split to generate this multitest.
|
||||
final TestFile _origin;
|
||||
|
||||
@override
|
||||
final String multitestKey;
|
||||
|
||||
@override
|
||||
final bool hasCompileError;
|
||||
@override
|
||||
final bool hasRuntimeError;
|
||||
@override
|
||||
final bool hasStaticWarning;
|
||||
@override
|
||||
final bool hasSyntaxError;
|
||||
@override
|
||||
bool get hasCrash => _origin.hasCrash;
|
||||
@override
|
||||
bool get isVmIntermediateLanguageTest => _origin.isVmIntermediateLanguageTest;
|
||||
|
||||
_MultitestFile(this._origin, Path path, this.multitestKey,
|
||||
|
@ -500,25 +510,40 @@ class _MultitestFile extends _TestFileBase implements TestFile {
|
|||
required this.hasSyntaxError})
|
||||
: super(_origin._suiteDirectory, path, expectedErrors);
|
||||
|
||||
@override
|
||||
Path get originPath => _origin.path;
|
||||
|
||||
@override
|
||||
String? get packages => _origin.packages;
|
||||
|
||||
@override
|
||||
List<Feature> get requirements => _origin.requirements;
|
||||
@override
|
||||
List<String> get dart2jsOptions => _origin.dart2jsOptions;
|
||||
@override
|
||||
List<String> get dart2wasmOptions => _origin.dart2wasmOptions;
|
||||
@override
|
||||
List<String> get dartOptions => _origin.dartOptions;
|
||||
@override
|
||||
List<String> get ddcOptions => _origin.ddcOptions;
|
||||
@override
|
||||
Map<String, String> get environment => _origin.environment;
|
||||
|
||||
@override
|
||||
bool get isMultitest => _origin.isMultitest;
|
||||
|
||||
@override
|
||||
List<String> get otherResources => _origin.otherResources;
|
||||
@override
|
||||
List<String> get sharedObjects => _origin.sharedObjects;
|
||||
@override
|
||||
List<String> get experiments => _origin.experiments;
|
||||
@override
|
||||
List<String> get sharedOptions => _origin.sharedOptions;
|
||||
@override
|
||||
List<List<String>> get vmOptions => _origin.vmOptions;
|
||||
|
||||
@override
|
||||
TestFile split(Path path, String multitestKey, String contents,
|
||||
{bool hasCompileError = false,
|
||||
bool hasRuntimeError = false,
|
||||
|
|
|
@ -46,8 +46,11 @@ class _ColorFormatter extends Formatter {
|
|||
|
||||
const _ColorFormatter() : super._();
|
||||
|
||||
@override
|
||||
String passed(String message) => _color(message, _green);
|
||||
@override
|
||||
String failed(String message) => _color(message, _red);
|
||||
@override
|
||||
String section(String message) => _color(message, _gray);
|
||||
|
||||
static String _color(String message, String color) =>
|
||||
|
@ -62,6 +65,7 @@ class EventListener {
|
|||
}
|
||||
|
||||
class ExitCodeSetter extends EventListener {
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
if (test.unexpectedOutput) {
|
||||
exitCode = 1;
|
||||
|
@ -88,12 +92,16 @@ class TimedProgressPrinter extends EventListener {
|
|||
"Tests running for ${(interval * timer.tick).inMinutes} minutes");
|
||||
}
|
||||
|
||||
@override
|
||||
void testAdded() => _numTests++;
|
||||
|
||||
@override
|
||||
void done(TestCase test) => _numCompleted++;
|
||||
|
||||
@override
|
||||
void allTestsKnown() => _allKnown = true;
|
||||
|
||||
@override
|
||||
void allDone() => _timer.cancel();
|
||||
}
|
||||
|
||||
|
@ -102,6 +110,7 @@ class IgnoredTestMonitor extends EventListener {
|
|||
|
||||
int countIgnored = 0;
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
if (test.lastCommandOutput.result(test) == Expectation.ignore) {
|
||||
countIgnored++;
|
||||
|
@ -116,6 +125,7 @@ class IgnoredTestMonitor extends EventListener {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {
|
||||
if (countIgnored > 0) {
|
||||
Terminal.print("Ignored $countIgnored tests due to flaky infrastructure");
|
||||
|
@ -126,6 +136,7 @@ class IgnoredTestMonitor extends EventListener {
|
|||
class UnexpectedCrashLogger extends EventListener {
|
||||
final archivedBinaries = <String, String>{};
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
if (test.unexpectedOutput &&
|
||||
test.result == Expectation.crash &&
|
||||
|
@ -207,6 +218,7 @@ class SummaryPrinter extends EventListener {
|
|||
|
||||
SummaryPrinter({this.jsonOnly = false});
|
||||
|
||||
@override
|
||||
void allTestsKnown() {
|
||||
if (jsonOnly) {
|
||||
Terminal.print("JSON:");
|
||||
|
@ -224,6 +236,7 @@ class TimingPrinter extends EventListener {
|
|||
|
||||
TimingPrinter(this._startTime);
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
for (var commandOutput in test.commandOutputs.values) {
|
||||
var command = commandOutput.command;
|
||||
|
@ -232,6 +245,7 @@ class TimingPrinter extends EventListener {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {
|
||||
var d = DateTime.now().difference(_startTime);
|
||||
Terminal.print('\n--- Total time: ${_timeString(d)} ---');
|
||||
|
@ -257,12 +271,14 @@ class TimingPrinter extends EventListener {
|
|||
class SkippedCompilationsPrinter extends EventListener {
|
||||
int _skippedCompilations = 0;
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
for (var commandOutput in test.commandOutputs.values) {
|
||||
if (commandOutput.compilationSkipped) _skippedCompilations++;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {
|
||||
if (_skippedCompilations > 0) {
|
||||
Terminal.print(
|
||||
|
@ -277,6 +293,7 @@ class TestFailurePrinter extends EventListener {
|
|||
|
||||
TestFailurePrinter([this._formatter = Formatter.normal]);
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
if (!test.unexpectedOutput) return;
|
||||
for (var line in _buildFailureOutput(test, _formatter)) {
|
||||
|
@ -293,6 +310,7 @@ class ResultCountPrinter extends EventListener {
|
|||
|
||||
ResultCountPrinter(this._formatter);
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
if (test.unexpectedOutput) {
|
||||
_failedTests++;
|
||||
|
@ -301,6 +319,7 @@ class ResultCountPrinter extends EventListener {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {
|
||||
var suffix = _passedTests != 1 ? 's' : '';
|
||||
var passed =
|
||||
|
@ -324,12 +343,14 @@ class FailedTestsPrinter extends EventListener {
|
|||
|
||||
FailedTestsPrinter();
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
if (test.unexpectedOutput) {
|
||||
_failedTests.add(test);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {
|
||||
if (_failedTests.isEmpty) return;
|
||||
|
||||
|
@ -351,6 +372,7 @@ class PassingStdoutPrinter extends EventListener {
|
|||
|
||||
PassingStdoutPrinter([this._formatter = Formatter.normal]);
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
if (!test.unexpectedOutput) {
|
||||
var lines = <String>[];
|
||||
|
@ -367,6 +389,7 @@ class PassingStdoutPrinter extends EventListener {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {}
|
||||
}
|
||||
|
||||
|
@ -396,10 +419,12 @@ abstract class ProgressIndicator extends EventListener {
|
|||
throw "unreachable";
|
||||
}
|
||||
|
||||
@override
|
||||
void testAdded() {
|
||||
_foundTests++;
|
||||
}
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
if (test.unexpectedOutput) {
|
||||
_failedTests++;
|
||||
|
@ -409,6 +434,7 @@ abstract class ProgressIndicator extends EventListener {
|
|||
_printDoneProgress(test);
|
||||
}
|
||||
|
||||
@override
|
||||
void allTestsKnown() {
|
||||
_allTestsKnown = true;
|
||||
}
|
||||
|
@ -428,6 +454,7 @@ class CompactProgressIndicator extends CompactIndicator {
|
|||
CompactProgressIndicator(DateTime startTime, this._formatter)
|
||||
: super(startTime);
|
||||
|
||||
@override
|
||||
void _printDoneProgress(TestCase test) {
|
||||
var percent = ((_completedTests / _foundTests) * 100).toInt().toString();
|
||||
var progressPadded = (_allTestsKnown ? percent : '--').padLeft(3);
|
||||
|
@ -440,6 +467,7 @@ class CompactProgressIndicator extends CompactIndicator {
|
|||
Terminal.writeLine(progressLine);
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {
|
||||
Terminal.finishLine();
|
||||
}
|
||||
|
@ -448,6 +476,7 @@ class CompactProgressIndicator extends CompactIndicator {
|
|||
class LineProgressIndicator extends ProgressIndicator {
|
||||
LineProgressIndicator(DateTime startTime) : super(startTime);
|
||||
|
||||
@override
|
||||
void _printDoneProgress(TestCase test) {
|
||||
var status = 'pass';
|
||||
if (test.unexpectedOutput) {
|
||||
|
@ -463,6 +492,7 @@ class BuildbotProgressIndicator extends ProgressIndicator {
|
|||
|
||||
BuildbotProgressIndicator(DateTime startTime) : super(startTime);
|
||||
|
||||
@override
|
||||
void _printDoneProgress(TestCase test) {
|
||||
var status = 'pass';
|
||||
if (test.unexpectedOutput) {
|
||||
|
@ -475,6 +505,7 @@ class BuildbotProgressIndicator extends ProgressIndicator {
|
|||
Terminal.print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@');
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {
|
||||
if (_failedTests == 0) return;
|
||||
Terminal.print('@@@STEP_FAILURE@@@');
|
||||
|
@ -639,6 +670,7 @@ class ResultWriter extends EventListener {
|
|||
Directory(_outputDirectory).createSync(recursive: true);
|
||||
}
|
||||
|
||||
@override
|
||||
void allTestsKnown() {
|
||||
// Write an empty result log file, that will be overwritten if any tests
|
||||
// are actually run, when the allDone event handler is invoked.
|
||||
|
@ -647,8 +679,9 @@ class ResultWriter extends EventListener {
|
|||
}
|
||||
|
||||
String newlineTerminated(Iterable<String> lines) =>
|
||||
lines.map((l) => l + '\n').join();
|
||||
lines.map((l) => '$l\n').join();
|
||||
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
var name = test.displayName;
|
||||
var index = name.indexOf('/');
|
||||
|
@ -680,6 +713,7 @@ class ResultWriter extends EventListener {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void allDone() {
|
||||
writeOutputFile(_results, TestUtils.resultsFileName);
|
||||
writeOutputFile(_logs, TestUtils.logsFileName);
|
||||
|
|
|
@ -60,7 +60,7 @@ abstract class TestSuite {
|
|||
if (Platform.isWindows) 'DART_SUPPRESS_WER': '1',
|
||||
if (Platform.isWindows && configuration.copyCoreDumps)
|
||||
'DART_CRASHPAD_HANDLER': Uri.base
|
||||
.resolve(configuration.buildDirectory + '/crashpad_handler.exe')
|
||||
.resolve('${configuration.buildDirectory}/crashpad_handler.exe')
|
||||
.toFilePath(),
|
||||
if (configuration.chromePath != null)
|
||||
'CHROME_PATH':
|
||||
|
@ -289,6 +289,7 @@ class VMTestSuite extends TestSuite {
|
|||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void findTestCases(TestCaseEvent onTest, Map testCache) {
|
||||
var statusFiles =
|
||||
statusFilePaths.map((statusFile) => "$dartDir/$statusFile").toList();
|
||||
|
@ -426,6 +427,7 @@ class FfiTestSuite extends TestSuite {
|
|||
'$buildDir/run_ffi_unit_tests_$config$binarySuffix'));
|
||||
}
|
||||
|
||||
@override
|
||||
void findTestCases(TestCaseEvent onTest, Map testCache) {
|
||||
final statusFiles =
|
||||
statusFilePaths.map((statusFile) => "$dartDir/$statusFile").toList();
|
||||
|
@ -628,6 +630,7 @@ class StandardTestSuite extends TestSuite {
|
|||
|
||||
List<String> additionalOptions(Path? filePath) => [];
|
||||
|
||||
@override
|
||||
void findTestCases(
|
||||
TestCaseEvent onTest, Map<String, List<TestFile>> testCache) {
|
||||
var expectations = _readExpectations();
|
||||
|
@ -789,7 +792,7 @@ class StandardTestSuite extends TestSuite {
|
|||
commonArguments,
|
||||
isCrashExpected);
|
||||
var variantTestName =
|
||||
testFile.name + '/${emitDdsTest ? 'dds' : 'service'}';
|
||||
'${testFile.name}/${emitDdsTest ? 'dds' : 'service'}';
|
||||
if (vmOptionsList.length > 1) {
|
||||
variantTestName = "${variantTestName}_$vmOptionsVariant";
|
||||
}
|
||||
|
@ -1053,6 +1056,7 @@ class PackageTestSuite extends StandardTestSuite {
|
|||
["$directoryPath/.status"],
|
||||
recursive: true);
|
||||
|
||||
@override
|
||||
void _enqueueBrowserTest(
|
||||
TestFile testFile, Set<Expectation> expectations, TestCaseEvent onTest) {
|
||||
var dir = testFile.path.directoryPath;
|
||||
|
@ -1075,15 +1079,18 @@ class AnalyzeLibraryTestSuite extends StandardTestSuite {
|
|||
? '${configuration.buildDirectory}/dart-sdk'
|
||||
: 'sdk');
|
||||
|
||||
@override
|
||||
bool get listRecursively => true;
|
||||
|
||||
AnalyzeLibraryTestSuite(TestConfiguration configuration)
|
||||
: super(configuration, 'analyze_library', _libraryPath(configuration),
|
||||
['tests/lib_2/analyzer/analyze_library.status']);
|
||||
|
||||
@override
|
||||
List<String> additionalOptions(Path? filePath, {bool? showSdkWarnings}) =>
|
||||
const ['--fatal-warnings', '--fatal-type-errors', '--sdk-warnings'];
|
||||
|
||||
@override
|
||||
Iterable<TestFile> findTests() {
|
||||
var dir = Directory(suiteDir.append('lib').toNativePath());
|
||||
if (dir.existsSync()) {
|
||||
|
@ -1093,6 +1100,7 @@ class AnalyzeLibraryTestSuite extends StandardTestSuite {
|
|||
return const [];
|
||||
}
|
||||
|
||||
@override
|
||||
bool isTestFile(String filename) {
|
||||
// NOTE: We exclude tests and patch files for now.
|
||||
return filename.endsWith(".dart") &&
|
||||
|
|
|
@ -13,15 +13,15 @@ import 'package:test_runner/src/repository.dart';
|
|||
import 'package:test_runner/src/utils.dart';
|
||||
|
||||
class DispatchingServer {
|
||||
HttpServer server;
|
||||
final HttpServer server;
|
||||
final Map<String, Function> _handlers = {};
|
||||
final void Function(HttpRequest request) _notFound;
|
||||
|
||||
DispatchingServer(this.server, void onError(e), this._notFound) {
|
||||
DispatchingServer(this.server, Function? onError, this._notFound) {
|
||||
server.listen(_dispatchRequest, onError: onError);
|
||||
}
|
||||
|
||||
void addHandler(String prefix, void handler(HttpRequest request)) {
|
||||
void addHandler(String prefix, void Function(HttpRequest request) handler) {
|
||||
_handlers[prefix] = handler;
|
||||
}
|
||||
|
||||
|
@ -434,6 +434,7 @@ class _Entry implements Comparable<_Entry> {
|
|||
|
||||
_Entry(this.name, this.displayName);
|
||||
|
||||
@override
|
||||
int compareTo(_Entry other) {
|
||||
return name.compareTo(other.name);
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ String updateErrorExpectations(String source, List<StaticError> errors,
|
|||
// If the error is to the left of the indent and the "//", sacrifice the
|
||||
// indentation.
|
||||
if (error.column - 1 < indent + 2) indent = 0;
|
||||
var comment = (" " * indent) + "//";
|
||||
var comment = "${" " * indent}//";
|
||||
|
||||
// Write the location line, unless we already have an identical one. Allow
|
||||
// sharing locations between errors with and without explicit lengths.
|
||||
|
|
|
@ -180,6 +180,7 @@ class NoResultsForCommitException implements Exception {
|
|||
|
||||
NoResultsForCommitException(this.reason);
|
||||
|
||||
@override
|
||||
String toString() => reason;
|
||||
}
|
||||
|
||||
|
@ -523,14 +524,14 @@ Future<void> runTests(List<String> args) async {
|
|||
// Write out the merged results for the builders.
|
||||
if (needsMerge || needsConfigurationOverride) {
|
||||
await File("${outDirectory.path}/previous.json").writeAsString(
|
||||
mergedResults.values.map((data) => jsonEncode(data) + "\n").join(""));
|
||||
mergedResults.values.map((data) => "${jsonEncode(data)}\n").join(""));
|
||||
}
|
||||
// Ensure that there is a flaky.json even if it wasn't downloaded.
|
||||
if (needsMerge ||
|
||||
needsConfigurationOverride ||
|
||||
options["report-flakes"] as bool) {
|
||||
await File("${outDirectory.path}/flaky.json").writeAsString(
|
||||
mergedFlaky.values.map((data) => jsonEncode(data) + "\n").join(""));
|
||||
mergedFlaky.values.map((data) => "${jsonEncode(data)}\n").join(""));
|
||||
}
|
||||
// Deflake results of the tests if required.
|
||||
if (options["deflake"] as bool) {
|
||||
|
|
|
@ -37,7 +37,10 @@ void main() async {
|
|||
}
|
||||
|
||||
class FakeBrowser extends Browser {
|
||||
@override
|
||||
Future<bool> start(String url) => Future.value(true);
|
||||
@override
|
||||
Future<bool> close() => Future.value(true);
|
||||
@override
|
||||
Future<String> version = Future.value('fake version');
|
||||
}
|
||||
|
|
|
@ -145,10 +145,11 @@ Command makeCompilationCommand(String testName, FileUtils fileUtils) {
|
|||
.resolve('skipping_dart2js_compilations_helper.dart')
|
||||
.toFilePath();
|
||||
var executable = Platform.executable;
|
||||
var arguments = <String>[]
|
||||
..addAll(Platform.executableArguments)
|
||||
..add(createFileScript)
|
||||
..add(fileUtils.scriptOutputPath.toNativePath());
|
||||
var arguments = [
|
||||
...Platform.executableArguments,
|
||||
createFileScript,
|
||||
fileUtils.scriptOutputPath.toNativePath(),
|
||||
];
|
||||
var bootstrapDeps = [Uri.parse("file://${fileUtils.testSnapshotFilePath}")];
|
||||
return CompilationCommand('dart2js', fileUtils.testJsFilePath.toNativePath(),
|
||||
bootstrapDeps, executable, arguments, {},
|
||||
|
|
|
@ -67,6 +67,7 @@ class CustomTestSuite extends TestSuite {
|
|||
CustomTestSuite(TestConfiguration configuration)
|
||||
: super(configuration, "CustomTestSuite", []);
|
||||
|
||||
@override
|
||||
void findTestCases(TestCaseEvent onTest, Map testCache) {
|
||||
void enqueueTestCase(TestCase testCase) {
|
||||
TestController.numTests++;
|
||||
|
@ -116,6 +117,7 @@ void testProcessQueue() {
|
|||
}
|
||||
|
||||
class EventListener extends progress.EventListener {
|
||||
@override
|
||||
void done(TestCase test) {
|
||||
TestController.processCompletedTest(test);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ const staticOutcomes = [
|
|||
class UnableToConvertException {
|
||||
final String message;
|
||||
UnableToConvertException(this.message);
|
||||
@override
|
||||
String toString() => "unable to convert: $message";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue