Skip to content

Commit ff1737f

Browse files
committed
add option in RT comparison script to turn off plots (only report differences via command line)
1 parent 7f0ff67 commit ff1737f

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

test/cmp_rt2bl.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@
1414

1515
#
1616
parser = argparse.ArgumentParser()
17-
parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output', required=True)
18-
parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines', required=True)
17+
parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output', required=True)
18+
parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines', required=True)
19+
parser.add_argument('-np', '--no_plots', help='flag to turn off generation of difference plots', required=False, action='store_true')
1920

2021
#
2122
def parse_args():
2223
args = parser.parse_args()
2324
dir_rt = args.dir_rt
2425
dir_bl = args.dir_bl
25-
return (dir_rt, dir_bl)
26+
no_plots = args.no_plots
27+
return (dir_rt, dir_bl, no_plots)
2628

2729
#
2830
def main():
2931
#
30-
(dir_rt, dir_bl) = parse_args()
32+
(dir_rt, dir_bl, no_plots) = parse_args()
3133

3234
#
3335
error_count = 0
@@ -38,14 +40,17 @@ def main():
3840
com = "cmp "+file_rt+" "+file_bl+" > logfile.txt"
3941
result = os.system(com)
4042
if (result != 0):
41-
print("Output for "+run["case"]+"_"+run["suite"]+ " DIFFERS from baseline. Difference plots will be created")
43+
message = "Output for "+run["case"]+"_"+run["suite"]+ " DIFFERS from baseline."
44+
if (not no_plots):
45+
message += " Difference plots will be created."
46+
print(message)
4247
error_count = error_count + 1
4348
else:
4449
print("Output for "+run["case"]+"_"+run["suite"]+ " is IDENTICAL to baseline")
4550
# end if
4651

4752
# Create plots between RTs and baselines (only if differences exist)
48-
if (result != 0):
53+
if (result != 0 and not no_plots):
4954
plot_files = plot_results(file_bl, file_rt)
5055

5156
# Setup output directories for plots.
@@ -71,7 +76,8 @@ def main():
7176
# end for
7277

7378
# Create tarball with plots.
74-
result = os.system('tar -cvf scm_rt_out.tar scm_rt_out/*')
79+
if (not no_plots):
80+
result = os.system('tar -cvf scm_rt_out.tar scm_rt_out/*')
7581

7682
#
7783
if error_count == 0:

0 commit comments

Comments
 (0)