From a6bf8bf49b97116e8a028aadad46b838eddfefe9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sat, 8 Nov 2025 15:43:21 +0100 Subject: [PATCH 1/2] Add glob command to find MASA metadata in renderer tests --- scripts/parse_commands.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/parse_commands.py b/scripts/parse_commands.py index b86751fb6c..3dc190c08e 100644 --- a/scripts/parse_commands.py +++ b/scripts/parse_commands.py @@ -86,7 +86,7 @@ if __name__ == '__main__': # Relies on the list being sorted i = 0 while i + 1 < len(cmds_enc): - if " ".join(cmds_enc[i].split()[:-1]) == " ".join(cmds_enc[i+1].split()[:-1]): + if cmds_enc[i].split()[:-1] == cmds_enc[i+1].split()[:-1]: del cmds_enc[i+1] else: i = i + 1 @@ -185,6 +185,7 @@ if __name__ == '__main__': with open('scripts/rend_header.txt','r') as header: outfile.write(header.read()) for cmd in cmds_rend: + absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) args = [] for arg in cmd.split(): # Adjust file arguments, pass other arguments as they are @@ -200,8 +201,14 @@ if __name__ == '__main__': if "ref" in cmd: outfile.write(cmd+'\n') out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd) + if out and "ref" in out.group(1): - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/renderer_short/ref',REF_PATH + r'/renderer_short/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') + diff_cmds=[] + for output in glob.glob(absolute_out.group(1) + '*'): + output = path.relpath(output).replace('\\','/') + output = re.sub('tests', CUT_PATH, output) + diff_cmds.append('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/renderer_short/ref',REF_PATH + r'/renderer_short/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') + outfile.write(('; ').join(diff_cmds)) outfile.write('\n') with open('scripts/script_footer.txt','r') as footer: outfile.write(footer.read()) -- GitLab From 4a43f947b00ad0fcbcc88f23e0bd2984b73693e5 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sat, 8 Nov 2025 20:48:21 +0100 Subject: [PATCH 2/2] Fix for multiple renderer outputs --- scripts/parse_commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/parse_commands.py b/scripts/parse_commands.py index 3dc190c08e..c3f8d43f59 100644 --- a/scripts/parse_commands.py +++ b/scripts/parse_commands.py @@ -185,7 +185,8 @@ if __name__ == '__main__': with open('scripts/rend_header.txt','r') as header: outfile.write(header.read()) for cmd in cmds_rend: - absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) + absolute_out = re.search(r"-o ([^>]+\.wav)", cmd) + args = [] for arg in cmd.split(): # Adjust file arguments, pass other arguments as they are @@ -207,7 +208,7 @@ if __name__ == '__main__': for output in glob.glob(absolute_out.group(1) + '*'): output = path.relpath(output).replace('\\','/') output = re.sub('tests', CUT_PATH, output) - diff_cmds.append('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/renderer_short/ref',REF_PATH + r'/renderer_short/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') + diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'/renderer_short/ref',REF_PATH + r'/renderer_short/ref')+' '+ output +' >> $LOG_FILE 2>&1') outfile.write(('; ').join(diff_cmds)) outfile.write('\n') with open('scripts/script_footer.txt','r') as footer: -- GitLab