@@ -125,7 +125,7 @@ def run_test(args, i, t): # type: (argparse.Namespace, Any, Dict[str,str]) -> i
125
125
_logger .error (u"Parse error %s" , str (e ))
126
126
except KeyboardInterrupt :
127
127
_logger .error (u"""Test interrupted: %s""" , " " .join ([pipes .quote (tc ) for tc in test_command ]))
128
- return 1
128
+ raise
129
129
130
130
failed = False
131
131
@@ -200,21 +200,29 @@ def main(): # type: () -> int
200
200
else :
201
201
ntest = range (0 , len (tests ))
202
202
203
- for i in ntest :
204
- t = tests [i ]
205
- sys .stderr .write ("\r Test [%i/%i] " % (i + 1 , len (tests )))
206
- sys .stderr .flush ()
207
- rt = run_test (args , i , t )
208
- if rt == 1 :
209
- failures += 1
210
- elif rt == UNSUPPORTED_FEATURE :
211
- unsupported += 1
203
+ total = 0
204
+ try :
205
+ for i in ntest :
206
+ t = tests [i ]
207
+ sys .stderr .write ("\r Test [%i/%i] " % (i + 1 , len (tests )))
208
+ sys .stderr .flush ()
209
+ rt = run_test (args , i , t )
210
+ total += 1
211
+ if rt == 1 :
212
+ failures += 1
213
+ elif rt == UNSUPPORTED_FEATURE :
214
+ unsupported += 1
215
+ except KeyboardInterrupt :
216
+ _logger .error ("Tests interrupted" )
212
217
213
218
if failures == 0 and unsupported == 0 :
214
219
_logger .info ("All tests passed" )
215
220
return 0
221
+ elif failures == 0 and unsupported > 0 :
222
+ _logger .warn ("%i tests passed, %i unsupported features" , total - unsupported , unsupported )
223
+ return 0
216
224
else :
217
- _logger .warn ("%i failures, %i unsupported features" , failures , unsupported )
225
+ _logger .warn ("%i tests passed, %i failures, %i unsupported features" , total - ( failures + unsupported ) , failures , unsupported )
218
226
return 1
219
227
220
228
0 commit comments