Add a new passfailtest.
This tests that the target file isn't removed or changed if building fails.
This commit is contained in:
parent
39ef065443
commit
e8584c8d76
4 changed files with 36 additions and 1 deletions
1
t/.gitignore
vendored
1
t/.gitignore
vendored
|
|
@ -6,3 +6,4 @@ c.c.c.b.b
|
||||||
d
|
d
|
||||||
test.args
|
test.args
|
||||||
test2.args
|
test2.args
|
||||||
|
/passfail
|
||||||
|
|
|
||||||
6
t/passfail.do
Normal file
6
t/passfail.do
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
echo $$
|
||||||
|
if [ -e pleasefail ]; then
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
28
t/passfailtest.do
Normal file
28
t/passfailtest.do
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
rm -f pleasefail
|
||||||
|
redo passfail
|
||||||
|
if [ ! -e passfail ]; then
|
||||||
|
echo "passfail should exist" >&2
|
||||||
|
exit 42
|
||||||
|
fi
|
||||||
|
PF1=$(cat passfail)
|
||||||
|
touch pleasefail
|
||||||
|
if redo passfail 2>/dev/null; then
|
||||||
|
echo "redo passfail should have failed" >&2
|
||||||
|
exit 42
|
||||||
|
fi
|
||||||
|
if [ ! -e passfail ]; then
|
||||||
|
echo "passfail should STILL exist" >&2
|
||||||
|
exit 42
|
||||||
|
fi
|
||||||
|
PF2=$(cat passfail)
|
||||||
|
if [ "$PF1" != "$PF2" ]; then
|
||||||
|
echo "passfail changed even though it failed" >&2
|
||||||
|
exit 42
|
||||||
|
fi
|
||||||
|
rm -f pleasefail
|
||||||
|
redo passfail || exit 43
|
||||||
|
PF3=$(cat passfail)
|
||||||
|
if [ "$PF1" = "$PF3" ]; then
|
||||||
|
echo "passfail did not change even though it passed" >&2
|
||||||
|
exit 42
|
||||||
|
fi
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
redo-ifchange all
|
redo-ifchange all
|
||||||
./hello >&2
|
./hello >&2
|
||||||
redo deltest deltest2 test.args test2.args curse/test deps/test
|
redo deltest deltest2 test.args test2.args passfailtest curse/test deps/test
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue