(trunk-1567) setup.py: Allow running tests via `python setup.py test`

This commit is contained in:
Stephen Boddy 2015-07-02 21:34:18 +02:00
parent 77bb9d5a3d
commit 49f4f18f6d
1 changed files with 15 additions and 1 deletions

View File

@ -149,6 +149,20 @@ class InstallData(install_data):
return data_files return data_files
class Test(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
import sys
errno = subprocess.call(['bash', 'run_tests'])
raise SystemExit(errno)
if platform.system() in ['FreeBSD', 'OpenBSD']: if platform.system() in ['FreeBSD', 'OpenBSD']:
man_dir = 'man' man_dir = 'man'
@ -181,7 +195,7 @@ setup(name=APP_NAME.capitalize(),
packages=['terminatorlib', 'terminatorlib.configobj', packages=['terminatorlib', 'terminatorlib.configobj',
'terminatorlib.plugins'], 'terminatorlib.plugins'],
package_data={'terminatorlib': ['preferences.glade', 'layoutlauncher.glade']}, package_data={'terminatorlib': ['preferences.glade', 'layoutlauncher.glade']},
cmdclass={'build': BuildData, 'install_data': InstallData, 'uninstall': Uninstall}, cmdclass={'build': BuildData, 'install_data': InstallData, 'uninstall': Uninstall, 'test':Test},
distclass=TerminatorDist distclass=TerminatorDist
) )