diff options
author | David Rousselie <dax@happycoders.org> | 2007-12-12 21:10:10 +0300 |
---|---|---|
committer | David Rousselie <dax@happycoders.org> | 2007-12-12 21:10:10 +0300 |
commit | ebaa5bdc828f9adbea1fe9e3b574a8edba9a84e2 (patch) | |
tree | 4d6d16c3603b7c79d7108e7b12db821ee8244cbe /run_tests.py | |
parent | 8f54ea720f68eb7ca0efd8d1d0eb779ead314301 (diff) |
Add code coverage report
darcs-hash:20071212181010-86b55-7b831a663f431b209c9067947579cbe4c50e42a8.gz
Diffstat (limited to 'run_tests.py')
-rw-r--r-- | run_tests.py | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/run_tests.py b/run_tests.py index 29e2f65..085df7a 100644 --- a/run_tests.py +++ b/run_tests.py @@ -4,24 +4,27 @@ ## Login : David Rousselie <dax@happycoders.org> ## Started on Wed Aug 9 21:37:35 2006 David Rousselie ## $Id$ -## +## ## Copyright (C) 2006 David Rousselie ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. -## +## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. -## +## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## import coverage +coverage.erase() +coverage.start() + import logging import unittest from test import test_support @@ -36,26 +39,34 @@ import jmc import jmc.jabber import jmc.jabber.component -import jmc.tests as jmc +import jmc.tests def suite(): - return jmc.suite() + return jmc.tests.suite() if __name__ == '__main__': + class MyTestProgram(unittest.TestProgram): + def runTests(self): + """run tests but do not exit after""" + if self.testRunner is None: + self.testRunner = unittest.TextTestRunner(verbosity=self.verbosity) + self.testRunner.run(self.test) + logger = logging.getLogger() logger.addHandler(logging.StreamHandler()) logger.setLevel(logging.CRITICAL) - - coverage.erase() - coverage.start() - - unittest.main(defaultTest='suite') - coverage.stop() - coverage.analysis(jmc.jabber.component) - coverage.analysis(jmc.lang) - coverage.analysis(jmc.model.account) + MyTestProgram(defaultTest='suite') - coverage.report([jmc.jabber.component, \ - jmc.lang, \ - jmc.model.account]) +coverage.report(["src/jmc/__init__.py", + "src/jmc/lang.py", + "src/jmc/runner.py", + "src/jmc/jabber/__init__.py", + "src/jmc/jabber/command.py", + "src/jmc/jabber/component.py", + "src/jmc/jabber/disco.py", + "src/jmc/jabber/message.py", + "src/jmc/jabber/presence.py", + "src/jmc/jabber/presence.py", + "src/jmc/model/__init__.py", + "src/jmc/model/account.py"]) |