~sircmpwn/mrsh

785d14ad5e1429f988dc9ea52cb9d25bead6fcb2 — Simon Ser 6 months ago b5318ce
test: add basic async list tests
2 files changed, 25 insertions(+), 0 deletions(-)

A test/async.sh
M test/meson.build
A test/async.sh => test/async.sh +24 -0
@@ 0,0 1,24 @@
#!/bin/sh

echo >&2 "Returns immediately"
(wait)

echo >&2 "Run asynchronous list and wait"
echo a &
wait $!

echo >&2 "Run two asynchronous lists in parallel and wait"
echo a &
p1=$!
echo b &
wait $p1
echo Job 1 exited with status $?
wait $!
echo Job 2 exited with status $?

#echo >&2 "Run asynchronous list, kill it and wait"
#sleep 1000 &
#pid=$!
#kill -kill $pid
#wait $pid
#echo $pid was terminated by a SIG$(kill -l $?) signal.

M test/meson.build => test/meson.build +1 -0
@@ 4,6 4,7 @@ ref_sh = find_program('sh', required: false)
test_files = [
	'conformance/if.sh',

	'async.sh',
	'case.sh',
	'command.sh',
	'for.sh',