flutter/packages/flutter_tools/test/general.shard/ios
Andrew Kolos 295a9a2031
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);
  },
)
```
2024-01-25 07:51:25 +00:00
..
code_signing_test.dart [flutter_tool] change print when selecting developer identity for code signing (#136978) 2023-10-30 19:03:18 +00:00
core_devices_test.dart provide command to FakeCommand::onRun (#142206) 2024-01-25 07:51:25 +00:00
devices_test.dart New tooling for iOS 17 physical devices (#131865) 2023-08-09 19:25:12 +00:00
ios_deploy_test.dart [flutter_tools] catch SocketException writing to ios-deploy stdin (#139784) 2023-12-12 00:32:18 +00:00
ios_device_install_test.dart New tooling for iOS 17 physical devices (#131865) 2023-08-09 19:25:12 +00:00
ios_device_logger_test.dart [flutter_tools] catch SocketException writing to ios-deploy stdin (#139784) 2023-12-12 00:32:18 +00:00
ios_device_port_forwarder_test.dart [tool] Consistent FakeProcessManager.run/runSync (#103947) 2022-05-17 11:15:54 -07:00
ios_device_project_test.dart New tooling for iOS 17 physical devices (#131865) 2023-08-09 19:25:12 +00:00
ios_device_start_nonprebuilt_test.dart Fixed few typos (#141543) 2024-01-16 21:40:08 +00:00
ios_device_start_prebuilt_test.dart If one method of finding Dart VM fails for CoreDevice, wait for the other method (#139754) 2023-12-08 16:39:08 +00:00
ios_project_migration_test.dart Migrate Xcode projects last version checks to Xcode 15.1 (#140256) 2024-01-03 23:05:46 +00:00
ios_workflow_test.dart Only show iOS simulators, reduce output spew in verbose (#108345) 2022-07-26 19:08:06 +00:00
mac_test.dart Support wireless debugging for iOS 12 or earlier (#141439) 2024-01-24 22:14:08 +00:00
native_assets_test.dart Reapply "Native assets: roll deps" (#141748) (#141864) 2024-01-22 10:42:15 +00:00
simulators_test.dart Add --trace-to-file option to flutter run (#135713) 2023-10-12 13:23:52 -04:00
xcode_debug_test.dart Migrate Xcode projects last version checks to Xcode 15.1 (#140256) 2024-01-03 23:05:46 +00:00
xcodeproj_test.dart Unified analytics events migration for BuildEvent (#137562) 2023-11-01 19:56:50 +00:00
xcresult_test_data.dart Reland "Print pretty error when xcodebuild fails due to missing simulator #130286" (#130506) 2023-07-13 19:36:10 +00:00
xcresult_test.dart provide command to FakeCommand::onRun (#142206) 2024-01-25 07:51:25 +00:00