start function

Future<TestProcess> start(
  1. String executable,
  2. Iterable<String> arguments, {
  3. bool node = false,
  4. String? workingDirectory,
  5. Map<String, String>? environment,
  6. bool includeParentEnvironment = true,
  7. bool runInShell = false,
  8. String? description,
  9. required Encoding encoding,
  10. bool forwardStdio = false,
})

Starts a TestProcess running executable, which is the name of the executable as listed in the pubspec (or in pkg.executables).

If node is true, this will run a NodeJS process using the executable compiled by pkg-npm-dev. Otherwise, it will run a Dart VM process using the executable compiled by pkg-standalone-dev if one exists and running from source otherwise.

All other arguments are just like TestProcess.start and/or Process.start.

This throws a TestFailure if it would run a compiled executable that's out-of-date relative to the pubspec or to source files in lib/ or bin/.

When using this in multiple tests, consider calling setUpAll with ensureExecutableUpToDate to avoid having many redundant test failures for an out-of-date executable.

Implementation

Future<TestProcess> start(String executable, Iterable<String> arguments,
        {bool node = false,
        String? workingDirectory,
        Map<String, String>? environment,
        bool includeParentEnvironment = true,
        bool runInShell = false,
        String? description,
        required Encoding encoding,
        bool forwardStdio = false}) async =>
    await TestProcess.start(executableRunner(executable, node: node),
        [...executableArgs(executable, node: node), ...arguments],
        workingDirectory: workingDirectory,
        environment: environment,
        includeParentEnvironment: includeParentEnvironment,
        runInShell: runInShell,
        description: description,
        encoding: encoding,
        forwardStdio: forwardStdio);