getCommandsToRun method

List<CommandToRun> getCommandsToRun(
  1. Map<String, DetermineFlutterOrDart> testFiles, {
  2. required List<String> flutterArgs,
  3. required List<String> dartArgs,
})

Implementation

List<CommandToRun> getCommandsToRun(
  Map<String, DetermineFlutterOrDart> testFiles, {
  required List<String> flutterArgs,
  required List<String> dartArgs,
}) {
  final commandsToRun = <CommandToRun>[];

  for (final MapEntry(key: test, value: tool) in testFiles.entries) {
    final projectRoot = packageRootFor(test);

    final testPath = path.relative(test, from: projectRoot);

    final command = createTestCommand(
      projectRoot: projectRoot,
      relativeProjectRoot: packageRootFor(path.relative(test)),
      tool: tool,
      flutterArgs: flutterArgs,
      dartArgs: dartArgs,
      tests: [testPath],
    );

    commandsToRun.add(command);
  }

  return commandsToRun;
}