mesontest: Respect repeat argument even when running testsuites

pull/1128/head
Thibault Saunier 8 years ago
parent 1cb9d2bc0d
commit 3d05b91e37
  1. 28
      mesontest.py

@ -164,6 +164,7 @@ class TestHarness:
else:
cmd = test.fname
failling = False
if cmd is None:
res = 'SKIP'
duration = 0.0
@ -217,6 +218,7 @@ class TestHarness:
stde = decode(stde)
if timed_out:
res = 'TIMEOUT'
failling = True
if p.returncode == GNU_SKIP_RETURNCODE:
res = 'SKIP'
elif (not test.should_fail and p.returncode == 0) or \
@ -224,8 +226,14 @@ class TestHarness:
res = 'OK'
else:
res = 'FAIL'
failling = True
returncode = p.returncode
return TestRun(res, returncode, test.should_fail, duration, stdo, stde, cmd, test.env)
result = TestRun(res, returncode, test.should_fail, duration, stdo, stde, cmd, test.env)
if failling:
self.failled_tests.append(result)
return result
def print_stats(self, numlen, tests, name, result, i, logfile, jsonlogfile):
startpad = ' '*(numlen - len('%d' % (i+1)))
@ -298,6 +306,7 @@ class TestHarness:
logfile.write('Log of Meson test suite run on %s.\n\n' %
datetime.datetime.now().isoformat())
for i in range(self.options.repeat):
for i, test in enumerate(filtered_tests):
if test.suite[0] == '':
visible_name = test.name
@ -332,8 +341,23 @@ class TestHarness:
def drain_futures(self, futures, logfile, jsonlogfile):
for i in futures:
(result, numlen, tests, name, i, logfile, jsonlogfile) = i
if not self.options.verbose:
if self.options.repeat > 1 and self.failled_tests:
result.cancel()
elif not self.options.verbose:
self.print_stats(numlen, tests, name, result.result(), i, logfile, jsonlogfile)
else:
result.result()
if self.options.repeat > 1 and self.failled_tests:
if not self.options.verbose:
for res in self.failled_tests:
print('Test failed:\n\n-- stdout --\n')
print(res.stdo)
print('\n-- stderr --\n')
print(res.stde)
return 1
return
def run_special(self):
'Tests run by the user, usually something like "under gdb 1000 times".'

Loading…
Cancel
Save