Skip to content

Commit 70055d8

Browse files
committed
[lit] Remove return value from print_summary function
llvm-svn: 375047
1 parent bbc56dd commit 70055d8

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

llvm/utils/lit/lit/main.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,11 @@ def main_with_tmp(builtinParameters):
131131
if not opts.quiet:
132132
print('Testing Time: %.2fs' % (testing_time,))
133133

134+
print_summary(tests, opts)
135+
134136
# Write out the test data, if requested.
135-
if opts.output_path is not None:
137+
if opts.output_path:
136138
write_test_results(tests, litConfig, testing_time, opts.output_path)
137-
138-
hasFailures = print_summary(tests, opts)
139-
140139
if opts.xunit_output_file:
141140
write_test_results_xunit(tests, opts)
142141

@@ -149,7 +148,8 @@ def main_with_tmp(builtinParameters):
149148
if litConfig.numWarnings:
150149
sys.stderr.write('\n%d warning(s) in tests.\n' % litConfig.numWarnings)
151150

152-
if hasFailures:
151+
has_failure = any(t.result.code.isFailure for t in tests)
152+
if has_failure:
153153
sys.exit(1)
154154

155155

@@ -260,14 +260,11 @@ def progress_callback(test):
260260
return testing_time
261261

262262
def print_summary(tests, opts):
263-
hasFailures = False
264263
byCode = {}
265264
for test in tests:
266265
if test.result.code not in byCode:
267266
byCode[test.result.code] = []
268267
byCode[test.result.code].append(test)
269-
if test.result.code.isFailure:
270-
hasFailures = True
271268

272269
# Print each test in any of the failing groups.
273270
for title,code in (('Unexpected Passing Tests', lit.Test.XPASS),
@@ -308,7 +305,6 @@ def print_summary(tests, opts):
308305
N = len(byCode.get(code,[]))
309306
if N:
310307
print(' %s: %d' % (name,N))
311-
return hasFailures
312308

313309
def write_test_results(tests, lit_config, testing_time, output_path):
314310
# Construct the data we will write.

0 commit comments

Comments
 (0)