summaryrefslogtreecommitdiff
path: root/share/common/lib/runcmd.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'share/common/lib/runcmd.yaml')
-rw-r--r--share/common/lib/runcmd.yaml77
1 files changed, 75 insertions, 2 deletions
diff --git a/share/common/lib/runcmd.yaml b/share/common/lib/runcmd.yaml
index 5847613..b20eac8 100644
--- a/share/common/lib/runcmd.yaml
+++ b/share/common/lib/runcmd.yaml
@@ -8,6 +8,8 @@
function: subplotlib::steplibrary::runcmd::helper_script
types:
script: file
+ doc: |
+ Install a helper script from an embedded file.
- given: srcdir is in the PATH
impl:
@@ -15,6 +17,10 @@
function: runcmd_helper_srcdir_path
rust:
function: subplotlib::steplibrary::runcmd::helper_srcdir_path
+ doc: |
+ Make sure the source directory of the project being testes is on
+ the shell PATH. This makes it easy for tests to invoke programs
+ from the source tree.
- when: I run {argv0}{args:text}
impl:
@@ -22,13 +28,22 @@
function: runcmd_step
rust:
function: subplotlib::steplibrary::runcmd::run
+ doc: |
+ Run a program, and make sure it succeeds.
-- when: I run, in {dirname}, {argv0}{args:text}
+- when: I run, in {dirname}, {argv0}{args}
impl:
python:
function: runcmd_step_in
rust:
function: subplotlib::steplibrary::runcmd::run_in
+ types:
+ dirname: path
+ argv0: word
+ args: text
+ doc: |
+ Change to a different directory and run a program, and make sure
+ it succeeds;
- when: I try to run {argv0}{args:text}
impl:
@@ -36,13 +51,23 @@
function: runcmd_try_to_run
rust:
function: subplotlib::steplibrary::runcmd::try_to_run
+ doc: |
+ Run a program, but allow it to fail. Other steps can check if it
+ succeeded.
-- when: I try to run, in {dirname}, {argv0}{args:text}
+- when: I try to run, in {dirname}, {argv0}{args}
impl:
python:
function: runcmd_try_to_run_in
rust:
function: subplotlib::steplibrary::runcmd::try_to_run_in
+ types:
+ dirname: path
+ argv0: word
+ args: text
+ doc: |
+ Change to a different directory and run a program, but allow it to
+ fail. Other steps can check if it succeeded.
# Steps to examine exit code of latest command.
@@ -54,6 +79,9 @@
function: subplotlib::steplibrary::runcmd::exit_code_is
types:
exit: int
+ doc: |
+ Make sure the latest command run by `lib/runcmd` had a specific
+ exit code.
- then: exit code is not {exit}
impl:
@@ -63,6 +91,9 @@
function: subplotlib::steplibrary::runcmd::exit_code_is_not
types:
exit: int
+ doc: |
+ Make sure the latest command run by `lib/runcmd` did not have a
+ specific exit code.
- then: command is successful
impl:
@@ -70,6 +101,9 @@
function: runcmd_exit_code_is_zero
rust:
function: subplotlib::steplibrary::runcmd::exit_code_is_zero
+ doc: |
+ Make sure the latest command run by `lib/runcmd` indicated the
+ command succeeded.
- then: command fails
impl:
@@ -77,6 +111,9 @@
function: runcmd_exit_code_is_nonzero
rust:
function: subplotlib::steplibrary::runcmd::exit_code_is_nonzero
+ doc: |
+ Make sure the latest command run by `lib/runcmd` indicated the
+ command failed.
# Steps to examine stdout/stderr for exact content.
@@ -86,6 +123,9 @@
function: runcmd_stdout_is
rust:
function: subplotlib::steplibrary::runcmd::stdout_is
+ doc: |
+ Make sure the standard output of the latest command run by
+ `lib/runcmd` is exactly as desired.
- then: 'stdout isn''t exactly "{text:text}"'
impl:
@@ -93,6 +133,9 @@
function: runcmd_stdout_isnt
rust:
function: subplotlib::steplibrary::runcmd::stdout_isnt
+ doc: |
+ Make sure the standard output of the latest command run by
+ `lib/runcmd` is different from what is not wanted.
- then: stderr is exactly "{text:text}"
impl:
@@ -100,6 +143,9 @@
function: runcmd_stderr_is
rust:
function: subplotlib::steplibrary::runcmd::stderr_is
+ doc: |
+ Make sure the standard error output of the latest command run by
+ `lib/runcmd` is exactly as desired.
- then: 'stderr isn''t exactly "{text:text}"'
impl:
@@ -107,6 +153,9 @@
function: runcmd_stderr_isnt
rust:
function: subplotlib::steplibrary::runcmd::stderr_isnt
+ doc: |
+ Make sure the standard error output of the latest command run by
+ `lib/runcmd` is different from what is not wanted.
# Steps to examine stdout/stderr for sub-strings.
@@ -116,6 +165,9 @@
function: runcmd_stdout_contains
rust:
function: subplotlib::steplibrary::runcmd::stdout_contains
+ doc: |
+ Make sure the standard output of the latest command run by
+ `lib/runcmd` contains the desired sub-string.
- then: 'stdout doesn''t contain "{text:text}"'
impl:
@@ -123,6 +175,9 @@
function: runcmd_stdout_doesnt_contain
rust:
function: subplotlib::steplibrary::runcmd::stdout_doesnt_contain
+ doc: |
+ Make sure the standard output of the latest command run by
+ `lib/runcmd` does not contain the sub-string.
- then: stderr contains "{text:text}"
impl:
@@ -130,6 +185,9 @@
function: runcmd_stderr_contains
rust:
function: subplotlib::steplibrary::runcmd::stderr_contains
+ doc: |
+ Make sure the standard output of the latest command run by
+ `lib/runcmd` contains the desired sub-string.
- then: 'stderr doesn''t contain "{text:text}"'
impl:
@@ -137,6 +195,9 @@
function: runcmd_stderr_doesnt_contain
rust:
function: subplotlib::steplibrary::runcmd::stderr_doesnt_contain
+ doc: |
+ Make sure the standard error output of the latest command run by
+ `lib/runcmd` does not contain the sub-string.
# Steps to match stdout/stderr against regular expressions.
@@ -146,6 +207,9 @@
function: runcmd_stdout_matches_regex
rust:
function: subplotlib::steplibrary::runcmd::stdout_matches_regex
+ doc: |
+ Make sure the standard output of the latest command run by
+ `lib/runcmd` matches the desired regular expression.
- then: stdout doesn't match regex {regex:text}
impl:
@@ -153,6 +217,9 @@
function: runcmd_stdout_doesnt_match_regex
rust:
function: subplotlib::steplibrary::runcmd::stdout_doesnt_match_regex
+ doc: |
+ Make sure the standard output of the latest command run by
+ `lib/runcmd` does not match a regular expression.
- then: stderr matches regex {regex:text}
impl:
@@ -160,6 +227,9 @@
function: runcmd_stderr_matches_regex
rust:
function: subplotlib::steplibrary::runcmd::stderr_matches_regex
+ doc: |
+ Make sure the standard error output of the latest command run by
+ `lib/runcmd` matches the desired regular expression.
- then: stderr doesn't match regex {regex:text}
impl:
@@ -167,3 +237,6 @@
function: runcmd_stderr_doesnt_match_regex
rust:
function: subplotlib::steplibrary::runcmd::stderr_doesnt_match_regex
+ doc: |
+ Make sure the standard error output of the latest command run by
+ `lib/runcmd` does not match a regular expression.