setup.py: Allow running tests via `python setup.py test`

This commit is contained in:
bryce 2015-06-22 17:40:27 -07:00
parent 0f201ade0f
commit 11ec7ab649
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
) )