From f987530e1513bce793e98a50d297d9ea5c46e56b Mon Sep 17 00:00:00 2001 From: Giovanni La Mura <giovanni.lamura@inaf.it> Date: Mon, 27 May 2024 20:24:15 +0200 Subject: [PATCH] Set line-wise comparison as default and ignore lines starting with "INSERTION:" tag --- src/scripts/pycompare.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/scripts/pycompare.py b/src/scripts/pycompare.py index 193860f0..a5129dec 100755 --- a/src/scripts/pycompare.py +++ b/src/scripts/pycompare.py @@ -115,6 +115,8 @@ def compare_files(config): print("INFO: using line-wise mode") print("INFO: counting result lines...") while (f_lines[0] != ''): + if (c_lines[0].startswith("INSERTION:")): + c_lines = [c_file.readline()] if (c_lines[0] != ''): line_count += 1 else: @@ -166,6 +168,8 @@ def compare_files(config): else: f_lines = [fortran_file.readline()] c_lines = [c_file.readline()] + if (c_lines[0].startswith("INSERTION:")): + c_lines = [c_file.readline()] num_read_lines += 1 # Start here the comparison loop if (len(f_lines) == len(c_lines)): @@ -429,7 +433,7 @@ def parse_arguments(): 'fortran_file_name': '', 'c_file_name': '', 'full_log': False, - 'linewise': False, + 'linewise': True, 'log_html': False, 'html_output': 'pycompare.html', 'warning_threshold': 0.005, @@ -475,7 +479,7 @@ def print_help(): print("--full Print all lines to log file (default prints only mismatches).") print("--help Print this help and exit.") print("--html[=OPT_OUTPUT_NAME] Enable logging to HTML file (default logs to \"pycompare.html\").") - print("--linewise Load only one line at a time. Useful to compare big files (false by default).") + print("--linewise Load only one line at a time. Useful to compare big files (True by default).") print("--quick Stop on first mismatch (default is to perform a full check).") print("--warn Set a fractional threshold for numeric warning (default = 0.005).") print(" ") -- GitLab