From: José Fonseca Date: Tue, 31 Mar 2009 15:39:11 +0000 (+0100) Subject: python/test: Flush stdout to keep in sync with debug info on stderr. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bdfc411b449b3eafec8fb803fba42fce58a49c32;p=mesa.git python/test: Flush stdout to keep in sync with debug info on stderr. --- diff --git a/src/gallium/state_trackers/python/tests/base.py b/src/gallium/state_trackers/python/tests/base.py index b338f44a252..401095fa908 100644 --- a/src/gallium/state_trackers/python/tests/base.py +++ b/src/gallium/state_trackers/python/tests/base.py @@ -237,21 +237,25 @@ class TestResult: self.rows = [] def test_start(self, test): - print "Running %s..." % test.description() + sys.stdout.write("Running %s...\n" % test.description()) + sys.stdout.flush() self.tests += 1 def test_passed(self, test): - print "PASS" + sys.stdout.write("PASS\n") + sys.stdout.flush() self.passed += 1 self.log_result(test, 'pass') def test_skipped(self, test): - print "SKIP" + sys.stdout.write("SKIP\n") + sys.stdout.flush() self.skipped += 1 #self.log_result(test, 'skip') def test_failed(self, test): - print "FAIL" + sys.stdout.write("FAIL\n") + sys.stdout.flush() self.failed += 1 self.log_result(test, 'fail') @@ -282,7 +286,8 @@ class TestResult: self.rows.append(row) def summary(self): - print "%u tests, %u passed, %u skipped, %u failed" % (self.tests, self.passed, self.skipped, self.failed) + sys.stdout.write("%u tests, %u passed, %u skipped, %u failed\n\n" % (self.tests, self.passed, self.skipped, self.failed)) + sys.stdout.flush() name, ext = os.path.splitext(os.path.basename(sys.argv[0])) filename = name + '.tsv'