t/curse: test that 'redo' (not redo-ifchange) always redoes a command.
...if the containing .do file is getting redone at all, of course. Currently passes in serial mode, fails in parallel.
This commit is contained in:
parent
8e4bfd10f9
commit
65d4639b48
5 changed files with 21 additions and 4 deletions
2
t/curse/.gitignore
vendored
2
t/curse/.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
*.n1
|
*.n1
|
||||||
*.n2
|
*.n2
|
||||||
*.count
|
*.count
|
||||||
|
*.countall
|
||||||
|
countall
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,18 @@
|
||||||
|
rm -f in.countall out.countall *.count
|
||||||
|
touch in.countall out.countall
|
||||||
|
echo x >x.count
|
||||||
redo-ifchange 1.n0 2.n0 3.n0
|
redo-ifchange 1.n0 2.n0 3.n0
|
||||||
DEPS=$(seq 10 | sed 's/$/.n1/')
|
DEPS=$(seq 10 | sed 's/$/.n1/')
|
||||||
redo-ifchange $DEPS
|
redo-ifchange $DEPS
|
||||||
COUNT=$(cat *.count | wc -l)
|
COUNT_IN=$(ls *.count | wc -l)
|
||||||
if ! [ "$COUNT" = 100 ]; then
|
COUNT_OUT=$(cat *.count | wc -l)
|
||||||
echo "expected 100 writes, got $COUNT" >&2
|
if [ "$COUNT_IN" != "$COUNT_OUT" ]; then
|
||||||
|
echo "expected $COUNT_IN individual writes, got $COUNT_OUT" >&2
|
||||||
exit 42
|
exit 42
|
||||||
fi
|
fi
|
||||||
|
COUNTALL_IN=$(cat in.countall | wc -l)
|
||||||
|
COUNTALL_OUT=$(cat out.countall | wc -l)
|
||||||
|
if [ "$COUNTALL_IN" != "$COUNTALL_OUT" ]; then
|
||||||
|
echo "expected $COUNTALL_IN allwrites, got $COUNTALL_OUT" >&2
|
||||||
|
exit 43
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
rm -f *~ .*~ *.n1 *.n2 *.tmp *.count
|
rm -f *~ .*~ *.n1 *.n2 *.tmp *.count countall *.countall
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
2
t/curse/countall.do
Normal file
2
t/curse/countall.do
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
echo $1 >>out.countall
|
||||||
|
echo hello
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
echo n2-$1
|
echo n2-$1
|
||||||
echo $1 >>$1.count
|
echo $1 >>$1.count
|
||||||
|
echo $1 >>in.countall
|
||||||
|
redo countall
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue