t/deps/dirtest: test correct dependency checking for targets named 'dirname'

We had a bug (fixed in the previous commit) where doing 'redo-ifchange
dirname' (which runs dirname/all.do) would not create the stamp correctly,
so that it would always show up as dirty.

It's a little bit complicated to simulate, but this does it.
This commit is contained in:
Avery Pennarun 2010-11-22 22:50:54 -08:00
commit ac36c5bbb1
10 changed files with 34 additions and 2 deletions

19
t/deps/dirtest/test.do Normal file
View file

@ -0,0 +1,19 @@
touch t?.do
for first in t1 t2 t3; do
for second in t1 t2 t3; do
rm -f log dir1/log dir1/stinky
. ../../flush-cache.sh
redo $first
touch $second.do
. ../../flush-cache.sh
redo $second
. ../../flush-cache.sh
redo-ifchange $second
C1="$(wc -l <dir1/log)"
C2="$(wc -l <log)"
if [ "$C1" != 1 -o "$C2" != 2 ]; then
echo "failed: $first>$second, c1=$C1, c2=$C2" >&2
exit 55
fi
done
done