1
2 from buildbot.steps.shell import ShellCommand
3 from buildbot.status.builder import SUCCESS, FAILURE, WARNINGS, SKIPPED
4
6 """A ShellCommand that sniffs subunit output.
7 """
8
17
18 ob = self.ioObverser
19 failures = len(ob.failures)
20 errors = len(ob.errors)
21 skips = len(ob.skips)
22 total = ob.testsRun
23
24 count = failures + errors
25
26 text = [self.name]
27 text2 = ""
28
29 if not count:
30 results = SUCCESS
31 if total:
32 text += ["%d %s" % \
33 (total,
34 total == 1 and "test" or "tests"),
35 "passed"]
36 else:
37 text += ["no tests", "run"]
38 else:
39 results = FAILURE
40 if failures:
41 text.append("%d %s" % \
42 (failures,
43 failures == 1 and "failure" or "failures"))
44 if errors:
45 text.append("%d %s" % \
46 (errors,
47 errors == 1 and "error" or "errors"))
48 text2 = "%d tes%s" % (count, (count == 1 and 't' or 'ts'))
49
50
51 if skips:
52 text.append("%d %s" % (skips,
53 skips == 1 and "skip" or "skips"))
54
55
56
57 self.results = results
58 self.text = text
59 self.text2 = [text2]
60
63
74
75 - def getText(self, cmd, results):
77 - def getText2(self, cmd, results):
79