Commit 7774a9d2 authored by norvell's avatar norvell
Browse files

Add diff on metadata output and log diffs

parent f4309524
Loading
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -113,16 +113,9 @@ def test_26252(test_tag, encoder_path, decoder_path, renderer_path):
        subprocess.run([renderer_path] + rend_opts.split()[1:], check = True)

    diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path)
    if ';' in diff_opts:
        cmd1, cmd2 = diff_opts.split(';')
        cmd1 = cmd1.split()
        cmd2 = cmd2.split()        
        result1 = filecmp.cmp(cmd1[0], cmd1[1])
        result2 = filecmp.cmp(cmd2[2], cmd2[3])
    else:
        cmd1 = diff_opts.split()
        result1 = filecmp.cmp(cmd1[0], cmd1[1])
        result2 = True
    if not (result1 and result2):
    result = True
    for cmd in diff_opts.split(';')
        result = result and filecmp.cmp(cmd.split()[0], cmd.split()[1])
    if not result:
        assert False, "Output differs" 
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ DIFF_BIN="diff"
TESTV_PATH="."
REF_PATH="./testv"
CUT_PATH="./TMP_DEC"
LOG_FILE=Readme_IVAS_dec_log.txt

rm -rf $CUT_PATH
mkdir -p $CUT_PATH
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ DIFF_BIN="diff"
TESTV_PATH="."
REF_PATH="./testv"
CUT_PATH="./TMP_ENC"
LOG_FILE=Readme_IVAS_enc_log.txt

rm -rf $CUT_PATH
mkdir -p $CUT_PATH
+15 −5
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import argparse
import re
from os import path
from pathlib import Path
import glob

# Main routine
if __name__ == '__main__':
@@ -51,8 +52,10 @@ if __name__ == '__main__':
                outfile.write(cmd+'\n')
                bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt|.fer))$", cmd)
                if bts:
                    outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'\n')
                    outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+bts.group(1)+'>> $LOG_FILE 2>&1\n')
                outfile.write('\n')
        with open('script_footer.txt','r') as footer:
            outfile.write(footer.read())                        

    with open(txt_file.replace('.','_dec.'),'w', newline='\n') as outfile:
        with open('dec_header.txt','r') as header:
@@ -75,8 +78,13 @@ if __name__ == '__main__':
                outfile.write(cmd+'\n')
                out = re.search(r"\s(([\S]+)(.wav|.raw|.pcm))$", cmd)
                if out:
                    outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+out.group(1)+'\n')
                outfile.write('\n')
                    diff_cmds=[]
                    for output in glob.glob(out.group(1) + '*'):
                        diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'dut',REF_PATH + r'ref')+' '+output+' >> $LOG_FILE 2>&1')
                    outfile.write(diff_cmds.join('; '))
                outfile.write('\n\n')
        with open('script_footer.txt','r') as footer:
            outfile.write(footer.read())                        

    with open(txt_file.replace('.','_rend.'),'w', newline='\n') as outfile:
        with open('rend_header.txt','r') as header:
@@ -96,5 +104,7 @@ if __name__ == '__main__':
                outfile.write(cmd+'\n')
            out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd)
            if out and "cut" in out.group(1):
                outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'renderer/cut',REF_PATH + r'renderer/ref')+' '+out.group(1)+'\n')
                outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'renderer/cut',REF_PATH + r'renderer/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n')
                outfile.write('\n')            
        with open('script_footer.txt','r') as footer:
            outfile.write(footer.read())                
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ DIFF_BIN="diff"
TESTV_PATH="."
REF_PATH="./testv"
CUT_PATH="./TMP_REND"
LOG_FILE=Readme_IVAS_rend_log.txt

rm -rf $CUT_PATH
mkdir -p $CUT_PATH/renderer/cut $CUT_PATH/renderer/data
Loading