14
14
15
15
#
16
16
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' )
19
20
20
21
#
21
22
def parse_args ():
22
23
args = parser .parse_args ()
23
24
dir_rt = args .dir_rt
24
25
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 )
26
28
27
29
#
28
30
def main ():
29
31
#
30
- (dir_rt , dir_bl ) = parse_args ()
32
+ (dir_rt , dir_bl , no_plots ) = parse_args ()
31
33
32
34
#
33
35
error_count = 0
@@ -38,14 +40,17 @@ def main():
38
40
com = "cmp " + file_rt + " " + file_bl + " > logfile.txt"
39
41
result = os .system (com )
40
42
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 )
42
47
error_count = error_count + 1
43
48
else :
44
49
print ("Output for " + run ["case" ]+ "_" + run ["suite" ]+ " is IDENTICAL to baseline" )
45
50
# end if
46
51
47
52
# Create plots between RTs and baselines (only if differences exist)
48
- if (result != 0 ):
53
+ if (result != 0 and not no_plots ):
49
54
plot_files = plot_results (file_bl , file_rt )
50
55
51
56
# Setup output directories for plots.
@@ -71,7 +76,8 @@ def main():
71
76
# end for
72
77
73
78
# 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/*' )
75
81
76
82
#
77
83
if error_count == 0 :
0 commit comments