]> Cypherpunks.ru repositories - goredo.git/blob - t/apenwarr/010-jobserver/first.do
Import tests from apenwarr/redo and redo.sh
[goredo.git] / t / apenwarr / 010-jobserver / first.do
1 # in case we're (erroneously) running in parallel, give second.do some
2 # time to start but not finish.
3 echo 'first sleep' >&2
4 sleep 1
5
6 # Because of --shuffle, we can't be sure if first or second ran first, but
7 # because all.do uses -j1, we *should* expect that if second ran first, it
8 # at least ran to completion before we ran at all.
9 if [ -e second.start ]; then
10         echo 'first: second already started before we did...' >&2
11         [ -e second.end ] || exit 21
12         echo 'first: ...and it finished as it should.' >&2
13         # no sense continuing the test; can't test anything if second already
14         # ran.
15         exit 0
16 fi
17 echo 'first: second has not started yet, good.' >&2
18
19 echo 'first spin' >&2
20 redo 1.a.spin
21 [ -e 1.a.spin ] || exit 11
22 echo 'first spin complete' >&2
23
24 ! [ -e second.start ] || exit 22