Commit 9e24930d authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-33718: regrtest keeps filters to re-run fails (GH-7291)

* No longer clear filters, like --match, to re-run failed tests in
  verbose mode (-w option).
* Tests result: always indicate if tests have been interrupted.
* Enhance tests summary
parent 56013218
...@@ -282,7 +282,6 @@ class Regrtest: ...@@ -282,7 +282,6 @@ class Regrtest:
self.ns.verbose = True self.ns.verbose = True
self.ns.failfast = False self.ns.failfast = False
self.ns.verbose3 = False self.ns.verbose3 = False
self.ns.match_tests = None
print() print()
print("Re-running failed tests in verbose mode") print("Re-running failed tests in verbose mode")
...@@ -313,7 +312,7 @@ class Regrtest: ...@@ -313,7 +312,7 @@ class Regrtest:
return return
print() print()
print("== Tests result ==") print("== Tests result: %s ==" % self.get_tests_result())
if self.interrupted: if self.interrupted:
print() print()
...@@ -324,11 +323,6 @@ class Regrtest: ...@@ -324,11 +323,6 @@ class Regrtest:
print(count(len(omitted), "test"), "omitted:") print(count(len(omitted), "test"), "omitted:")
printlist(omitted) printlist(omitted)
if self.rerun:
print()
print(count(len(self.rerun), "test"), "re-run tests:")
printlist(self.rerun)
if self.good and not self.ns.quiet: if self.good and not self.ns.quiet:
print() print()
if (not self.bad if (not self.bad
...@@ -361,6 +355,11 @@ class Regrtest: ...@@ -361,6 +355,11 @@ class Regrtest:
print(count(len(self.skipped), "test"), "skipped:") print(count(len(self.skipped), "test"), "skipped:")
printlist(self.skipped) printlist(self.skipped)
if self.rerun:
print()
print("%s:" % count(len(self.rerun), "re-run test"))
printlist(self.rerun)
def run_tests_sequential(self): def run_tests_sequential(self):
if self.ns.trace: if self.ns.trace:
import trace import trace
...@@ -445,6 +444,21 @@ class Regrtest: ...@@ -445,6 +444,21 @@ class Regrtest:
% (locale.getpreferredencoding(False), % (locale.getpreferredencoding(False),
sys.getfilesystemencoding())) sys.getfilesystemencoding()))
def get_tests_result(self):
result = []
if self.bad:
result.append("FAILURE")
elif self.ns.fail_env_changed and self.environment_changed:
result.append("ENV CHANGED")
if self.interrupted:
result.append("INTERRUPTED")
if not result:
result.append("SUCCESS")
return ', '.join(result)
def run_tests(self): def run_tests(self):
# For a partial run, we do not need to clutter the output. # For a partial run, we do not need to clutter the output.
if (self.ns.header if (self.ns.header
...@@ -486,16 +500,7 @@ class Regrtest: ...@@ -486,16 +500,7 @@ class Regrtest:
print() print()
duration = time.monotonic() - self.start_time duration = time.monotonic() - self.start_time
print("Total duration: %s" % format_duration(duration)) print("Total duration: %s" % format_duration(duration))
print("Tests result: %s" % self.get_tests_result())
if self.bad:
result = "FAILURE"
elif self.interrupted:
result = "INTERRUPTED"
elif self.ns.fail_env_changed and self.environment_changed:
result = "ENV CHANGED"
else:
result = "SUCCESS"
print("Tests result: %s" % result)
if self.ns.runleaks: if self.ns.runleaks:
os.system("leaks %d" % os.getpid()) os.system("leaks %d" % os.getpid())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment