diff -r f00c1b696e86 Lib/test/regrtest.py --- a/Lib/test/regrtest.py Mon Jan 24 19:19:01 2011 +0100 +++ b/Lib/test/regrtest.py Wed Jan 26 23:58:38 2011 +0100 @@ -42,6 +42,9 @@ -- specify which special resource intensive tests to run -M/--memlimit LIMIT -- run very large memory-consuming tests + --testdir DIR + -- execute test files in the specified directory (instead + of the Python stdlib test suite) Special runs @@ -265,7 +268,7 @@ 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir', 'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=', 'multiprocess=', 'coverage', 'slaveargs=', 'forever', 'debug', - 'start=', 'nowindows', 'header']) + 'start=', 'nowindows', 'header', 'testdir=']) except getopt.error as msg: usage(msg) @@ -386,6 +389,14 @@ print() # Force a newline (just in case) print(json.dumps(result)) sys.exit(0) + elif o == '--testdir': + # CWD is replaced with a temporary dir before calling main(), so we + # need to check if it's a relative path, and join it with the + # saved CWD + if os.path.isabs(a): + testdir = a + else: + testdir = os.path.join(support.SAVEDCWD, a) else: print(("No handler for option {}. Please report this as a bug " "at http://bugs.python.org.").format(o), file=sys.stderr)