runAppTests function

Future<(int, String)> runAppTests(
  1. GeneratedApp generated,
  2. MatrixApp app,
  3. List<MatrixAppTest> tests, {
  4. MatrixEnv? env,
  5. MatrixFlutter flutter = _flutter,
  6. FileSystem fileSystem = const LocalFileSystem(),
})

Adds tests to generated, the app of the matrix app, with addAppTests, writes the values that they give the app into the file of env (see MatrixAppTest.envValues), and runs the appTestCommands with flutter until one fails, flutter test with the tool arguments of env for app; returns its exit code and the output up to it, which says which command failed, or 0 and the output of all. A problem of the files of the tests or of their values is a failure too, with the exit code 1, such as a value that the tests give without env.

Implementation

Future<(int, String)> runAppTests(
  GeneratedApp generated,
  MatrixApp app,
  List<MatrixAppTest> tests, {
  MatrixEnv? env,
  MatrixFlutter flutter = _flutter,
  FileSystem fileSystem = const LocalFileSystem(),
}) =>
    _addAndRun(
      (generated: generated, app: app),
      tests,
      appTestCommands(
        tests,
        toolArguments: env?.toolArguments(app) ?? const [],
      ),
      env: env,
      valuesOf: () => _envValuesOf(tests, app, env, generated.path, fileSystem),
      machine: (flutter: flutter, fileSystem: fileSystem),
    );