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:
parent
cd853fccfb
commit
ac36c5bbb1
10 changed files with 34 additions and 2 deletions
2
t/deps/dirtest/.gitignore
vendored
Normal file
2
t/deps/dirtest/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
log
|
||||
dir1/stinky
|
||||
1
t/deps/dirtest/clean.do
Normal file
1
t/deps/dirtest/clean.do
Normal file
|
|
@ -0,0 +1 @@
|
|||
rm -f *~ .*~ dir1/*~ dir1/.*~ dir1/stinky dir1/log log
|
||||
2
t/deps/dirtest/dir1/all.do
Normal file
2
t/deps/dirtest/dir1/all.do
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
redo-ifchange stinky
|
||||
echo $$ >>log
|
||||
1
t/deps/dirtest/dir1/stinky.do
Normal file
1
t/deps/dirtest/dir1/stinky.do
Normal file
|
|
@ -0,0 +1 @@
|
|||
echo "I'm stinky"
|
||||
2
t/deps/dirtest/t1.do
Normal file
2
t/deps/dirtest/t1.do
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
redo-ifchange dir1/
|
||||
echo $$ >>log
|
||||
2
t/deps/dirtest/t2.do
Normal file
2
t/deps/dirtest/t2.do
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
redo-ifchange dir1
|
||||
echo $$ >>log
|
||||
2
t/deps/dirtest/t3.do
Normal file
2
t/deps/dirtest/t3.do
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
redo-ifchange dir1/all
|
||||
echo $$ >>log
|
||||
19
t/deps/dirtest/test.do
Normal file
19
t/deps/dirtest/test.do
Normal 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
|
||||
|
|
@ -1 +1,2 @@
|
|||
redo test1 test2 ifchange-fail overwrite basic/test
|
||||
redo test1 test2 ifchange-fail overwrite basic/test dirtest/test
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue