Module runcmd

Source
Expand description

Step library for running subprocesses as part of scenarios

Re-exports§

pub use super::datadir::Datadir;
pub use crate::prelude::*;

Modules§

exit_code_is
Check that an executed command returns a specific exit code
exit_code_is_nonzero
Check that an executed command did not succeed
exit_code_is_not
Check that an executed command returns a specific exit code
exit_code_is_zero
Check that an executed command succeeded
helper_script
Ensure the given data file is available as a script in the data dir
helper_srcdir_path
Ensure that the base source directory is in the PATH for subsequent commands being run.
run
Run the given command, ensuring it succeeds
run_in
Run the given command in the given subpath of the data directory, ensuring that it succeeds.
set_environment_variable
Set an environment variable for future commands
stderr_contains
Check that the stderr of the command contains a given string
stderr_doesnt_contain
Check that the stderr of the command does not contain a given string
stderr_doesnt_match_regex
Check that the stderr of the command does not match a given regular expression
stderr_is
Check that the stderr of the command matches exactly
stderr_isnt
Check that the stderr of the command is exactly not a given value
stderr_matches_regex
Check that the stderr of the command matches a given regular expression
stdin_from_file
Next step to run command redirects stdout to a named file.
stdin_is
Next step to run command feeds text to its standard input.
stdout_contains
Check that the stdout of the command contains a given string
stdout_doesnt_contain
Check that the stdout of the command does not contain a given string
stdout_doesnt_match_regex
Check that the stdout of the command does not match a given regular expression
stdout_is
Check that the stdout of the command matches exactly
stdout_isnt
Check that the stdout of the command is exactly not a given value
stdout_matches_regex
Check that the stdout of the command matches a given regular expression
try_to_run
Run the given command
try_to_run_in
Run the given command in the given subpath of the data directory
unset_environment_variable
Unset an environment variable so that it’s not given to future commands

Structs§

Runcmd
The Runcmd context gives a step function access to the ability to run subprocesses as part of a scenario. These subprocesses are run with various environment variables set, and we record the stdout/stderr of the most recent-to-run command for testing purposes.