[Buildbot-commits] buildbot/buildbot/test test_steps.py,1.48,1.49

Brian Warner warner at users.sourceforge.net
Tue May 27 00:52:31 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11485/buildbot/test

Modified Files:
	test_steps.py 
Log Message:
[project @ #228:perl-module-tests.patch]
Patch by Neil Hemingway <nhemingway at googlemail.com> to add a PerlModuleTest step

Original author: dustin at v.igoro.us
Date: 2008-05-27 00:05:57+00:00

Index: test_steps.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_steps.py,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- test_steps.py	22 May 2008 22:12:57 -0000	1.48
+++ test_steps.py	27 May 2008 00:52:29 -0000	1.49
@@ -639,3 +639,38 @@
                                  "treesize %d KiB" % kib)
         d.addCallback(_check)
         return d
+
+class PerlModuleTest(StepTester, unittest.TestCase):
+    def testAllTestsPassed(self):
+        self.masterbase = "Warnings.testAllTestsPassed"
+        step = self.makeStep(shell.PerlModuleTest)
+        output = \
+"""ok 1
+ok 2
+All tests successful
+Files=1, Tests=123, other stuff
+"""
+        log = step.addLog("stdio")
+        log.addStdout(output)
+        log.finish()
+        step.evaluateCommand(log)
+        self.failUnlessEqual(step.getProperty('tests-failed'), 0)
+        self.failUnlessEqual(step.getProperty('tests-total'), 123)
+        self.failUnlessEqual(step.getProperty('tests-passed'), 123)
+
+    def testFailures(self):
+        self.masterbase = "Warnings.testFailures"
+        step = self.makeStep(shell.PerlModuleTest)
+        output = \
+"""
+ok 1
+ok 2
+3/7 subtests failed
+"""
+        log = step.addLog("stdio")
+        log.addStdout(output)
+        log.finish()
+        step.evaluateCommand(log)
+        self.failUnlessEqual(step.getProperty('tests-failed'), 3)
+        self.failUnlessEqual(step.getProperty('tests-total'), 7)
+        self.failUnlessEqual(step.getProperty('tests-passed'), 4)





More information about the Commits mailing list