redo-log: add automated tests, and fix some path bugs revealed by them.

When a log for X was saying it wanted to refer to Y, we used a relative
path, but it was sometimes relative to the wrong starting location, so
redo-log couldn't find it later.

Two examples:

 - if default.o.do is handling builds for a/b/x.o, and default.o.do
   does 'redo a/b/x.h', the log for x.o should refer to ./x.h, not
   a/b/x.h.

 - if foo.do is handling builds for foo, and it does
   "cd a/b && redo x", the log for foo should refer to a/b/x, not just
   x.
This commit is contained in:
Avery Pennarun 2018-11-19 17:09:40 -05:00
commit 4edb6f78e0
10 changed files with 125 additions and 20 deletions

5
t/370-logs/x.do Normal file
View file

@ -0,0 +1,5 @@
read pid <pid
echo "$pid x stdout"
echo "$pid x stderr" >&2
rm -f y
redo y