diff --git a/buildtests/runtests.py b/buildtests/runtests.py index c1405c7..7e39a48 100755 --- a/buildtests/runtests.py +++ b/buildtests/runtests.py @@ -98,10 +98,12 @@ def runtests(alltests, filters=None, configfile=None, run_executable=1): tests = [] for part in filters: tests += [t for t in alltests if part in t and t not in tests] - tests.sort(key=lambda x: (len(x), x)) # test1 < test10 + + tests = [(len(x), x) for x in tests] + tests.sort() path = os.environ["PATH"] counter = dict(passed=[],failed=[]) - for test in tests: + for _,test in tests: test = os.path.splitext(os.path.basename(test))[0] _msg("BUILDING TEST", test) prog = string.join([PYTHON, PYOPTS, os.path.join(HOME, 'Build.py'), @@ -144,8 +146,12 @@ if __name__ == '__main__': interactive_tests = glob.glob('test*i.spec') from optparse import OptionParser - parser = OptionParser(usage="%prog [options] [TEST-NAME ...]", - epilog="TEST-NAME can be the name of the .py-file, the .spec-file or only the basename.") + if sys.version_info < (2,4): + parser = OptionParser(usage="%prog [options] [TEST-NAME ...]") + else: + parser = OptionParser(usage="%prog [options] [TEST-NAME ...]", + epilog="TEST-NAME can be the name of the .py-file, the .spec-file or only the basename.") + parser.add_option('-c', '--clean', action='store_true', help='Clean up generated files') parser.add_option('-i', '--interactive-tests', action='store_true',