Overridden files were accidentally getting reclassified as static.
This is relatively harmless, since we treat them *almost* identically, except that we print a warning for overridden files to remind you that something fishy is going on. Add a test for the actual warning message to ensure it is printed. (I don't like tests for specific warning messages, but it was necessary in this case.)
This commit is contained in:
parent
8100aa4973
commit
90989d1ffb
8 changed files with 46 additions and 3 deletions
|
|
@ -170,7 +170,8 @@ class _BuildJob(object):
|
|||
# to produce hello.c, but we don't want that to happen if
|
||||
# hello.c was created by the end user.
|
||||
debug2("-- static (%r)\n" % t)
|
||||
sf.set_static()
|
||||
if not sf.is_override:
|
||||
sf.set_static()
|
||||
sf.save()
|
||||
return self._finalize(0)
|
||||
sf.zap_deps1()
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
redo test1 test2 ifchange-fail overwrite gentest doublestatic \
|
||||
basic/test
|
||||
basic/test override/all
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
redo basic/clean
|
||||
redo basic/clean override/clean
|
||||
rm -f *~ .*~ *.count t1a overwrite overwrite[123] \
|
||||
genfile2 genfile.log static.log
|
||||
|
|
|
|||
4
t/350-deps/override/.gitignore
vendored
Normal file
4
t/350-deps/override/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
a
|
||||
b
|
||||
*.log
|
||||
stamp
|
||||
1
t/350-deps/override/a.do
Normal file
1
t/350-deps/override/a.do
Normal file
|
|
@ -0,0 +1 @@
|
|||
echo hello-a >$3
|
||||
34
t/350-deps/override/all.do
Normal file
34
t/350-deps/override/all.do
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
exec >&2
|
||||
rm -f a b *.log stamp
|
||||
|
||||
echo 1 >stamp
|
||||
redo b
|
||||
[ "$(cat b)" = "hello-a-1-b" ] || exit 11
|
||||
|
||||
../../flush-cache
|
||||
echo 2 >stamp
|
||||
redo-ifchange b
|
||||
[ "$(cat b)" = "hello-a-1-b" ] || exit 21 # a unchanged; b not redone
|
||||
|
||||
. ../../skip-if-minimal-do.sh
|
||||
|
||||
# Unfortunately the test below depends on the specific wording of the
|
||||
# "override" warning message, of the form:
|
||||
# redo: a - you modified it; skipping
|
||||
# That's because this is specifically a test that the warning message
|
||||
# gets generated. I added that test because (of course) when we didn't
|
||||
# test it, the warning message accidentally got broken. Oops. If you
|
||||
# rephrase the message, you'll have to also change the test.
|
||||
|
||||
../../flush-cache
|
||||
echo 3 >stamp
|
||||
echo over-a >a
|
||||
redo-ifchange b >$1.log 2>&1
|
||||
[ "$(cat b)" = "over-a-3-b" ] || exit 31 # a overwritten, b redone
|
||||
grep "a - " "$1.log" >/dev/null || exit 32 # expected a warning msg
|
||||
|
||||
../../flush-cache
|
||||
echo 4 >stamp
|
||||
redo-ifchange b >$1.log 2>&1
|
||||
[ "$(cat b)" = "over-a-3-b" ] || exit 41 # a not changed, b not redone
|
||||
grep "a - " "$1.log" >/dev/null || exit 42 # still expect a warning msg
|
||||
2
t/350-deps/override/b.do
Normal file
2
t/350-deps/override/b.do
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
redo-ifchange a
|
||||
printf '%s-%s-b\n' "$(cat a)" "$(cat stamp)" >$3
|
||||
1
t/350-deps/override/clean.do
Normal file
1
t/350-deps/override/clean.do
Normal file
|
|
@ -0,0 +1 @@
|
|||
rm -f *~ .*~ stamp *.log a b
|
||||
Loading…
Add table
Add a link
Reference in a new issue