runAppTests function
Future<(int, String)>
runAppTests(
- GeneratedApp generated,
- MatrixApp app,
- List<
MatrixAppTest> tests, { - MatrixEnv? env,
- MatrixFlutter flutter = _flutter,
- 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),
);