run-command tests: test stdout of run_command_parallel()
Extend the tests added in c553c72eed6 (run-command: add an asynchronous parallel child processor, 2015-12-15) to test stdout in addition to stderr. When the "ungroup" feature was added in fd3aaf53f71 (run-command: add an "ungroup" option to run_process_parallel(), 2022-06-07) its tests were made to test both the stdout and stderr, but these existing tests were left alone. Let's also exhaustively test our expected output here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Ævar Arnfjörð Bjarmason committed
Oct 29, 2022 at 04:59 UTC
fe004a43335bb31920dd475aa659d5f037327fcd
1 file changed
+10
-5
t/t0061-run-command.sh
+10
-5
@@ -130,7 +130,8 @@ World
130
EOF
131
132
test_expect_success 'run_command runs in parallel with more jobs available than tasks' '
133
- test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
133
+ test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
134
+ test_must_be_empty out &&
135
test_cmp expect actual
136
'
137
@@ -141,7 +142,8 @@ test_expect_success 'run_command runs ungrouped in parallel with more jobs avail
142
'
143
144
test_expect_success 'run_command runs in parallel with as many jobs as tasks' '
144
- test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
145
+ test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
146
+ test_must_be_empty out &&
147
test_cmp expect actual
148
'
149
@@ -152,7 +154,8 @@ test_expect_success 'run_command runs ungrouped in parallel with as many jobs as
154
'
155
156
test_expect_success 'run_command runs in parallel with more tasks than jobs available' '
155
- test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
157
+ test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
158
+ test_must_be_empty out &&
159
test_cmp expect actual
160
'
161
@@ -172,7 +175,8 @@ asking for a quick stop
175
EOF
176
177
test_expect_success 'run_command is asked to abort gracefully' '
175
- test-tool run-command run-command-abort 3 false 2>actual &&
178
+ test-tool run-command run-command-abort 3 false >out 2>actual &&
179
+ test_must_be_empty out &&
180
test_cmp expect actual
181
'
182
@@ -187,7 +191,8 @@ no further jobs available
191
EOF
192
193
test_expect_success 'run_command outputs ' '
190
- test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual &&
194
+ test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
195
+ test_must_be_empty out &&
196
test_cmp expect actual
197
'
198