@@ -131,12 +131,11 @@ def main_with_tmp(builtinParameters):
131
131
if not opts .quiet :
132
132
print ('Testing Time: %.2fs' % (testing_time ,))
133
133
134
+ print_summary (tests , opts )
135
+
134
136
# Write out the test data, if requested.
135
- if opts .output_path is not None :
137
+ if opts .output_path :
136
138
write_test_results (tests , litConfig , testing_time , opts .output_path )
137
-
138
- hasFailures = print_summary (tests , opts )
139
-
140
139
if opts .xunit_output_file :
141
140
write_test_results_xunit (tests , opts )
142
141
@@ -149,7 +148,8 @@ def main_with_tmp(builtinParameters):
149
148
if litConfig .numWarnings :
150
149
sys .stderr .write ('\n %d warning(s) in tests.\n ' % litConfig .numWarnings )
151
150
152
- if hasFailures :
151
+ has_failure = any (t .result .code .isFailure for t in tests )
152
+ if has_failure :
153
153
sys .exit (1 )
154
154
155
155
@@ -260,14 +260,11 @@ def progress_callback(test):
260
260
return testing_time
261
261
262
262
def print_summary (tests , opts ):
263
- hasFailures = False
264
263
byCode = {}
265
264
for test in tests :
266
265
if test .result .code not in byCode :
267
266
byCode [test .result .code ] = []
268
267
byCode [test .result .code ].append (test )
269
- if test .result .code .isFailure :
270
- hasFailures = True
271
268
272
269
# Print each test in any of the failing groups.
273
270
for title ,code in (('Unexpected Passing Tests' , lit .Test .XPASS ),
@@ -308,7 +305,6 @@ def print_summary(tests, opts):
308
305
N = len (byCode .get (code ,[]))
309
306
if N :
310
307
print (' %s: %d' % (name ,N ))
311
- return hasFailures
312
308
313
309
def write_test_results (tests , lit_config , testing_time , output_path ):
314
310
# Construct the data we will write.
0 commit comments