Skip to main content

Call

Type Alias Call 

Source
pub type Call = ProcessSpec;
Available on crate feature fake only.
Expand description

One call a test’s code made: the process it asked for, as it asked.

Aliased Type§

pub struct Call {
    pub program: String,
    pub args: Vec<String>,
    pub cwd: Option<PathBuf>,
    pub env: Vec<(String, String)>,
    pub stdin: Option<PathBuf>,
    pub ledger_dir: Option<PathBuf>,
    pub container: Option<String>,
}

Fields§

§program: String

The program: a bare tool name, found on PATH.

§args: Vec<String>

Its arguments, passed as they are (no shell ever reads them).

§cwd: Option<PathBuf>

Its working folder (default: the runner’s).

§env: Vec<(String, String)>

Variables added to the runner’s environment.

§stdin: Option<PathBuf>

A file piped into its standard input (default: none).

§ledger_dir: Option<PathBuf>

The folder the tool is recorded in while it runs (its process group; its process tree on Windows), so the next operation can end it if the process that started it is killed first (default: not recorded). An operation’s tools are recorded in the run’s state folder.

A tool that isn’t part of a run (one an embedder starts itself) is recorded in a folder of the embedder’s, one it keeps for its own tools: the embedder passes that folder to ledger::end_orphans when it starts, which ends what a crashed or killed process of its left running there.

§container: Option<String>

The container the tool runs in, by name, when program is the Docker CLI running it (docker run --name): removed (docker rm -f) wherever the tool is ended before its end, since ending the docker client leaves its container running (default: none).

Trait Implementations§

Source§

impl CallView for Call

Available on crate features fake only.
Source§

fn flag(&self, name: &str) -> Option<&str>

The value of option name (--name value or --name=value), the last when given twice.
Source§

fn has(&self, name: &str) -> bool

Whether option or argument name is given.
Source§

fn has_run(&self, run: &[&str]) -> bool

Whether the arguments run appear together, in order.