18
18
print ("for help use --help" )
19
19
sys .exit (2 )
20
20
21
- short_summary = 0
22
- with_file = 1
23
- just_errors = 0
21
+ short_summary = False
22
+ with_file = True
23
+ just_errors = False
24
24
prec = 'x'
25
25
test = 'all'
26
- only_numbers = 0
26
+ only_numbers = False
27
27
test_dir = 'TESTING'
28
28
bin_dir = 'bin/Release'
29
29
64
64
sys .exit (0 )
65
65
else :
66
66
if o in ("-s" , "--short" ):
67
- short_summary = 1
67
+ short_summary = True
68
68
if o in ("-r" , "--run" ):
69
- with_file = 0
69
+ with_file = False
70
70
if o in ("-e" , "--error" ):
71
- just_errors = 1
71
+ just_errors = True
72
72
if o in ( '-p' , '--prec' ):
73
73
prec = a
74
74
if o in ( '-b' , '--bin' ):
78
78
if o in ( '-t' , '--test' ):
79
79
test = a
80
80
if o in ( '-n' , '--number' ):
81
- only_numbers = 1
82
- short_summary = 1
81
+ only_numbers = True
82
+ short_summary = True
83
83
84
84
# process options
85
85
@@ -105,7 +105,7 @@ def run_summary_test( f, cmdline, short_summary):
105
105
nb_test_illegal = 0
106
106
nb_test_info = 0
107
107
108
- if ( with_file ) :
108
+ if with_file :
109
109
if not os .path .exists (cmdline ):
110
110
error_message = cmdline + " file not found"
111
111
r = 1
@@ -142,16 +142,16 @@ def run_summary_test( f, cmdline, short_summary):
142
142
whereisrun = words_in_line .index ("run)" )
143
143
nb_test_run += int (words_in_line [whereisrun - 2 ])
144
144
if (line .find ("out of" )!= - 1 ):
145
- if ( short_summary == 0 ) : print (line , end = ' ' )
145
+ if not short_summary : print (line , end = ' ' )
146
146
whereisout = words_in_line .index ("out" )
147
147
nb_test_fail += int (words_in_line [whereisout - 1 ])
148
148
if ((line .find ("illegal" )!= - 1 ) or (line .find ("Illegal" )!= - 1 )):
149
- if ( short_summary == 0 ): print (line , end = ' ' )
149
+ if not short_summary : print (line , end = ' ' )
150
150
nb_test_illegal += 1
151
151
if (line .find (" INFO" )!= - 1 ):
152
- if ( short_summary == 0 ): print (line , end = ' ' )
152
+ if not short_summary : print (line , end = ' ' )
153
153
nb_test_info += 1
154
- if ( with_file == 1 ) :
154
+ if with_file :
155
155
pipe .close ()
156
156
157
157
f .flush ();
@@ -166,7 +166,7 @@ def run_summary_test( f, cmdline, short_summary):
166
166
except IOError :
167
167
f = sys .stdout
168
168
169
- if ( short_summary == 0 ) :
169
+ if not short_summary :
170
170
print (" " )
171
171
print ("---------------- Testing LAPACK Routines ----------------" )
172
172
print (" " )
@@ -216,7 +216,7 @@ def run_summary_test( f, cmdline, short_summary):
216
216
letter = dtypes [0 ][dtype ]
217
217
name = dtypes [1 ][dtype ]
218
218
219
- if ( short_summary == 0 ) :
219
+ if not short_summary :
220
220
print (" " )
221
221
print ("------------------------- %s ------------------------" % name )
222
222
print (" " )
@@ -249,7 +249,7 @@ def run_summary_test( f, cmdline, short_summary):
249
249
# NEED TO SKIP SOME PRECISION (namely s and c) FOR PROTO MIXED PRECISION TESTING
250
250
if dtest == 17 and (letter == "s" or letter == "c" ):
251
251
continue
252
- if ( with_file == 1 ) :
252
+ if with_file :
253
253
cmdbase = dtests [2 ][dtest ]+ ".out"
254
254
else :
255
255
if dtest == 16 :
@@ -264,7 +264,7 @@ def run_summary_test( f, cmdline, short_summary):
264
264
else :
265
265
# EIG TESTS
266
266
cmdbase = "xeigtst" + letter + " < " + dtests [0 ][dtest ]+ ".in > " + dtests [2 ][dtest ]+ ".out"
267
- if ( not just_errors and not short_summary ) :
267
+ if not just_errors and not short_summary :
268
268
print ("Testing " + name + " " + dtests [1 ][dtest ]+ "-" + cmdbase , end = ' ' )
269
269
# Run the process: either to read the file or run the LAPACK testing
270
270
nb_test = run_summary_test (f , cmdbase , short_summary )
@@ -274,19 +274,19 @@ def run_summary_test( f, cmdline, short_summary):
274
274
list_results [3 ][dtype ]+= nb_test [3 ]
275
275
got_error = nb_test [1 ]+ nb_test [2 ]+ nb_test [3 ]
276
276
277
- if ( not short_summary ) :
278
- if ( nb_test [0 ]> 0 and just_errors == 0 ) :
277
+ if not short_summary :
278
+ if nb_test [0 ] > 0 and not just_errors :
279
279
print ("passed: " + str (nb_test [0 ]))
280
- if ( nb_test [1 ]> 0 ) :
280
+ if nb_test [1 ] > 0 :
281
281
print ("failing to pass the threshold: " + str (nb_test [1 ]))
282
- if ( nb_test [2 ]> 0 ) :
282
+ if nb_test [2 ] > 0 :
283
283
print ("Illegal Error: " + str (nb_test [2 ]))
284
- if ( nb_test [3 ]> 0 ) :
284
+ if nb_test [3 ] > 0 :
285
285
print ("Info Error: " + str (nb_test [3 ]))
286
- if ( got_error > 0 and just_errors == 1 ) :
286
+ if got_error > 0 and just_errors :
287
287
print ("ERROR IS LOCATED IN " + name + " " + dtests [1 ][dtest ]+ " [ " + cmdbase + " ]" )
288
288
print ("" )
289
- if ( just_errors == 0 ) :
289
+ if not just_errors :
290
290
print ("" )
291
291
# elif (got_error>0):
292
292
# print dtests[2][dtest]+".out \t"+str(nb_test[1])+"\t"+str(nb_test[2])+"\t"+str(nb_test[3])
@@ -304,7 +304,7 @@ def run_summary_test( f, cmdline, short_summary):
304
304
list_results [2 ][4 ]+= list_results [2 ][dtype ]
305
305
list_results [3 ][4 ]+= list_results [3 ][dtype ]
306
306
307
- if only_numbers == 1 :
307
+ if only_numbers :
308
308
print (str (list_results [1 ][4 ])+ "\n " + str (list_results [2 ][4 ]+ list_results [3 ][4 ]))
309
309
else :
310
310
print (summary )
0 commit comments