summaryrefslogtreecommitdiff
path: root/share/python/lib/runcmd.yaml
blob: a01cfac6c58d14c68026dfb96bb4ce39585c1dbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Steps to run commands.

- given: helper script {filename} for runcmd
  impl:
    python:
      function: runcmd_helper_script

- given: srcdir is in the PATH
  impl:
    python:
      function: runcmd_helper_srcdir_path

- when: I run (?P<argv0>\S+)(?P<args>.*)
  regex: true
  impl:
    python:
      function: runcmd_step

- when: I run, in (?P<dirname>\S+), (?P<argv0>\S+)(?P<args>.*)
  regex: true
  impl:
    python:
      function: runcmd_step_in

- when: I try to run (?P<argv0>\S+)(?P<args>.*)
  regex: true
  impl:
    python:
      function: runcmd_try_to_run

- when: I try to run, in (?P<dirname>\S+), (?P<argv0>\S+)(?P<args>.*)
  regex: true
  impl:
    python:
      function: runcmd_try_to_run_in

# Steps to examine exit code of latest command.

- then: exit code is {exit}
  impl:
    python:
      function: runcmd_exit_code_is

- then: exit code is not {exit}
  impl:
    python:
      function: runcmd_exit_code_is_not

- then: command is successful
  impl:
    python:
      function: runcmd_exit_code_is_zero

- then: command fails
  impl:
    python:
      function: runcmd_exit_code_is_nonzero

# Steps to examine stdout/stderr for exact content.

- then: stdout is exactly "(?P<text>.*)"
  regex: true
  impl:
    python:
      function: runcmd_stdout_is

- then: 'stdout isn''t exactly "(?P<text>.*)"'
  regex: true
  impl:
    python:
      function: runcmd_stdout_isnt

- then: stderr is exactly "(?P<text>.*)"
  regex: true
  impl:
    python:
      function: runcmd_stderr_is

- then: 'stderr isn''t exactly "(?P<text>.*)"'
  regex: true
  impl:
    python:
      function: runcmd_stderr_isnt

# Steps to examine stdout/stderr for sub-strings.

- then: stdout contains "(?P<text>.*)"
  regex: true
  impl:
    python:
      function: runcmd_stdout_contains

- then: 'stdout doesn''t contain "(?P<text>.*)"'
  regex: true
  impl:
    python:
      function: runcmd_stdout_doesnt_contain

- then: stderr contains "(?P<text>.*)"
  regex: true
  impl:
    python:
      function: runcmd_stderr_contains

- then: 'stderr doesn''t contain "(?P<text>.*)"'
  regex: true
  impl:
    python:
      function: runcmd_stderr_doesnt_contain

# Steps to match stdout/stderr against regular expressions.

- then: stdout matches regex (?P<regex>.*)
  regex: true
  impl:
    python:
      function: runcmd_stdout_matches_regex

- then: stdout doesn't match regex (?P<regex>.*)
  regex: true
  impl:
    python:
      function: runcmd_stdout_doesnt_match_regex

- then: stderr matches regex (?P<regex>.*)
  regex: true
  impl:
    python:
      function: runcmd_stderr_matches_regex

- then: stderr doesn't match regex (?P<regex>.*)
  regex: true
  impl:
    python:
      function: runcmd_stderr_doesnt_match_regex