From 1dc72d18cd90340bf4376591180b6958ea863bf3 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 15 Feb 2001 01:23:55 +0000 Subject: We can actually report failed tests now. svn path=/trunk/; revision=3099 --- torturetest.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/torturetest.py b/torturetest.py index a27b358f..6dccb5ea 100755 --- a/torturetest.py +++ b/torturetest.py @@ -76,14 +76,14 @@ class TestSite: def failed(self): "Did we have a test failure here?" - return os.WIFEXITED(self.status) or os.WEXITSTATUS(self.status) > 1 + return os.WIFEXITED(self.status) and os.WEXITSTATUS(self.status) > 1 def explain(self): "Explain the status of the last test." if not os.WIFEXITED(self.status): return self.id() + ": abnormal termination\n" elif os.WEXITSTATUS(self.status) > 1: - return self.id() + ": %d\n" % os.WEXITSTATUS(status) + self.output + return self.id() + ": %d\n" % os.WEXITSTATUS(self.status) + self.output else: return self.id() + ": succeeded\n" @@ -115,7 +115,7 @@ if __name__ == "__main__": # Probe a single site selected = [] for site in sitelist: - if site.id().find(value) > -1: + if `site`.find(value) > -1: selected.append(site) sitelist = selected # Fall through @@ -161,11 +161,8 @@ if __name__ == "__main__": print "Bad status was returned on the following sites:" for site in sitelist: if site.failed(): - sys.stdout.write(self.explain) + sys.stdout.write(site.explain()) except KeyboardInterrupt: print "Interrupted." # end - - - -- cgit v1.2.3