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:
30
setup.py
30
setup.py
@ -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}
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user