provide command to FakeCommand::onRun
(#142206)
Part of work on [#101077](https://github.com/flutter/flutter/pull/141194). This is done as a separate PR to avoid a massive diff. ## Context 1. The `FakeCommand` class accepts a list of patterns that's used to match a command given to its `FakeProcessManager`. Since `FakeCommand` can match a list of patterns, not just specifically strings, it can be used to match commands where the exact value of some arguments can't (easily) known ahead of time. For example, a part of the tool may invoke a command with an argument that is the path of a temporarily file that has a randomly-generated basename. 2. The `FakeCommand` class provides on `onRun` parameter, which is a callback that is run when the `FakeProcessManager` runs a command that matches the `FakeCommand` in question. ## Issue In the event that a `FakeCommand` is constructed using patterns, the test code can't know the exact values used for arguments in the command. This PR proposes changing the type of `onRun` from `VoidCallback?` to `void Function(List<String>)?`. When run, the value `List<String>` parameter will be the full command that the `FakeCommand` matched. Example: ```dart FakeCommand( command: <Pattern>[ artifacts.getArtifactPath(Artifact.engineDartBinary), 'run', 'vector_graphics_compiler', RegExp(r'--input=/.*\.temp'), RegExp(r'--output=/.*\.temp'), ], onRun: (List<String> command) { final outputPath = (() { // code to parse `--output` from `command` })(); testFileSystem.file(outputPath).createSync(recursive: true); }, ) ```
This commit is contained in:
parent
535ce79a99
commit
295a9a2031
@ -151,7 +151,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: const <String>['git', 'checkout', workingBranch],
|
command: const <String>['git', 'checkout', workingBranch],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
final File file = fileSystem.file('$checkoutsParentDirectory/engine/.ci.yaml')
|
final File file = fileSystem.file('$checkoutsParentDirectory/engine/.ci.yaml')
|
||||||
..createSync(recursive: true);
|
..createSync(recursive: true);
|
||||||
_initializeCiYamlFile(file);
|
_initializeCiYamlFile(file);
|
||||||
@ -402,7 +402,7 @@ void main() {
|
|||||||
const FakeCommand(command: <String>['git', 'fetch', 'upstream']),
|
const FakeCommand(command: <String>['git', 'fetch', 'upstream']),
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: const <String>['git', 'checkout', workingBranch],
|
command: const <String>['git', 'checkout', workingBranch],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
final File file = fileSystem.file('$checkoutsParentDirectory/framework/.ci.yaml')
|
final File file = fileSystem.file('$checkoutsParentDirectory/framework/.ci.yaml')
|
||||||
..createSync();
|
..createSync();
|
||||||
_initializeCiYamlFile(file);
|
_initializeCiYamlFile(file);
|
||||||
@ -504,7 +504,7 @@ void main() {
|
|||||||
const FakeCommand(command: <String>['git', 'fetch', 'upstream']),
|
const FakeCommand(command: <String>['git', 'fetch', 'upstream']),
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: const <String>['git', 'checkout', workingBranch],
|
command: const <String>['git', 'checkout', workingBranch],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
final File file = fileSystem.file('$checkoutsParentDirectory/framework/.ci.yaml')
|
final File file = fileSystem.file('$checkoutsParentDirectory/framework/.ci.yaml')
|
||||||
..createSync();
|
..createSync();
|
||||||
_initializeCiYamlFile(file);
|
_initializeCiYamlFile(file);
|
||||||
@ -600,7 +600,7 @@ void main() {
|
|||||||
// we want merged upstream commit, not local working commit
|
// we want merged upstream commit, not local working commit
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: const <String>['git', 'checkout', 'upstream/$candidateBranch'],
|
command: const <String>['git', 'checkout', 'upstream/$candidateBranch'],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
final File file = fileSystem.file('$checkoutsParentDirectory/framework/.ci.yaml')
|
final File file = fileSystem.file('$checkoutsParentDirectory/framework/.ci.yaml')
|
||||||
..createSync();
|
..createSync();
|
||||||
_initializeCiYamlFile(file);
|
_initializeCiYamlFile(file);
|
||||||
@ -686,7 +686,7 @@ void main() {
|
|||||||
const FakeCommand(command: <String>['git', 'fetch', 'upstream']),
|
const FakeCommand(command: <String>['git', 'fetch', 'upstream']),
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: const <String>['git', 'checkout', workingBranch],
|
command: const <String>['git', 'checkout', workingBranch],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
final File file = fileSystem.file('$checkoutsParentDirectory/framework/.ci.yaml')
|
final File file = fileSystem.file('$checkoutsParentDirectory/framework/.ci.yaml')
|
||||||
..createSync();
|
..createSync();
|
||||||
_initializeCiYamlFile(file);
|
_initializeCiYamlFile(file);
|
||||||
|
@ -254,7 +254,7 @@ vars = {
|
|||||||
]),
|
]),
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: const <String>['git', 'checkout', candidateBranch, '--'],
|
command: const <String>['git', 'checkout', candidateBranch, '--'],
|
||||||
onRun: () => createdCandidateBranch = true,
|
onRun: (_) => createdCandidateBranch = true,
|
||||||
),
|
),
|
||||||
const FakeCommand(
|
const FakeCommand(
|
||||||
command: <String>['git', 'checkout', 'stable', '--'],
|
command: <String>['git', 'checkout', 'stable', '--'],
|
||||||
@ -309,7 +309,7 @@ vars = {
|
|||||||
]),
|
]),
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: const <String>['git', 'checkout', candidateBranch, '--'],
|
command: const <String>['git', 'checkout', candidateBranch, '--'],
|
||||||
onRun: () => createdCandidateBranch = true,
|
onRun: (_) => createdCandidateBranch = true,
|
||||||
),
|
),
|
||||||
const FakeCommand(
|
const FakeCommand(
|
||||||
command: <String>['git', 'checkout', EngineRepository.defaultBranch],
|
command: <String>['git', 'checkout', EngineRepository.defaultBranch],
|
||||||
|
@ -159,7 +159,7 @@ void main() {
|
|||||||
EngineRepository.defaultUpstream,
|
EngineRepository.defaultUpstream,
|
||||||
engine.path,
|
engine.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
// Create the DEPS file which the tool will update
|
// Create the DEPS file which the tool will update
|
||||||
engine.createSync(recursive: true);
|
engine.createSync(recursive: true);
|
||||||
depsFile
|
depsFile
|
||||||
@ -368,7 +368,7 @@ void main() {
|
|||||||
EngineRepository.defaultUpstream,
|
EngineRepository.defaultUpstream,
|
||||||
engine.path,
|
engine.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
// Create the DEPS file which the tool will update
|
// Create the DEPS file which the tool will update
|
||||||
engine.createSync(recursive: true);
|
engine.createSync(recursive: true);
|
||||||
depsFile
|
depsFile
|
||||||
@ -554,7 +554,7 @@ void main() {
|
|||||||
EngineRepository.defaultUpstream,
|
EngineRepository.defaultUpstream,
|
||||||
engine.path,
|
engine.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
// Create the DEPS file which the tool will update
|
// Create the DEPS file which the tool will update
|
||||||
engine.createSync(recursive: true);
|
engine.createSync(recursive: true);
|
||||||
depsFile
|
depsFile
|
||||||
@ -763,7 +763,7 @@ void main() {
|
|||||||
EngineRepository.defaultUpstream,
|
EngineRepository.defaultUpstream,
|
||||||
engine.path,
|
engine.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
// Create the DEPS file which the tool will update
|
// Create the DEPS file which the tool will update
|
||||||
engine.createSync(recursive: true);
|
engine.createSync(recursive: true);
|
||||||
depsFile
|
depsFile
|
||||||
@ -972,7 +972,7 @@ void main() {
|
|||||||
EngineRepository.defaultUpstream,
|
EngineRepository.defaultUpstream,
|
||||||
engine.path,
|
engine.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
// Create the DEPS file which the tool will update
|
// Create the DEPS file which the tool will update
|
||||||
engine.createSync(recursive: true);
|
engine.createSync(recursive: true);
|
||||||
depsFile
|
depsFile
|
||||||
|
@ -403,7 +403,7 @@ void main() {
|
|||||||
'flutter,Dart,${apidocs.kPlatformIntegrationPackageName},flutter_test,flutter_driver',
|
'flutter,Dart,${apidocs.kPlatformIntegrationPackageName},flutter_test,flutter_driver',
|
||||||
'--auto-include-dependencies',
|
'--auto-include-dependencies',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
for (final File canary in generator.canaries) {
|
for (final File canary in generator.canaries) {
|
||||||
canary.createSync(recursive: true);
|
canary.createSync(recursive: true);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ flutter:
|
|||||||
...List<RegExp>.filled(5, RegExp(r'-P[a-zA-Z-]+=.*')),
|
...List<RegExp>.filled(5, RegExp(r'-P[a-zA-Z-]+=.*')),
|
||||||
'assembleAar$buildMode',
|
'assembleAar$buildMode',
|
||||||
],
|
],
|
||||||
onRun: () => fs.directory('/build/host/outputs/repo').createSync(recursive: true),
|
onRun: (_) => fs.directory('/build/host/outputs/repo').createSync(recursive: true),
|
||||||
)),
|
)),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ void main() {
|
|||||||
'xattr', '-r', '-d', 'com.apple.FinderInfo', '/',
|
'xattr', '-r', '-d', 'com.apple.FinderInfo', '/',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
FakeCommand setUpRsyncCommand({void Function()? onRun}) {
|
FakeCommand setUpRsyncCommand({void Function(List<String> command)? onRun}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
command: const <String>[
|
command: const <String>[
|
||||||
'rsync',
|
'rsync',
|
||||||
@ -131,7 +131,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FakeCommand setUpXCResultCommand({String stdout = '', void Function()? onRun}) {
|
FakeCommand setUpXCResultCommand({String stdout = '', void Function(List<String> command)? onRun}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
command: const <String>[
|
command: const <String>[
|
||||||
'xcrun',
|
'xcrun',
|
||||||
@ -157,7 +157,7 @@ void main() {
|
|||||||
String? deviceId,
|
String? deviceId,
|
||||||
int exitCode = 0,
|
int exitCode = 0,
|
||||||
String? stdout,
|
String? stdout,
|
||||||
void Function()? onRun,
|
void Function(List<String> command)? onRun,
|
||||||
}) {
|
}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
command: <String>[
|
command: <String>[
|
||||||
@ -296,7 +296,7 @@ void main() {
|
|||||||
|
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
setUpRsyncCommand(),
|
setUpRsyncCommand(),
|
||||||
@ -335,7 +335,7 @@ void main() {
|
|||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
disablePortPublication: true,
|
disablePortPublication: true,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -366,7 +366,7 @@ void main() {
|
|||||||
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -389,7 +389,7 @@ void main() {
|
|||||||
|
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(customNaming: true, onRun: () {
|
setUpFakeXcodeBuildHandler(customNaming: true, onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
setUpRsyncCommand(),
|
setUpRsyncCommand(),
|
||||||
@ -423,7 +423,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(deviceId: '1234', onRun: () {
|
setUpFakeXcodeBuildHandler(deviceId: '1234', onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
setUpRsyncCommand(),
|
setUpRsyncCommand(),
|
||||||
@ -453,7 +453,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(simulator: true, onRun: () {
|
setUpFakeXcodeBuildHandler(simulator: true, onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Debug-iphonesimulator/Runner.app').createSync(recursive: true);
|
fileSystem.directory('build/ios/Debug-iphonesimulator/Runner.app').createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
setUpRsyncCommand(),
|
setUpRsyncCommand(),
|
||||||
@ -483,7 +483,7 @@ void main() {
|
|||||||
createMinimalMockProjectFiles();
|
createMinimalMockProjectFiles();
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(verbose: true, onRun: () {
|
setUpFakeXcodeBuildHandler(verbose: true, onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
setUpRsyncCommand(),
|
setUpRsyncCommand(),
|
||||||
@ -511,7 +511,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true);
|
||||||
fileSystem.file('build/flutter_size_01/snapshot.arm64.json')
|
fileSystem.file('build/flutter_size_01/snapshot.arm64.json')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
@ -528,7 +528,7 @@ void main() {
|
|||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('{}');
|
..writeAsStringSync('{}');
|
||||||
}),
|
}),
|
||||||
setUpRsyncCommand(onRun: () => fileSystem.file('build/ios/iphoneos/Runner.app/Frameworks/App.framework/App')
|
setUpRsyncCommand(onRun: (_) => fileSystem.file('build/ios/iphoneos/Runner.app/Frameworks/App.framework/App')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0))),
|
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0))),
|
||||||
]);
|
]);
|
||||||
@ -609,11 +609,11 @@ void main() {
|
|||||||
FileSystem: () => fileSystem,
|
FileSystem: () => fileSystem,
|
||||||
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app')
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app')
|
||||||
.createSync(recursive: true);
|
.createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
setUpRsyncCommand(onRun: () =>
|
setUpRsyncCommand(onRun: (_) =>
|
||||||
fileSystem.file('build/ios/iphoneos/Runner.app/Frameworks/App.framework/App')
|
fileSystem.file('build/ios/iphoneos/Runner.app/Frameworks/App.framework/App')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0))),
|
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0))),
|
||||||
@ -672,11 +672,11 @@ void main() {
|
|||||||
FileSystem: () => fileSystem,
|
FileSystem: () => fileSystem,
|
||||||
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.directory('build/ios/Release-iphoneos/Runner.app')
|
fileSystem.directory('build/ios/Release-iphoneos/Runner.app')
|
||||||
.createSync(recursive: true);
|
.createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
setUpRsyncCommand(onRun: () =>
|
setUpRsyncCommand(onRun: (_) =>
|
||||||
fileSystem.file('build/ios/iphoneos/Runner.app/Frameworks/App.framework/App')
|
fileSystem.file('build/ios/iphoneos/Runner.app/Frameworks/App.framework/App')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0))),
|
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0))),
|
||||||
@ -716,7 +716,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}),
|
}),
|
||||||
setUpXCResultCommand(),
|
setUpXCResultCommand(),
|
||||||
@ -751,7 +751,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}, stdout: 'Lots of spew from Xcode',
|
}, stdout: 'Lots of spew from Xcode',
|
||||||
),
|
),
|
||||||
@ -790,7 +790,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}),
|
}),
|
||||||
setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded),
|
setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded),
|
||||||
@ -860,7 +860,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}),
|
}),
|
||||||
setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue),
|
setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue),
|
||||||
@ -901,7 +901,7 @@ void main() {
|
|||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -938,7 +938,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}),
|
}),
|
||||||
setUpXCResultCommand(stdout: kSampleResultJsonWithActionIssues),
|
setUpXCResultCommand(stdout: kSampleResultJsonWithActionIssues),
|
||||||
@ -977,13 +977,13 @@ void main() {
|
|||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
stdout: '$kConcurrentRunFailureMessage1 $kConcurrentRunFailureMessage2',
|
stdout: '$kConcurrentRunFailureMessage1 $kConcurrentRunFailureMessage2',
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).childFile('result.xcresult').createSync(recursive: true);
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).childFile('result.xcresult').createSync(recursive: true);
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
// The second xcodebuild is triggered due to above concurrent run failure message.
|
// The second xcodebuild is triggered due to above concurrent run failure message.
|
||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
// If the file is not cleaned, throw an error, test failure.
|
// If the file is not cleaned, throw an error, test failure.
|
||||||
if (fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).existsSync()) {
|
if (fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).existsSync()) {
|
||||||
throwToolExit('xcresult bundle file existed.', exitCode: 2);
|
throwToolExit('xcresult bundle file existed.', exitCode: 2);
|
||||||
@ -1025,7 +1025,7 @@ void main() {
|
|||||||
stdout: '''
|
stdout: '''
|
||||||
Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor
|
Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor
|
||||||
''',
|
''',
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -1063,7 +1063,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
|
|||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -1115,7 +1115,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
|
|||||||
stdout: '''
|
stdout: '''
|
||||||
Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor
|
Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor
|
||||||
''',
|
''',
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -1141,7 +1141,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
|
|||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -1178,7 +1178,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
|
|||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -1217,7 +1217,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
|
|||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -1259,7 +1259,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
|
|||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
simulator: true,
|
simulator: true,
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -1298,7 +1298,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
|
|||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
simulator: true,
|
simulator: true,
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -1339,7 +1339,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
|
|||||||
setUpFakeXcodeBuildHandler(
|
setUpFakeXcodeBuildHandler(
|
||||||
simulator: true,
|
simulator: true,
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -137,7 +137,7 @@ void main() {
|
|||||||
'xattr', '-r', '-d', 'com.apple.FinderInfo', '/',
|
'xattr', '-r', '-d', 'com.apple.FinderInfo', '/',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
FakeCommand setUpXCResultCommand({String stdout = '', void Function()? onRun}) {
|
FakeCommand setUpXCResultCommand({String stdout = '', void Function(List<String> command)? onRun}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
command: const <String>[
|
command: const <String>[
|
||||||
'xcrun',
|
'xcrun',
|
||||||
@ -155,7 +155,11 @@ void main() {
|
|||||||
|
|
||||||
// Creates a FakeCommand for the xcodebuild call to build the app
|
// Creates a FakeCommand for the xcodebuild call to build the app
|
||||||
// in the given configuration.
|
// in the given configuration.
|
||||||
FakeCommand setUpFakeXcodeBuildHandler({ bool verbose = false, int exitCode = 0, void Function()? onRun }) {
|
FakeCommand setUpFakeXcodeBuildHandler({
|
||||||
|
bool verbose = false,
|
||||||
|
int exitCode = 0,
|
||||||
|
void Function(List<String> args)? onRun,
|
||||||
|
}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
command: <String>[
|
command: <String>[
|
||||||
'xcrun',
|
'xcrun',
|
||||||
@ -202,7 +206,7 @@ void main() {
|
|||||||
'-exportOptionsPlist',
|
'-exportOptionsPlist',
|
||||||
exportOptionsPlist,
|
exportOptionsPlist,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
// exportOptionsPlist will be cleaned up within the command.
|
// exportOptionsPlist will be cleaned up within the command.
|
||||||
// Save it somewhere else so test expectations can be run on it.
|
// Save it somewhere else so test expectations can be run on it.
|
||||||
if (cachePlist != null) {
|
if (cachePlist != null) {
|
||||||
@ -840,7 +844,7 @@ void main() {
|
|||||||
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0));
|
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0));
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file('build/flutter_size_01/snapshot.arm64.json')
|
fileSystem.file('build/flutter_size_01/snapshot.arm64.json')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
@ -936,7 +940,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
|
||||||
}),
|
}),
|
||||||
setUpXCResultCommand(),
|
setUpXCResultCommand(),
|
||||||
@ -970,7 +974,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
|
||||||
}),
|
}),
|
||||||
setUpXCResultCommand(stdout: kSampleResultJsonWithIssues),
|
setUpXCResultCommand(stdout: kSampleResultJsonWithIssues),
|
||||||
@ -1005,7 +1009,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
|
||||||
}),
|
}),
|
||||||
setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded),
|
setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded),
|
||||||
@ -1074,7 +1078,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
|
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
|
||||||
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
|
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
|
||||||
}),
|
}),
|
||||||
setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue),
|
setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue),
|
||||||
@ -1106,7 +1110,7 @@ void main() {
|
|||||||
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(plistPath).createSync(recursive: true);
|
fileSystem.file(plistPath).createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
||||||
@ -1159,7 +1163,7 @@ void main() {
|
|||||||
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(plistPath).createSync(recursive: true);
|
fileSystem.file(plistPath).createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
||||||
@ -1218,7 +1222,7 @@ void main() {
|
|||||||
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(plistPath).createSync(recursive: true);
|
fileSystem.file(plistPath).createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
||||||
@ -1277,7 +1281,7 @@ void main() {
|
|||||||
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(plistPath).createSync(recursive: true);
|
fileSystem.file(plistPath).createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
||||||
@ -1320,7 +1324,7 @@ void main() {
|
|||||||
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(plistPath).createSync(recursive: true);
|
fileSystem.file(plistPath).createSync(recursive: true);
|
||||||
}),
|
}),
|
||||||
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
||||||
@ -1366,7 +1370,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(templateIconContentsJsonPath)
|
fileSystem.file(templateIconContentsJsonPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
@ -1448,7 +1452,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(templateIconContentsJsonPath)
|
fileSystem.file(templateIconContentsJsonPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
@ -1528,7 +1532,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(projectIconContentsJsonPath)
|
fileSystem.file(projectIconContentsJsonPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
@ -1590,7 +1594,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(projectIconContentsJsonPath)
|
fileSystem.file(projectIconContentsJsonPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
@ -1653,7 +1657,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(projectIconContentsJsonPath)
|
fileSystem.file(projectIconContentsJsonPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
@ -1715,7 +1719,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
// Uses unknown format version 123.
|
// Uses unknown format version 123.
|
||||||
fileSystem.file(projectIconContentsJsonPath)
|
fileSystem.file(projectIconContentsJsonPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
@ -1787,7 +1791,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
// The following json contains examples of:
|
// The following json contains examples of:
|
||||||
// - invalid size
|
// - invalid size
|
||||||
// - invalid scale
|
// - invalid scale
|
||||||
@ -1892,7 +1896,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(templateLaunchImageContentsJsonPath)
|
fileSystem.file(templateLaunchImageContentsJsonPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
@ -1973,7 +1977,7 @@ void main() {
|
|||||||
|
|
||||||
fakeProcessManager.addCommands(<FakeCommand>[
|
fakeProcessManager.addCommands(<FakeCommand>[
|
||||||
xattrCommand,
|
xattrCommand,
|
||||||
setUpFakeXcodeBuildHandler(onRun: () {
|
setUpFakeXcodeBuildHandler(onRun: (_) {
|
||||||
fileSystem.file(templateLaunchImageContentsJsonPath)
|
fileSystem.file(templateLaunchImageContentsJsonPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
|
@ -90,7 +90,7 @@ void main() {
|
|||||||
// Returns the command matching the build_linux call to cmake.
|
// Returns the command matching the build_linux call to cmake.
|
||||||
FakeCommand cmakeCommand(String buildMode, {
|
FakeCommand cmakeCommand(String buildMode, {
|
||||||
String target = 'x64',
|
String target = 'x64',
|
||||||
void Function()? onRun,
|
void Function(List<String> command)? onRun,
|
||||||
}) {
|
}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
command: <String>[
|
command: <String>[
|
||||||
@ -110,7 +110,7 @@ void main() {
|
|||||||
FakeCommand ninjaCommand(String buildMode, {
|
FakeCommand ninjaCommand(String buildMode, {
|
||||||
Map<String, String>? environment,
|
Map<String, String>? environment,
|
||||||
String target = 'x64',
|
String target = 'x64',
|
||||||
void Function()? onRun,
|
void Function(List<String> command)? onRun,
|
||||||
String stdout = '',
|
String stdout = '',
|
||||||
}) {
|
}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
@ -279,7 +279,7 @@ void main() {
|
|||||||
setUpMockProjectFilesForBuild();
|
setUpMockProjectFilesForBuild();
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
cmakeCommand('release'),
|
cmakeCommand('release'),
|
||||||
ninjaCommand('release', onRun: () {
|
ninjaCommand('release', onRun: (_) {
|
||||||
throw ArgumentError();
|
throw ArgumentError();
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
@ -694,7 +694,7 @@ set(BINARY_NAME "fizz_bar")
|
|||||||
setUpMockProjectFilesForBuild();
|
setUpMockProjectFilesForBuild();
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
cmakeCommand('release'),
|
cmakeCommand('release'),
|
||||||
ninjaCommand('release', onRun: () {
|
ninjaCommand('release', onRun: (_) {
|
||||||
fileSystem.file('build/flutter_size_01/snapshot.linux-x64.json')
|
fileSystem.file('build/flutter_size_01/snapshot.linux-x64.json')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
@ -751,7 +751,7 @@ set(BINARY_NAME "fizz_bar")
|
|||||||
setUpMockProjectFilesForBuild();
|
setUpMockProjectFilesForBuild();
|
||||||
processManager.addCommands(<FakeCommand>[
|
processManager.addCommands(<FakeCommand>[
|
||||||
cmakeCommand('release', target: 'arm64'),
|
cmakeCommand('release', target: 'arm64'),
|
||||||
ninjaCommand('release', target: 'arm64', onRun: () {
|
ninjaCommand('release', target: 'arm64', onRun: (_) {
|
||||||
fileSystem.file('build/flutter_size_01/snapshot.linux-arm64.json')
|
fileSystem.file('build/flutter_size_01/snapshot.linux-arm64.json')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
|
@ -109,7 +109,7 @@ void main() {
|
|||||||
|
|
||||||
// Creates a FakeCommand for the xcodebuild call to build the app
|
// Creates a FakeCommand for the xcodebuild call to build the app
|
||||||
// in the given configuration.
|
// in the given configuration.
|
||||||
FakeCommand setUpFakeXcodeBuildHandler(String configuration, { bool verbose = false, void Function()? onRun }) {
|
FakeCommand setUpFakeXcodeBuildHandler(String configuration, { bool verbose = false, void Function(List<String> command)? onRun }) {
|
||||||
final FlutterProject flutterProject = FlutterProject.fromDirectory(fileSystem.currentDirectory);
|
final FlutterProject flutterProject = FlutterProject.fromDirectory(fileSystem.currentDirectory);
|
||||||
final Directory flutterBuildDir = fileSystem.directory(getMacOSBuildDirectory());
|
final Directory flutterBuildDir = fileSystem.directory(getMacOSBuildDirectory());
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
@ -147,12 +147,12 @@ Thread: <_NSMainThread: 0x6000027c0280>{number = 1, name = main}
|
|||||||
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
|
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
|
||||||
STDERR STUFF
|
STDERR STUFF
|
||||||
''',
|
''',
|
||||||
onRun: () {
|
onRun: (List<String> command) {
|
||||||
fileSystem.file(fileSystem.path.join('macos', 'Flutter', 'ephemeral', '.app_filename'))
|
fileSystem.file(fileSystem.path.join('macos', 'Flutter', 'ephemeral', '.app_filename'))
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('example.app');
|
..writeAsStringSync('example.app');
|
||||||
if (onRun != null) {
|
if (onRun != null) {
|
||||||
onRun();
|
onRun(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -658,7 +658,7 @@ STDERR STUFF
|
|||||||
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
|
||||||
// These are generated by gen_snapshot because flutter assemble passes
|
// These are generated by gen_snapshot because flutter assemble passes
|
||||||
// extra flags specifying this output path
|
// extra flags specifying this output path
|
||||||
setUpFakeXcodeBuildHandler('Release', onRun: () {
|
setUpFakeXcodeBuildHandler('Release', onRun: (_) {
|
||||||
fileSystem.file('build/flutter_size_01/snapshot.arm64.json')
|
fileSystem.file('build/flutter_size_01/snapshot.arm64.json')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
|
@ -79,7 +79,7 @@ void main() {
|
|||||||
// Returns the command matching the build_windows call to generate CMake
|
// Returns the command matching the build_windows call to generate CMake
|
||||||
// files.
|
// files.
|
||||||
FakeCommand cmakeGenerationCommand({
|
FakeCommand cmakeGenerationCommand({
|
||||||
void Function()? onRun,
|
void Function(List<String> command)? onRun,
|
||||||
String generator = _defaultGenerator,
|
String generator = _defaultGenerator,
|
||||||
}) {
|
}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
@ -102,7 +102,7 @@ void main() {
|
|||||||
// Returns the command matching the build_windows call to build.
|
// Returns the command matching the build_windows call to build.
|
||||||
FakeCommand buildCommand(String buildMode, {
|
FakeCommand buildCommand(String buildMode, {
|
||||||
bool verbose = false,
|
bool verbose = false,
|
||||||
void Function()? onRun,
|
void Function(List<String> command)? onRun,
|
||||||
String stdout = '',
|
String stdout = '',
|
||||||
}) {
|
}) {
|
||||||
return FakeCommand(
|
return FakeCommand(
|
||||||
@ -948,7 +948,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
|
|||||||
|
|
||||||
processManager = FakeProcessManager.list(<FakeCommand>[
|
processManager = FakeProcessManager.list(<FakeCommand>[
|
||||||
cmakeGenerationCommand(),
|
cmakeGenerationCommand(),
|
||||||
buildCommand('Release', onRun: () {
|
buildCommand('Release', onRun: (_) {
|
||||||
fileSystem.file(r'build\flutter_size_01\snapshot.windows-x64.json')
|
fileSystem.file(r'build\flutter_size_01\snapshot.windows-x64.json')
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsStringSync('''
|
..writeAsStringSync('''
|
||||||
|
@ -46,7 +46,7 @@ void main() {
|
|||||||
const String upstreamHeadRevision = 'deadbeef';
|
const String upstreamHeadRevision = 'deadbeef';
|
||||||
final Completer<void> reEntryCompleter = Completer<void>();
|
final Completer<void> reEntryCompleter = Completer<void>();
|
||||||
|
|
||||||
Future<void> reEnterTool() async {
|
Future<void> reEnterTool(List<String> command) async {
|
||||||
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
|
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
|
||||||
reEntryCompleter.complete();
|
reEntryCompleter.complete();
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ void main() {
|
|||||||
testUsingContext('can push people from master to beta', () async {
|
testUsingContext('can push people from master to beta', () async {
|
||||||
final Completer<void> reEntryCompleter = Completer<void>();
|
final Completer<void> reEntryCompleter = Completer<void>();
|
||||||
|
|
||||||
Future<void> reEnterTool() async {
|
Future<void> reEnterTool(List<String> args) async {
|
||||||
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
|
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
|
||||||
reEntryCompleter.complete();
|
reEntryCompleter.complete();
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ void main() {
|
|||||||
testUsingContext('do not push people from beta to anything else', () async {
|
testUsingContext('do not push people from beta to anything else', () async {
|
||||||
final Completer<void> reEntryCompleter = Completer<void>();
|
final Completer<void> reEntryCompleter = Completer<void>();
|
||||||
|
|
||||||
Future<void> reEnterTool() async {
|
Future<void> reEnterTool(List<String> command) async {
|
||||||
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
|
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
|
||||||
reEntryCompleter.complete();
|
reEntryCompleter.complete();
|
||||||
}
|
}
|
||||||
|
@ -479,7 +479,7 @@ void main() {
|
|||||||
'assembleRelease',
|
'assembleRelease',
|
||||||
],
|
],
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
throw const ProcessException('', <String>[], 'Unrecognized');
|
throw const ProcessException('', <String>[], 'Unrecognized');
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
@ -792,7 +792,7 @@ flutter:
|
|||||||
'--include=/$assetsPath',
|
'--include=/$assetsPath',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file(outputPath).createSync(recursive: true);
|
fileSystem.file(outputPath).createSync(recursive: true);
|
||||||
fileSystem.file('$outputPath.spirv').createSync(recursive: true);
|
fileSystem.file('$outputPath.spirv').createSync(recursive: true);
|
||||||
},
|
},
|
||||||
@ -839,7 +839,7 @@ flutter:
|
|||||||
'--include=/$assetsPath',
|
'--include=/$assetsPath',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file(outputPath).createSync(recursive: true);
|
fileSystem.file(outputPath).createSync(recursive: true);
|
||||||
fileSystem.file('$outputPath.spirv').createSync(recursive: true);
|
fileSystem.file('$outputPath.spirv').createSync(recursive: true);
|
||||||
},
|
},
|
||||||
@ -880,7 +880,7 @@ flutter:
|
|||||||
'--include=${fileSystem.path.join(materialDir.path, 'shaders')}',
|
'--include=${fileSystem.path.join(materialDir.path, 'shaders')}',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file(outputPath).createSync(recursive: true);
|
fileSystem.file(outputPath).createSync(recursive: true);
|
||||||
fileSystem.file('$outputPath.spirv').createSync(recursive: true);
|
fileSystem.file('$outputPath.spirv').createSync(recursive: true);
|
||||||
},
|
},
|
||||||
|
@ -670,7 +670,7 @@ void main() {
|
|||||||
'-d',
|
'-d',
|
||||||
tempDirectory.path,
|
tempDirectory.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempDirectory, exists);
|
expect(tempDirectory, exists);
|
||||||
tempDirectory.childDirectory('dirA').childFile('fileA').createSync(recursive: true);
|
tempDirectory.childDirectory('dirA').childFile('fileA').createSync(recursive: true);
|
||||||
tempDirectory.childDirectory('dirB').childFile('fileB').createSync(recursive: true);
|
tempDirectory.childDirectory('dirB').childFile('fileB').createSync(recursive: true);
|
||||||
|
@ -599,7 +599,7 @@ void main() {
|
|||||||
'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.simulator',
|
'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.simulator',
|
||||||
outputDir.path,
|
outputDir.path,
|
||||||
],
|
],
|
||||||
onRun: () => binary.createSync(recursive: true),
|
onRun: (_) => binary.createSync(recursive: true),
|
||||||
),
|
),
|
||||||
lipoCommandNonFatResult,
|
lipoCommandNonFatResult,
|
||||||
FakeCommand(command: <String>[
|
FakeCommand(command: <String>[
|
||||||
|
@ -138,7 +138,7 @@ void main() {
|
|||||||
// destination
|
// destination
|
||||||
environment.outputDir.path,
|
environment.outputDir.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
entitlements.writeAsStringSync('foo');
|
entitlements.writeAsStringSync('foo');
|
||||||
withoutEntitlements.writeAsStringSync('bar');
|
withoutEntitlements.writeAsStringSync('bar');
|
||||||
nestedEntitlements.writeAsStringSync('somefile.bin');
|
nestedEntitlements.writeAsStringSync('somefile.bin');
|
||||||
|
@ -54,7 +54,7 @@ void main() {
|
|||||||
'--include=$fragDir',
|
'--include=$fragDir',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file(outputPath).createSync(recursive: true);
|
fileSystem.file(outputPath).createSync(recursive: true);
|
||||||
fileSystem.file(outputSpirvPath).createSync(recursive: true);
|
fileSystem.file(outputSpirvPath).createSync(recursive: true);
|
||||||
},
|
},
|
||||||
@ -94,7 +94,7 @@ void main() {
|
|||||||
'--include=$fragDir',
|
'--include=$fragDir',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file(outputPath).createSync(recursive: true);
|
fileSystem.file(outputPath).createSync(recursive: true);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -133,7 +133,7 @@ void main() {
|
|||||||
'--include=$fragDir',
|
'--include=$fragDir',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file(outputPath).createSync(recursive: true);
|
fileSystem.file(outputPath).createSync(recursive: true);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -171,7 +171,7 @@ void main() {
|
|||||||
'--include=$fragDir',
|
'--include=$fragDir',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file(outputPath).createSync(recursive: true);
|
fileSystem.file(outputPath).createSync(recursive: true);
|
||||||
fileSystem.file(outputSpirvPath).createSync(recursive: true);
|
fileSystem.file(outputSpirvPath).createSync(recursive: true);
|
||||||
},
|
},
|
||||||
@ -253,7 +253,7 @@ void main() {
|
|||||||
'--include=$fragDir',
|
'--include=$fragDir',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
||||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp')
|
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp')
|
||||||
..createSync()
|
..createSync()
|
||||||
@ -301,7 +301,7 @@ void main() {
|
|||||||
'--include=$fragDir',
|
'--include=$fragDir',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
||||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp')
|
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp')
|
||||||
..createSync()
|
..createSync()
|
||||||
@ -349,7 +349,7 @@ void main() {
|
|||||||
'--include=$fragDir',
|
'--include=$fragDir',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
||||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp')
|
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp')
|
||||||
..createSync()
|
..createSync()
|
||||||
@ -398,7 +398,7 @@ void main() {
|
|||||||
'--include=$fragDir',
|
'--include=$fragDir',
|
||||||
'--include=$shaderLibDir',
|
'--include=$shaderLibDir',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
||||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp')
|
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp')
|
||||||
..createSync()
|
..createSync()
|
||||||
|
@ -590,7 +590,7 @@ void main() {
|
|||||||
'--packages=.dart_tool/package_config.json',
|
'--packages=.dart_tool/package_config.json',
|
||||||
'--cfe-only',
|
'--cfe-only',
|
||||||
environment.buildDir.childFile('main.dart').absolute.path,
|
environment.buildDir.childFile('main.dart').absolute.path,
|
||||||
], onRun: () {
|
], onRun: (_) {
|
||||||
environment.buildDir.childFile('app.dill.deps')
|
environment.buildDir.childFile('app.dill.deps')
|
||||||
.writeAsStringSync('file:///a.dart');
|
.writeAsStringSync('file:///a.dart');
|
||||||
},
|
},
|
||||||
@ -809,7 +809,7 @@ void main() {
|
|||||||
environment.buildDir.childFile('main.dart').absolute.path,
|
environment.buildDir.childFile('main.dart').absolute.path,
|
||||||
environment.buildDir.childFile('main.dart.unopt.wasm').absolute.path,
|
environment.buildDir.childFile('main.dart.unopt.wasm').absolute.path,
|
||||||
],
|
],
|
||||||
onRun: () => outputJsFile..createSync()..writeAsStringSync('foo'))
|
onRun: (_) => outputJsFile..createSync()..writeAsStringSync('foo'))
|
||||||
);
|
);
|
||||||
|
|
||||||
processManager.addCommand(FakeCommand(
|
processManager.addCommand(FakeCommand(
|
||||||
@ -848,7 +848,7 @@ void main() {
|
|||||||
environment.buildDir.childFile('main.dart').absolute.path,
|
environment.buildDir.childFile('main.dart').absolute.path,
|
||||||
environment.buildDir.childFile('main.dart.unopt.wasm').absolute.path,
|
environment.buildDir.childFile('main.dart.unopt.wasm').absolute.path,
|
||||||
],
|
],
|
||||||
onRun: () => outputJsFile..createSync()..writeAsStringSync('foo'))
|
onRun: (_) => outputJsFile..createSync()..writeAsStringSync('foo'))
|
||||||
);
|
);
|
||||||
|
|
||||||
processManager.addCommand(FakeCommand(
|
processManager.addCommand(FakeCommand(
|
||||||
@ -884,7 +884,7 @@ void main() {
|
|||||||
'--depfile=${depFile.absolute.path}',
|
'--depfile=${depFile.absolute.path}',
|
||||||
environment.buildDir.childFile('main.dart').absolute.path,
|
environment.buildDir.childFile('main.dart').absolute.path,
|
||||||
environment.buildDir.childFile('main.dart.unopt.wasm').absolute.path,
|
environment.buildDir.childFile('main.dart.unopt.wasm').absolute.path,
|
||||||
], onRun: () => outputJsFile..createSync()..writeAsStringSync('foo')));
|
], onRun: (_) => outputJsFile..createSync()..writeAsStringSync('foo')));
|
||||||
|
|
||||||
processManager.addCommand(FakeCommand(
|
processManager.addCommand(FakeCommand(
|
||||||
command: <String>[
|
command: <String>[
|
||||||
@ -919,7 +919,7 @@ void main() {
|
|||||||
'--depfile=${depFile.absolute.path}',
|
'--depfile=${depFile.absolute.path}',
|
||||||
environment.buildDir.childFile('main.dart').absolute.path,
|
environment.buildDir.childFile('main.dart').absolute.path,
|
||||||
environment.buildDir.childFile('main.dart.wasm').absolute.path,
|
environment.buildDir.childFile('main.dart.wasm').absolute.path,
|
||||||
], onRun: () => outputJsFile..createSync()..writeAsStringSync('foo')));
|
], onRun: (_) => outputJsFile..createSync()..writeAsStringSync('foo')));
|
||||||
|
|
||||||
await Dart2WasmTarget(WebRendererMode.canvaskit).build(environment);
|
await Dart2WasmTarget(WebRendererMode.canvaskit).build(environment);
|
||||||
}, overrides: <Type, Generator>{
|
}, overrides: <Type, Generator>{
|
||||||
@ -942,7 +942,7 @@ void main() {
|
|||||||
environment.buildDir.childFile('main.dart').absolute.path,
|
environment.buildDir.childFile('main.dart').absolute.path,
|
||||||
environment.buildDir.childFile('main.dart.unopt.wasm').absolute.path,
|
environment.buildDir.childFile('main.dart.unopt.wasm').absolute.path,
|
||||||
],
|
],
|
||||||
onRun: () => outputJsFile..createSync()..writeAsStringSync('foo'))
|
onRun: (_) => outputJsFile..createSync()..writeAsStringSync('foo'))
|
||||||
);
|
);
|
||||||
|
|
||||||
processManager.addCommand(FakeCommand(
|
processManager.addCommand(FakeCommand(
|
||||||
|
@ -227,7 +227,7 @@ void main() {
|
|||||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: testConfig.pingCommand,
|
command: testConfig.pingCommand,
|
||||||
onRun: () => pingCommandWasExecuted = true,
|
onRun: (_) => pingCommandWasExecuted = true,
|
||||||
stdout: testConfigPingSuccessOutput
|
stdout: testConfigPingSuccessOutput
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
@ -318,7 +318,7 @@ void main() {
|
|||||||
logger: BufferLogger.test(),
|
logger: BufferLogger.test(),
|
||||||
processManager: FakeProcessManager.list(<FakeCommand>[
|
processManager: FakeProcessManager.list(<FakeCommand>[
|
||||||
FakeCommand(command: testConfig.uninstallCommand),
|
FakeCommand(command: testConfig.uninstallCommand),
|
||||||
FakeCommand(command: testConfig.installCommand, onRun: () => bothCommandsWereExecuted = true),
|
FakeCommand(command: testConfig.installCommand, onRun: (_) => bothCommandsWereExecuted = true),
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -522,7 +522,7 @@ void main() {
|
|||||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: testConfig.screenshotCommand!,
|
command: testConfig.screenshotCommand!,
|
||||||
onRun: () => screenshotCommandWasExecuted = true,
|
onRun: (_) => screenshotCommandWasExecuted = true,
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -548,7 +548,7 @@ void main() {
|
|||||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||||
FakeCommand(
|
FakeCommand(
|
||||||
command: testConfig.screenshotCommand!,
|
command: testConfig.screenshotCommand!,
|
||||||
onRun: () => screenshotCommandWasExecuted = true,
|
onRun: (_) => screenshotCommandWasExecuted = true,
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ void main() {
|
|||||||
'get',
|
'get',
|
||||||
'--example',
|
'--example',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem
|
fileSystem
|
||||||
.file('.dart_tool/package_config.json')
|
.file('.dart_tool/package_config.json')
|
||||||
.createSync(recursive: true);
|
.createSync(recursive: true);
|
||||||
@ -646,7 +646,7 @@ exit code: 66
|
|||||||
'get',
|
'get',
|
||||||
'--example',
|
'--example',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
throw const ProcessException(
|
throw const ProcessException(
|
||||||
'bin/cache/dart-sdk/bin/dart',
|
'bin/cache/dart-sdk/bin/dart',
|
||||||
<String>[
|
<String>[
|
||||||
@ -842,7 +842,7 @@ exit code: 66
|
|||||||
'FLUTTER_ROOT': '',
|
'FLUTTER_ROOT': '',
|
||||||
'PUB_ENVIRONMENT': 'flutter_cli:flutter_tests',
|
'PUB_ENVIRONMENT': 'flutter_cli:flutter_tests',
|
||||||
},
|
},
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.currentDirectory
|
fileSystem.currentDirectory
|
||||||
.childDirectory('.dart_tool')
|
.childDirectory('.dart_tool')
|
||||||
.childFile('package_config.json')
|
.childFile('package_config.json')
|
||||||
@ -908,7 +908,7 @@ exit code: 66
|
|||||||
'FLUTTER_ROOT': '',
|
'FLUTTER_ROOT': '',
|
||||||
'PUB_ENVIRONMENT': 'flutter_cli:flutter_tests',
|
'PUB_ENVIRONMENT': 'flutter_cli:flutter_tests',
|
||||||
},
|
},
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.currentDirectory
|
fileSystem.currentDirectory
|
||||||
.childDirectory('.dart_tool')
|
.childDirectory('.dart_tool')
|
||||||
.childFile('package_config.json')
|
.childFile('package_config.json')
|
||||||
@ -1155,7 +1155,7 @@ exit code: 66
|
|||||||
'get',
|
'get',
|
||||||
'--example',
|
'--example',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem
|
fileSystem
|
||||||
.file('.dart_tool/package_config.json')
|
.file('.dart_tool/package_config.json')
|
||||||
.setLastModifiedSync(DateTime(2002));
|
.setLastModifiedSync(DateTime(2002));
|
||||||
@ -1181,7 +1181,7 @@ exit code: 66
|
|||||||
'get',
|
'get',
|
||||||
'--example',
|
'--example',
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
fileSystem.file('pubspec.yaml').setLastModifiedSync(DateTime(2002));
|
fileSystem.file('pubspec.yaml').setLastModifiedSync(DateTime(2002));
|
||||||
}),
|
}),
|
||||||
const FakeCommand(
|
const FakeCommand(
|
||||||
|
@ -156,7 +156,7 @@ void main() {
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -231,7 +231,7 @@ void main() {
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -277,7 +277,7 @@ ERROR: The file couldn’t be opened because it doesn’t exist. (NSCocoaErrorDo
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -314,7 +314,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -385,7 +385,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -460,7 +460,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -506,7 +506,7 @@ ERROR: The file couldn’t be opened because it doesn’t exist. (NSCocoaErrorDo
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -543,7 +543,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -633,7 +633,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -722,7 +722,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -792,7 +792,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -837,7 +837,7 @@ ERROR: The operation couldn?t be completed. (OSStatus error -10814.) (NSOSStatus
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -875,7 +875,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -976,7 +976,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1084,7 +1084,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1154,7 +1154,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1222,7 +1222,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1266,7 +1266,7 @@ ERROR: The specified device was not found. (com.apple.dt.CoreDeviceError error 1
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1305,7 +1305,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1340,7 +1340,7 @@ invalid JSON
|
|||||||
];
|
];
|
||||||
fakeProcessManager.addCommand(FakeCommand(
|
fakeProcessManager.addCommand(FakeCommand(
|
||||||
command: args,
|
command: args,
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
// Simulate that this command threw and simultaneously the OS
|
// Simulate that this command threw and simultaneously the OS
|
||||||
// deleted the temp directory
|
// deleted the temp directory
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
@ -1395,7 +1395,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1457,7 +1457,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1520,7 +1520,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1576,7 +1576,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1640,7 +1640,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1713,7 +1713,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1797,7 +1797,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1852,7 +1852,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1902,7 +1902,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
@ -1957,7 +1957,7 @@ invalid JSON
|
|||||||
'--json-output',
|
'--json-output',
|
||||||
tempFile.path,
|
tempFile.path,
|
||||||
],
|
],
|
||||||
onRun: () {
|
onRun: (_) {
|
||||||
expect(tempFile, exists);
|
expect(tempFile, exists);
|
||||||
tempFile.writeAsStringSync(deviceControlOutput);
|
tempFile.writeAsStringSync(deviceControlOutput);
|
||||||
},
|
},
|
||||||
|
@ -35,7 +35,7 @@ void main() {
|
|||||||
stdout: stdout,
|
stdout: stdout,
|
||||||
stderr: stderr,
|
stderr: stderr,
|
||||||
exitCode: exitCode,
|
exitCode: exitCode,
|
||||||
onRun: () {},
|
onRun: (_) {},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,13 @@ class FakeCommand {
|
|||||||
|
|
||||||
/// A callback that is run after [duration] expires but before the [exitCode]
|
/// A callback that is run after [duration] expires but before the [exitCode]
|
||||||
/// (and output) are passed back.
|
/// (and output) are passed back.
|
||||||
final VoidCallback? onRun;
|
///
|
||||||
|
/// The callback will be provided the full command that matched this instance.
|
||||||
|
/// This can be useful in the rare scenario where the full command cannot be known
|
||||||
|
/// ahead of time (i.e. when one or more instances of [RegExp] are used to
|
||||||
|
/// match the command). For example, the command may contain one or more
|
||||||
|
/// randomly-generated elements, such as a temporary directory path.
|
||||||
|
final void Function(List<String> command)? onRun;
|
||||||
|
|
||||||
/// The process' exit code.
|
/// The process' exit code.
|
||||||
///
|
///
|
||||||
@ -306,7 +312,7 @@ abstract class FakeProcessManager implements ProcessManager {
|
|||||||
throw fakeCommand.exception!; // ignore: only_throw_errors
|
throw fakeCommand.exception!; // ignore: only_throw_errors
|
||||||
}
|
}
|
||||||
if (fakeCommand.onRun != null) {
|
if (fakeCommand.onRun != null) {
|
||||||
fakeCommand.onRun!();
|
fakeCommand.onRun!(command);
|
||||||
}
|
}
|
||||||
return FakeProcess(
|
return FakeProcess(
|
||||||
duration: fakeCommand.duration,
|
duration: fakeCommand.duration,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user