##// END OF EJS Templates
run-tests.py: Allow environment variables to set jobs/timeout/port.
Thomas Arendsen Hein -
r6366:07c3cd69 default
parent child Browse files
Show More
@@ -24,6 +24,12 b" SKIPPED_PREFIX = 'skipped: '"
24
24
25 required_tools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"]
25 required_tools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"]
26
26
27 defaults = {
28 'jobs': ('HGTEST_JOBS', 1),
29 'timeout': ('HGTEST_TIMEOUT', 180),
30 'port': ('HGTEST_PORT', 20059),
31 }
32
27 parser = optparse.OptionParser("%prog [options] [tests]")
33 parser = optparse.OptionParser("%prog [options] [tests]")
28 parser.add_option("-C", "--annotate", action="store_true",
34 parser.add_option("-C", "--annotate", action="store_true",
29 help="output files annotated with coverage")
35 help="output files annotated with coverage")
@@ -36,19 +42,23 b' parser.add_option("-f", "--first", actio'
36 parser.add_option("-i", "--interactive", action="store_true",
42 parser.add_option("-i", "--interactive", action="store_true",
37 help="prompt to accept changed output")
43 help="prompt to accept changed output")
38 parser.add_option("-j", "--jobs", type="int",
44 parser.add_option("-j", "--jobs", type="int",
39 help="number of jobs to run in parallel")
45 help="number of jobs to run in parallel"
46 " (default: $%s or %d)" % defaults['jobs'])
40 parser.add_option("--keep-tmpdir", action="store_true",
47 parser.add_option("--keep-tmpdir", action="store_true",
41 help="keep temporary directory after running tests (best used with --tmpdir)")
48 help="keep temporary directory after running tests"
49 " (best used with --tmpdir)")
42 parser.add_option("-R", "--restart", action="store_true",
50 parser.add_option("-R", "--restart", action="store_true",
43 help="restart at last error")
51 help="restart at last error")
44 parser.add_option("-p", "--port", type="int",
52 parser.add_option("-p", "--port", type="int",
45 help="port on which servers should listen")
53 help="port on which servers should listen"
54 " (default: $%s or %d)" % defaults['port'])
46 parser.add_option("-r", "--retest", action="store_true",
55 parser.add_option("-r", "--retest", action="store_true",
47 help="retest failed tests")
56 help="retest failed tests")
48 parser.add_option("-s", "--cover_stdlib", action="store_true",
57 parser.add_option("-s", "--cover_stdlib", action="store_true",
49 help="print a test coverage report inc. standard libraries")
58 help="print a test coverage report inc. standard libraries")
50 parser.add_option("-t", "--timeout", type="int",
59 parser.add_option("-t", "--timeout", type="int",
51 help="kill errant tests after TIMEOUT seconds")
60 help="kill errant tests after TIMEOUT seconds"
61 " (default: $%s or %d)" % defaults['timeout'])
52 parser.add_option("--tmpdir", type="string",
62 parser.add_option("--tmpdir", type="string",
53 help="run tests in the given temporary directory")
63 help="run tests in the given temporary directory")
54 parser.add_option("-v", "--verbose", action="store_true",
64 parser.add_option("-v", "--verbose", action="store_true",
@@ -56,7 +66,9 b' parser.add_option("-v", "--verbose", act'
56 parser.add_option("--with-hg", type="string",
66 parser.add_option("--with-hg", type="string",
57 help="test existing install at given location")
67 help="test existing install at given location")
58
68
59 parser.set_defaults(jobs=1, port=20059, timeout=180)
69 for option, default in defaults.items():
70 defaults[option] = os.environ.get(*default)
71 parser.set_defaults(**defaults)
60 (options, args) = parser.parse_args()
72 (options, args) = parser.parse_args()
61 verbose = options.verbose
73 verbose = options.verbose
62 coverage = options.cover or options.cover_stdlib or options.annotate
74 coverage = options.cover or options.cover_stdlib or options.annotate
General Comments 0
You need to be logged in to leave comments. Login now