diff --git a/README.txt b/README.txt index 3656629..60f4a6b 100644 --- a/README.txt +++ b/README.txt @@ -336,6 +336,7 @@ Mac OS X, Linux and Unix 4. Optional, run the test suite: :: env LANG=c python tests/test_ingresdbi_dbapi20.py + env LANG=c python setup.py test Windows diff --git a/setup.py b/setup.py index 714ebdf..4bbb6ea 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. """ -from distutils.core import setup, Extension +from distutils.core import setup, Extension, Command from distutils.util import get_platform import os import sys @@ -165,6 +165,19 @@ # Normal setup.py functions for platform/version packaging +class TestSuite(Command): + user_options = [] + def initialize_options(self): + pass + def finalize_options(self): + pass + def run(self): + print 'About to start test suite' + import subprocess + test_scriptname = os.path.join('tests', 'test_ingresdbi_dbapi20.py') + errno = subprocess.call([sys.executable, test_scriptname]) + raise SystemExit(errno) + # Take a copy of platform incase sys.platform is insufficient and we need more granularity platform=sys.platform @@ -300,6 +313,7 @@ 'Classifier: Topic :: Database :: Database Engines/Servers', ], download_url="http://ingres.com/", + cmdclass = {'test': TestSuite}, ), # -*- coding: ascii -*-