diff --git a/test/cmp_rt2bl.py b/test/cmp_rt2bl.py index f29ed5218..7560d1b61 100755 --- a/test/cmp_rt2bl.py +++ b/test/cmp_rt2bl.py @@ -14,20 +14,22 @@ # parser = argparse.ArgumentParser() -parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output', required=True) -parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines', required=True) +parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output', required=True) +parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines', required=True) +parser.add_argument('-np', '--no_plots', help='flag to turn off generation of difference plots', required=False, action='store_true') # def parse_args(): args = parser.parse_args() dir_rt = args.dir_rt dir_bl = args.dir_bl - return (dir_rt, dir_bl) + no_plots = args.no_plots + return (dir_rt, dir_bl, no_plots) # def main(): # - (dir_rt, dir_bl) = parse_args() + (dir_rt, dir_bl, no_plots) = parse_args() # error_count = 0 @@ -38,14 +40,17 @@ def main(): com = "cmp "+file_rt+" "+file_bl+" > logfile.txt" result = os.system(com) if (result != 0): - print("Output for "+run["case"]+"_"+run["suite"]+ " DIFFERS from baseline. Difference plots will be created") + message = "Output for "+run["case"]+"_"+run["suite"]+ " DIFFERS from baseline." + if (not no_plots): + message += " Difference plots will be created." + print(message) error_count = error_count + 1 else: print("Output for "+run["case"]+"_"+run["suite"]+ " is IDENTICAL to baseline") # end if # Create plots between RTs and baselines (only if differences exist) - if (result != 0): + if (result != 0 and not no_plots): plot_files = plot_results(file_bl, file_rt) # Setup output directories for plots. @@ -71,7 +76,8 @@ def main(): # end for # Create tarball with plots. - result = os.system('tar -cvf scm_rt_out.tar scm_rt_out/*') + if (not no_plots): + result = os.system('tar -cvf scm_rt_out.tar scm_rt_out/*') # if error_count == 0: