Adrian Schröter
e7fbd5920f
Mon Feb 13 15:52:19 GMT 2012 - aspiers@suse.com Add test suite and fix two bugs it found: 1. --subdir was not working 2. --scm bzr was not working FWIW it also works on SLE11 now. I will issue a separate request for my enhancements to tar_scm, since they are much more intrusive (but have about 90% test coverage). OBS-URL: https://build.opensuse.org/request/show/105040 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-tar_scm?expand=0&rev=32
38 lines
868 B
Python
38 lines
868 B
Python
#!/usr/bin/python
|
|
|
|
import sys
|
|
import unittest
|
|
|
|
from gittests import GitTests
|
|
from svntests import SvnTests
|
|
from hgtests import HgTests
|
|
from bzrtests import BzrTests
|
|
|
|
if __name__ == '__main__':
|
|
suite = unittest.TestSuite()
|
|
testclasses = [
|
|
SvnTests,
|
|
GitTests,
|
|
HgTests,
|
|
BzrTests,
|
|
]
|
|
for testclass in testclasses:
|
|
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(testclass))
|
|
|
|
runner_args = {
|
|
#'verbosity' : 2,
|
|
}
|
|
major, minor, micro, releaselevel, serial = sys.version_info
|
|
if major > 2 or (major == 2 and minor >= 7):
|
|
# New in 2.7
|
|
runner_args['buffer'] = True
|
|
#runner_args['failfast'] = True
|
|
|
|
runner = unittest.TextTestRunner(**runner_args)
|
|
result = runner.run(suite)
|
|
|
|
if result.wasSuccessful():
|
|
sys.exit(0)
|
|
else:
|
|
sys.exit(1)
|