# HG changeset patch # User Gregory Szorc # Date 1398018579 25200 # Node ID 3df2ecf8d54544ee7ca7ed79749b271bf5ba9cf4 # Parent 60f944758ad415f608afb21e471b9dd28190002c run-tests: start to report test results against TestResult Previously, our unittest wrapper didn't report results properly. We now properly report failures. We had to rename the local variable to prevent "t" from being overwritten in the local scope. diff -r 60f944758ad4 -r 3df2ecf8d545 tests/run-tests.py --- a/tests/run-tests.py Sun Apr 20 11:24:37 2014 -0700 +++ b/tests/run-tests.py Sun Apr 20 11:29:39 2014 -0700 @@ -1259,8 +1259,28 @@ def shortDescription(self): return self.name + # Need to stash away the TestResult since we do custom things + # with it. + def run(self, result): + self._result = result + + return super(MercurialTest, self).run(result) + def runTest(self): - t.run() + code, tname, msg = t.run() + + if code == '!': + self._result.failures.append((self, msg)) + elif code == '~': + pass + elif code == '.': + pass + elif code == 's': + pass + elif code == 'i': + pass + else: + self.fail('Unknown test result code: %s' % code) return MercurialTest(test)