diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-10-14 09:35:39 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-10-14 09:35:39 +0300 |
commit | 739d624d6f60776a9baba905e23c818d23dc52e0 (patch) | |
tree | 55594594602a8a2647dc79b2d0eb0f528142a4f6 /subplot/runcmd.yaml | |
parent | 8cc1a68d733762ad6baaec439360a84ab8450d3a (diff) | |
download | ewww-739d624d6f60776a9baba905e23c818d23dc52e0.tar.gz |
chore: update subplot/runcmd.* from Subplot
Also fix everything that needs fixing. Tests pass.
Diffstat (limited to 'subplot/runcmd.yaml')
-rw-r--r-- | subplot/runcmd.yaml | 86 |
1 files changed, 78 insertions, 8 deletions
diff --git a/subplot/runcmd.yaml b/subplot/runcmd.yaml index 02e5ee1..48dde90 100644 --- a/subplot/runcmd.yaml +++ b/subplot/runcmd.yaml @@ -1,13 +1,83 @@ -- then: exit code is non-zero - function: exit_code_nonzero +# Steps to run commands. -- then: output matches /(?P<pattern>.+)/ - function: stdout_contains +- given: helper script {filename} for runcmd + function: runcmd_helper_script + +- given: srcdir is in the PATH + function: runcmd_helper_srcdir_path + +- when: I run (?P<argv0>\S+)(?P<args>.*) regex: true + function: runcmd_step -- then: stderr matches /(?P<pattern>.+)/ - function: stderr_contains +- when: I try to run (?P<argv0>\S+)(?P<args>.*) regex: true + function: runcmd_try_to_run + +# Steps to examine exit code of latest command. + +- then: exit code is {exit} + function: runcmd_exit_code_is + +- then: exit code is not {exit} + function: runcmd_exit_code_is_not + +- then: command is successful + function: runcmd_exit_code_is_zero + +- then: command fails + function: runcmd_exit_code_is_nonzero + +# Steps to examine stdout/stderr for exact content. + +- then: stdout is exactly "(?P<text>.*)" + regex: true + function: runcmd_stdout_is + +- then: "stdout isn't exactly \"(?P<text>.*)\"" + regex: true + function: runcmd_stdout_isnt + +- then: stderr is exactly "(?P<text>.*)" + regex: true + function: runcmd_stderr_is + +- then: "stderr isn't exactly \"(?P<text>.*)\"" + regex: true + function: runcmd_stderr_isnt + +# Steps to examine stdout/stderr for sub-strings. -- then: program finished successfully - function: exit_code_zero +- then: stdout contains "(?P<text>.*)" + regex: true + function: runcmd_stdout_contains + +- then: "stdout doesn't contain \"(?P<text>.*)\"" + regex: true + function: runcmd_stdout_doesnt_contain + +- then: stderr contains "(?P<text>.*)" + regex: true + function: runcmd_stderr_contains + +- then: "stderr doesn't contain \"(?P<text>.*)\"" + regex: true + function: runcmd_stderr_doesnt_contain + +# Steps to match stdout/stderr against regular expressions. + +- then: stdout matches regex (?P<regex>.*) + regex: true + function: runcmd_stdout_matches_regex + +- then: stdout doesn't match regex (?P<regex>.*) + regex: true + function: runcmd_stdout_doesnt_match_regex + +- then: stderr matches regex (?P<regex>.*) + regex: true + function: runcmd_stderr_matches_regex + +- then: stderr doesn't match regex (?P<regex>.*) + regex: true + function: runcmd_stderr_doesnt_match_regex |