@@ -97,7 +97,9 @@ def main(builtin_params = {}):
97
97
run_tests (tests , litConfig , opts , numTotalTests )
98
98
elapsed = time .time () - start
99
99
100
- print_summary (tests , elapsed , opts )
100
+ executed_tests = [t for t in tests if t .result ]
101
+
102
+ print_summary (executed_tests , elapsed , opts )
101
103
102
104
if opts .output_path :
103
105
write_test_results (tests , litConfig , elapsed , opts .output_path )
@@ -111,7 +113,7 @@ def main(builtin_params = {}):
111
113
if litConfig .numWarnings :
112
114
sys .stderr .write ('\n %d warning(s) in tests.\n ' % litConfig .numWarnings )
113
115
114
- has_failure = any (t .isFailure () for t in tests )
116
+ has_failure = any (t .isFailure () for t in executed_tests )
115
117
if has_failure :
116
118
sys .exit (1 )
117
119
@@ -203,16 +205,10 @@ def progress_callback(test):
203
205
display .print_header ()
204
206
try :
205
207
execute_in_tmp_dir (run , litConfig )
208
+ display .clear (interrupted = False )
206
209
except KeyboardInterrupt :
207
- #TODO(yln): should we attempt to cleanup the progress bar here?
208
- sys .exit (2 )
209
- # TODO(yln): display.finish_interrupted(), which shows the most recently started test
210
- # TODO(yln): change display to update when test starts, not when test completes
211
- # Ensure everything still works with SimpleProgressBar as well
212
- # finally:
213
- # display.clear()
214
-
215
- display .clear ()
210
+ display .clear (interrupted = True )
211
+ print (' [interrupted by user]' )
216
212
217
213
def execute_in_tmp_dir (run , litConfig ):
218
214
# Create a temp directory inside the normal temp directory so that we can
@@ -247,7 +243,7 @@ def execute_in_tmp_dir(run, litConfig):
247
243
248
244
def print_summary (tests , elapsed , opts ):
249
245
if not opts .quiet :
250
- print ('Testing Time: %.2fs' % elapsed )
246
+ print ('\n Testing Time: %.2fs' % elapsed )
251
247
252
248
byCode = {}
253
249
for test in tests :
@@ -296,6 +292,7 @@ def print_summary(tests, elapsed, opts):
296
292
print (' %s: %d' % (name ,N ))
297
293
298
294
def write_test_results (tests , lit_config , elapsed , output_path ):
295
+ # TODO(yln): audit: unexecuted tests
299
296
# Construct the data we will write.
300
297
data = {}
301
298
# Encode the current lit version as a schema version.
@@ -350,6 +347,7 @@ def write_test_results(tests, lit_config, elapsed, output_path):
350
347
f .close ()
351
348
352
349
def write_test_results_xunit (tests , opts ):
350
+ # TODO(yln): audit: unexecuted tests
353
351
from xml .sax .saxutils import quoteattr
354
352
# Collect the tests, indexed by test suite
355
353
by_suite = {}
0 commit comments