def stdlib(request): """handles requests to /stdlib/ which can either run tests one by one, or can specify the test name to be run""" test_path = sys.prefix + r'\Lib\test' if test_path not in sys.path: sys.path.append(test_path) url = request.path[8:] if url.endswith('/'): url = url[:-1] sys.stdout = sys.stderr = StringIO() if not url: # no test specified, run tests one-by-one using regrtest import regrtest cur_argv = list(sys.argv) sys.argv.extend(KNOWN_FAILURES) result = '' try: try: res = regrtest.main(single=True, exclude=True, verbose = True) finally: sys.argv[:] = cur_argv except SystemExit, se: if se.code != 0: result = '<font color=red>Test failed</font>' else: result = '<font color=green>Test passed</font>' html = "<html><body>" + result + "<br>" + sys.stdout.getvalue().replace('\n', '<br>') + "</body></html>"
# This should be equivalent to running regrtest.py from the cmdline. # It can be especially handy if you're in an interactive shell, e.g., # from test import autotest. import regrtest regrtest.main()
def main(): tests = regrtest.findtests('.') regrtest.main( tests, testdir = '.' )
# Backward compatibility -- you should use regrtest instead of this module. import sys, regrtest sys.argv[1:] = ["-vv"] regrtest.main()