Commit f1a719ff authored by Jan Kiene's avatar Jan Kiene
Browse files

reintroduce explicit args

parent ec6d8eae
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -4,16 +4,20 @@ import sys


THRESH = 0.01
COLS = [
    [3, 5, 7, 9],  # wmops_all
    [3, 5, 7, 8, 10, 12, 13, 15, 17],  # ram_all
    [3, 5, 7, 9, 11, 13, 15, 17, 19],  # rom_all
]
COLS_WMOPS = [3, 5, 7, 9]
COLS_RAM = [3, 5, 7, 8, 10, 12, 13, 15, 17]
COLS_ROM = [3, 5, 7, 9, 11, 13, 15, 17, 19]


def main(logfiles):
def main(args):
    linewise_logfiles = [*args.wmops_logfiles, *args.ram_logfiles, args.rom_logfile]
    cols = (
        len(args.wmops_logfiles) * [COLS_WMOPS]
        + len(args.ram_logfiles) * [COLS_RAM]
        + [COLS_ROM]
    )
    changes_found_linewise = any(
        [check_linewise_logfile(f, c) for f, c in zip(logfiles, COLS)]
        [check_linewise_logfile(f, c) for f, c in zip(linewise_logfiles, cols)]
    )

    if changes_found_linewise:
@@ -58,7 +62,9 @@ def check_linewise_logfile(filepath, cols):

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("logfiles", nargs="+")
    parser.add_argument("--wmops_logfiles", nargs="+")
    parser.add_argument("--ram_logfiles", nargs="+")
    parser.add_argument("rom_logfile")
    args = parser.parse_args()

    sys.exit(main(args.logfiles))
    sys.exit(main(args))
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ else
  python3 ci/complexity_measurements/genWebpageData.py --wmops_per_op_log ${wmopsFilenameFlc}_WMOPS.csv --rom_log ${log_rom_all}
fi

python3 ${scriptDir}/check_for_changes.py $(ls ${destDir}/wmops/log_wmops_all*.txt) $(ls ${destDir}/wmops/log_ram_all*.txt) ${destDir}/wmops/log_rom_all.txt
python3 ${scriptDir}/check_for_changes.py --wmops_logfiles $(ls ${destDir}/wmops/log_wmops_all*.txt) --ram_logfiles $(ls ${destDir}/wmops/log_ram_all*.txt) ${destDir}/wmops/log_rom_all.txt
if [ "$?" != "0" ]; then
  ret_val=1
fi