Add "test" command to setup.py

"python setup.py test" will now run the complete test suite. Remove the
previous ./test command.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-01-18 22:41:05 +01:00
parent 1f91d0fd06
commit bf1f79c571
4 changed files with 29 additions and 20 deletions

View File

@ -20,11 +20,32 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# END OF COPYRIGHT #
from distutils.core import setup
import os
from distutils.core import setup, Command
import offlineimap
import logging
from test.OLItest import OLITextTestRunner, TestLoader, OLITestLib
class TestCommand(Command):
"""runs the OLI testsuite"""
description = "Runs the test suite"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
logging.basicConfig(format='%(message)s')
# set credentials and OfflineImap command to be executed:
OLITestLib(cred_file='./test/credentials.conf', cmd='./offlineimap.py')
suite = TestLoader().discover('./test/tests')
#TODO: failfast does not seem to exist in python2.6?
OLITextTestRunner(verbosity=2,failfast=True).run(suite)
setup(name = "offlineimap",
version = offlineimap.__version__,
@ -36,6 +57,7 @@ setup(name = "offlineimap",
'offlineimap.repository', 'offlineimap.ui'],
scripts = ['bin/offlineimap'],
license = offlineimap.__copyright__ + \
", Licensed under the GPL version 2"
", Licensed under the GPL version 2",
cmdclass = { 'test': TestCommand}
)