From: Ben Darnell Date: Sun, 29 May 2011 22:04:24 +0000 (-0700) Subject: Add script to run test suite with multiple python versions at once X-Git-Tag: v2.0.0~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63a161f596ab166d54e525eaa6185067ea76c891;p=thirdparty%2Ftornado.git Add script to run test suite with multiple python versions at once --- diff --git a/tornado/test/run_pyversion_tests.py b/tornado/test/run_pyversion_tests.py new file mode 100755 index 000000000..8c4e9671c --- /dev/null +++ b/tornado/test/run_pyversion_tests.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +"""Runs the tornado test suite with all supported python interpreters.""" + +import os +import subprocess +import sys + +INTERPRETERS = [ + "python2.5", + "python2.6", + "python2.7", + "auto2to3", + "pypy", + ] + +def exists_on_path(filename): + for dir in os.environ["PATH"].split(":"): + if os.path.exists(os.path.join(dir, filename)): + return True + return False + +def main(): + for interpreter in INTERPRETERS: + print "=================== %s =======================" % interpreter + if not exists_on_path(interpreter): + print "Interpreter not found, skipping..." + continue + args = [interpreter, "-m", "tornado.test.runtests"] + sys.argv[1:] + ret = subprocess.call(args) + if ret != 0: + print "Tests on %s failed with exit code %d" % (interpreter, ret) + sys.exit(ret) + print "All tests passed" + +if __name__ == "__main__": + main()