From 89f4e8eefc024a256bee5b38dc5d6a2a1a9bced6 Mon Sep 17 00:00:00 2001 From: Matthias Jordan Date: Sat, 11 Aug 2012 00:57:48 +0200 Subject: [PATCH] Automatically executing tests in directory 'test' --- setup.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6ae1dc39..21d539f4 100755 --- a/setup.py +++ b/setup.py @@ -36,9 +36,23 @@ For further information, please visit the `Radicale Website """ -from distutils.core import setup - +from distutils.core import setup, Command +import unittest import radicale +import sys + + +class RunTests(Command): + user_options = [] + def initialize_options(self): + pass + def finalize_options(self): + pass + def run(self): + tests = unittest.defaultTestLoader.discover("test/python") + result = unittest.TextTestRunner(stream=sys.stdout, verbosity=99)._makeResult() + tests.run(result) + # When the version is updated, ``radicale.VERSION`` must be modified. @@ -59,6 +73,7 @@ setup( "radicale", "radicale.auth", "radicale.rights", "radicale.storage"], provides=["radicale"], scripts=["bin/radicale"], + cmdclass={'test': RunTests}, keywords=["calendar", "addressbook", "CalDAV", "CardDAV"], classifiers=[ "Development Status :: 4 - Beta",