apenwarr-redo/t/stamp/stamptest.do
Avery Pennarun 22617d335c Half-support for using file checksums instead of stamps.
A new redo-stamp program takes whatever you give it as stdin and uses it to
calculate a checksum for the current target.  If that checksum is the same
as last time, then we consider the target to be unchanged, and we set
checked_runid and stamp, but leave changed_runid alone.  That will make
future callers of redo-ifchange see this target as unmodified.

However, this is only "half" support because by the time we run the .do
script that calls redo-stamp, it's too late; the caller is a dependant of
the stamped program, which is already being rebuilt, even if redo-stamp
turns out to say that this target is unchanged.

The other half is coming up.
2010-12-11 05:54:37 -08:00

29 lines
733 B
Text

rm -f stampy usestamp stampy.log usestamp.log
echo one >inp
../flush-cache.sh
redo stampy
[ "$(wc -l <stampy.log)" -eq 1 ] || exit 11
redo-ifchange usestamp
[ "$(wc -l <stampy.log)" -eq 1 ] || exit 21
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 12
../flush-cache.sh
redo stampy
[ "$(wc -l <stampy.log)" -eq 2 ] || exit 31
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 32
redo-ifchange usestamp
[ "$(wc -l <stampy.log)" -eq 2 ] || exit 41
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 42
../flush-cache.sh
echo two >inp
redo stampy
[ "$(wc -l <stampy.log)" -eq 3 ] || exit 51
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 52
redo-ifchange usestamp
[ "$(wc -l <stampy.log)" -eq 3 ] || exit 61
[ "$(wc -l <usestamp.log)" -eq 2 ] || exit 62