From 6c299d28b56dd237792cc80c15c6169e701b4a97 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 30 Mar 2010 14:42:23 +0200 Subject: selftest: Use standard subunit command for progress reporting. --- selftest/format-subunit | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'selftest/format-subunit') diff --git a/selftest/format-subunit b/selftest/format-subunit index eba8c31682..6d2ceb1047 100755 --- a/selftest/format-subunit +++ b/selftest/format-subunit @@ -9,6 +9,7 @@ import os import signal import sys import subunithelper +import subunit class PlainFormatter(object): @@ -25,13 +26,19 @@ class PlainFormatter(object): self.summaryfile = summaryfile self.index = 0 self.name = None + self._progress_level = 0 self.totalsuites = totaltests - def testsuite_count(self, count): - self.totalsuites = count - def progress(self, offset, whence): - pass + if whence == subunit.PROGRESS_POP: + self._progress_level -= 1 + elif whence == subunit.PROGRESS_PUSH: + self._progress_level += 1 + elif whence == subunit.PROGRESS_SET: + if self._progress_level == 0: + self.totalsuites = offset + elif whence == subunit.PROGRESS_CUR: + raise NotImplementedError def report_time(self, time): if self.start_time is None: -- cgit