mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 23:50:03 -06:00
fca43ccd47
Currently, our test script forwards a select few command line arguments to nosetests. This patch removes the filtering, passing all arguments through. This allows things like disabling output redirection (--nocapture), dropping into a debugger (--pdb, --pdb-failures), coverage reporting (--with-cover, if installed), etc. https://fedorahosted.org/freeipa/ticket/2135
57 lines
1.0 KiB
Python
Executable File
57 lines
1.0 KiB
Python
Executable File
#!/usr/bin/python
|
|
|
|
"""
|
|
Run IPA unit tests under multiple versions of Python (if present).
|
|
"""
|
|
|
|
import sys
|
|
import optparse
|
|
import os
|
|
from os import path
|
|
from subprocess import call
|
|
|
|
versions = ('2.4', '2.5', '2.6', '2.7')
|
|
python = '/usr/bin/python'
|
|
nose = '/usr/bin/nosetests'
|
|
ran = []
|
|
fail = []
|
|
|
|
cmd = [
|
|
nose,
|
|
'-v',
|
|
'--with-doctest',
|
|
'--doctest-tests',
|
|
'--exclude=plugins',
|
|
]
|
|
cmd += sys.argv[1:]
|
|
|
|
|
|
# This must be set so ipalib.api gets initialized property for tests:
|
|
os.environ['IPA_UNIT_TEST_MODE'] = 'cli_test'
|
|
|
|
if not path.isfile(nose):
|
|
print 'ERROR: need %r' % nose
|
|
sys.exit(100)
|
|
for v in versions:
|
|
pver = python + v
|
|
if not path.isfile(pver):
|
|
continue
|
|
command = [pver] + cmd
|
|
print ' '.join(cmd)
|
|
if 0 != call(cmd):
|
|
fail.append(pver)
|
|
ran.append(pver)
|
|
|
|
|
|
print '=' * 70
|
|
for pver in ran:
|
|
if pver in fail:
|
|
print 'FAILED under %r' % pver
|
|
else:
|
|
print 'passed under %r' % pver
|
|
print ''
|
|
if fail:
|
|
print '** FAIL **'
|
|
else:
|
|
print '** pass **'
|