From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] tests/update-test-output.py: Adapt to some broken test output
Date: Wed, 26 Apr 2023 14:08:15 +0200 [thread overview]
Message-ID: <87ildi9780.fsf@redhat.com> (raw)
Hello,
Sometimes, the output of runtestreaddwarf or runtestannotate are
broken due the fact that they execute test units in parallel and each
unit might emit output that watch on each other toes.
This fixes tests/update-test-output.py to take that into account.
As this is a helper tool used to update updates, it won't have any
impact on libabigail's output.
* tests/update-test-output.py (process): Don't expect the start
pattern of the main diff hunk to begin at the end of a line
because that can be broken for runtestreaddwarf and co.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
tests/update-test-output.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/tests/update-test-output.py b/tests/update-test-output.py
index 39d96d72..7e321911 100755
--- a/tests/update-test-output.py
+++ b/tests/update-test-output.py
@@ -54,17 +54,20 @@ def main():
def process(input_file):
- source = ""
- dest = ""
+ source = None
+ dest = None
for line in input_file:
- m = re.match(r'^--- (.*?)\t', line)
+ m = re.match(r'(.*?)--- (.*?)\t', line)
if m:
- dest = m.group(1)
+ dest = m.group(2)
else:
- m = re.match(r'^\+\+\+ (.*?)\t', line)
+ m = re.match(r'(.*?)\+\+\+ (.*?)\t', line)
if m:
- source = m.group(1)
- sys.stdout.write("cp " + source + " " + dest + "\n");
+ source = m.group(2)
+ if source != None and dest != None:
+ sys.stdout.write("cp " + source + " " + dest + "\n");
+ source = None
+ dest = None
if __name__ == "__main__":
main()
--
2.39.1
--
Dodji
reply other threads:[~2023-04-26 12:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ildi9780.fsf@redhat.com \
--to=dodji@redhat.com \
--cc=libabigail@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).