Skip to content

Commit

Permalink
Add test suite to setup.py for Python driver IngresDBI
Browse files Browse the repository at this point in the history
This will allow buildbot to run tests easily.



git-svn-id: http://code.ingres.com/ingres/drivers/python/main@4033 45b5d43f-8932-4c86-835a-3654e5842839
  • Loading branch information
clach04 committed Jan 6, 2011
1 parent f9e06cd commit 5d75422
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 15 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -300,6 +313,7 @@
'Classifier: Topic :: Database :: Database Engines/Servers',
],
download_url="http://ingres.com/",
cmdclass = {'test': TestSuite},
),

# -*- coding: ascii -*-
Expand Down

0 comments on commit 5d75422

Please sign in to comment.