From 5c462c3b9cdba176baae6a161ff75c479ba34c12 Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Sat, 14 May 2011 15:09:34 +0000 Subject: setup.py: add 'test' command to invoke test suite --- diff --git a/setup.py b/setup.py index b51ab57..0624562 100755 --- a/setup.py +++ b/setup.py @@ -23,6 +23,8 @@ from distutils.core import Command, setup from distutils.util import convert_path import glob import os +import subprocess +import sys class install_dbus(Command): # pylint: disable=C0103,R0904 @@ -83,6 +85,21 @@ class install(_install): # pylint: disable=C0103,R0904 sub_commands = _install.sub_commands + [('install_dbus', None)] +class Test(Command): + """Command to run test suite""" + description = 'run test suite' + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + sys.exit(subprocess.call(['tests/runalltests.py'])) + + setup(name='gdatastore', version='0.1', #url='', @@ -90,7 +107,8 @@ setup(name='gdatastore', author='Sascha Silbe', author_email='sascha-pgp@silbe.org', license='GPLv3', - cmdclass={'install': install, 'install_dbus': install_dbus}, + cmdclass={'install': install, 'install_dbus': install_dbus, + 'test': Test}, packages=['gdatastore'], scripts=['bin/gdatastore-service'], ) -- cgit v0.9.1