summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-05-13 19:46:01 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-05-13 19:48:03 +0200
commit14ce500508c13325a604b76b7b1c5e897768d4ed (patch)
tree4bbc9c33d4a1eb3b63bbad930cf05f981ae822a2 /build-aux
parentacba58ac590e78ecfc528f778fa0285b726176f2 (diff)
downloadbison-14ce500508c13325a604b76b7b1c5e897768d4ed.tar.gz
tests: improve update-test
* build-aux/update-test: When given a directory, use the testsuite.log which it contains. Do not accept empty "from"s, as substituting the empty string with something is rarely a good idea.
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/update-test7
1 files changed, 7 insertions, 0 deletions
diff --git a/build-aux/update-test b/build-aux/update-test
index c3602c5a..d63a95e4 100755
--- a/build-aux/update-test
+++ b/build-aux/update-test
@@ -73,6 +73,11 @@ def diff_to_re(match):
is_diff = True
to.append(l)
if is_diff:
+ # Do not run s//SOMETHING/g (with an emty pattern), that won't
+ # work well...
+ if frm == []:
+ trace("no from for", match.group(1))
+ return
frm = "\n".join(frm)
to = "\n".join(to)
subst[frm] = to
@@ -112,4 +117,6 @@ def process(logfile):
for logfile in args.logs:
trace("FILE:", logfile)
+ if os.path.isdir(logfile):
+ logfile = os.path.join(logfile, 'testsuite.log')
process(logfile)