Add a redo-ifcreate test.
Turns out we weren't testing this one at all, which is a shame, because it totally didn't work.
This commit is contained in:
parent
e6f95521ae
commit
f16f0147b1
7 changed files with 40 additions and 2 deletions
|
|
@ -14,5 +14,6 @@ try:
|
|||
sys.exit(1)
|
||||
else:
|
||||
f.add_dep('c', t)
|
||||
state.commit()
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(200)
|
||||
|
|
|
|||
3
t/.gitignore
vendored
3
t/.gitignore
vendored
|
|
@ -18,3 +18,6 @@ test2.args
|
|||
/deltest2
|
||||
/always1
|
||||
/always1.log
|
||||
/ifcreate[12].log
|
||||
/ifcreate[12].dep
|
||||
/ifcreate[12]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
redo example/clean curse/clean deps/clean "space dir/clean" stamp/clean
|
||||
rm -f c c.c c.c.c c.c.c.b c.c.c.b.b d mode1 makedir.log chdir1 deltest2 \
|
||||
hello [by]ellow *.o *~ .*~ *.log CC LD passfail silence silence.do \
|
||||
touch1 touch1.do always1
|
||||
touch1 touch1.do always1 ifcreate[12].dep ifcreate[12]
|
||||
rm -rf makedir
|
||||
|
|
|
|||
21
t/ifcreate-test.do
Normal file
21
t/ifcreate-test.do
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
rm -f exists ifcreate[12] ifcreate[12].log ifcreate[12].dep
|
||||
. ./skip-if-minimal-do.sh
|
||||
touch exists
|
||||
redo-ifcreate exists 2>/dev/null && exit 91
|
||||
rm exists
|
||||
redo-ifcreate exists || exit 92
|
||||
|
||||
for d in 1 2; do
|
||||
redo ifcreate$d
|
||||
[ "$(wc -l <ifcreate$d.log)" -eq 1 ] || exit ${d}1
|
||||
redo-ifchange ifcreate$d
|
||||
[ "$(wc -l <ifcreate$d.log)" -eq 1 ] || exit ${d}2
|
||||
./flush-cache.sh
|
||||
touch ifcreate$d.dep
|
||||
redo-ifchange ifcreate$d
|
||||
[ "$(wc -l <ifcreate$d.log)" -eq 2 ] || exit ${d}3
|
||||
./flush-cache.sh
|
||||
rm ifcreate$d.dep
|
||||
redo-ifchange ifcreate$d
|
||||
[ "$(wc -l <ifcreate$d.log)" -eq 3 ] || exit ${d}4
|
||||
done
|
||||
6
t/ifcreate1.do
Normal file
6
t/ifcreate1.do
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
if [ -e ifcreate1.dep ]; then
|
||||
redo-ifchange ifcreate1.dep
|
||||
else
|
||||
redo-ifcreate ifcreate1.dep
|
||||
fi
|
||||
echo $$ >>ifcreate1.log
|
||||
7
t/ifcreate2.do
Normal file
7
t/ifcreate2.do
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
cd ..
|
||||
if [ -e t/ifcreate2.dep ]; then
|
||||
redo-ifchange t/ifcreate2.dep
|
||||
else
|
||||
redo-ifcreate t/ifcreate2.dep
|
||||
fi
|
||||
echo $$ >>t/ifcreate2.log
|
||||
|
|
@ -2,4 +2,4 @@ redo-ifchange all
|
|||
./hello >&2
|
||||
redo deltest deltest2 test.args test2.args passfailtest chdirtest \
|
||||
curse/test deps/test "space dir/test" modetest makedir2 \
|
||||
silencetest touchtest stamp/test alwaystest
|
||||
silencetest touchtest stamp/test alwaystest ifcreate-test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue