run-command tests: test stdout of run_command_parallel()

Extend the tests added in c553c72eed (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 fd3aaf53f7 (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>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2022-10-29 04:59:47 +02:00 committed by Taylor Blau
parent ac48da5a92
commit fe004a4333

View File

@ -130,7 +130,8 @@ World
EOF EOF
test_expect_success 'run_command runs in parallel with more jobs available than tasks' ' test_expect_success 'run_command runs in parallel with more jobs available than tasks' '
test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual test_cmp expect actual
' '
@ -141,7 +142,8 @@ test_expect_success 'run_command runs ungrouped in parallel with more jobs avail
' '
test_expect_success 'run_command runs in parallel with as many jobs as tasks' ' test_expect_success 'run_command runs in parallel with as many jobs as tasks' '
test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual test_cmp expect actual
' '
@ -152,7 +154,8 @@ test_expect_success 'run_command runs ungrouped in parallel with as many jobs as
' '
test_expect_success 'run_command runs in parallel with more tasks than jobs available' ' test_expect_success 'run_command runs in parallel with more tasks than jobs available' '
test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual test_cmp expect actual
' '
@ -172,7 +175,8 @@ asking for a quick stop
EOF EOF
test_expect_success 'run_command is asked to abort gracefully' ' test_expect_success 'run_command is asked to abort gracefully' '
test-tool run-command run-command-abort 3 false 2>actual && test-tool run-command run-command-abort 3 false >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual test_cmp expect actual
' '
@ -187,7 +191,8 @@ no further jobs available
EOF EOF
test_expect_success 'run_command outputs ' ' test_expect_success 'run_command outputs ' '
test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" >out 2>actual &&
test_must_be_empty out &&
test_cmp expect actual test_cmp expect actual
' '