From 4de7342a67e3cf08dabf616e6bbf0bbbae2f507f Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 25 Nov 2015 12:24:43 +0100 Subject: `python setup.py test` will now run the testsuite It's basically a simple wrapper around `cd test/ ; python test.py --local`. --- setup.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 097d8f0..7e1e4f3 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import os -from distutils.core import setup +from distutils.core import setup, Command from DistUtilsExtra.command import * __version__ = '0.5.3' @@ -13,6 +13,22 @@ __version__ = '0.5.3' if os.path.exists('MANIFEST'): os.remove('MANIFEST') + +class PyTest(Command): + user_options = [] + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + import subprocess + import sys + os.chdir('test') + errno = subprocess.call([sys.executable, 'test.py', '--local']) + raise SystemExit(errno) + setup( name='MAT', version=__version__, @@ -34,6 +50,7 @@ setup( ('share/nautilus-python/extensions', ['nautilus/nautilus-mat.py']) ], cmdclass={ + 'test': PyTest, 'build': build_extra.build_extra, 'build_i18n': build_i18n.build_i18n, 'build_help': build_help.build_help, -- cgit v1.3