* [PATCH, applied] tests/update-test-output.py: Adapt to some broken test output
@ 2023-04-26 12:08 Dodji Seketeli
0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2023-04-26 12:08 UTC (permalink / raw)
To: libabigail
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-26 12:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 12:08 [PATCH, applied] tests/update-test-output.py: Adapt to some broken test output Dodji Seketeli
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).