Mercurial > hg
comparison tests/run-tests.py @ 34263:1533371769b5
tests: add support for listing tests to run in a file
This will make it easier for us to run the tests in the python3
whitelist in buildbot.
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 18 Sep 2017 17:11:32 -0400 |
parents | 40313c63da87 |
children | 8999851a503f |
comparison
equal
deleted
inserted
replaced
34262:68c96a552c84 | 34263:1533371769b5 |
---|---|
301 # keep these sorted | 301 # keep these sorted |
302 parser.add_option("--blacklist", action="append", | 302 parser.add_option("--blacklist", action="append", |
303 help="skip tests listed in the specified blacklist file") | 303 help="skip tests listed in the specified blacklist file") |
304 parser.add_option("--whitelist", action="append", | 304 parser.add_option("--whitelist", action="append", |
305 help="always run tests listed in the specified whitelist file") | 305 help="always run tests listed in the specified whitelist file") |
306 parser.add_option("--test-list", action="append", | |
307 help="read tests to run from the specified file") | |
306 parser.add_option("--changed", type="string", | 308 parser.add_option("--changed", type="string", |
307 help="run tests that are changed in parent rev or working directory") | 309 help="run tests that are changed in parent rev or working directory") |
308 parser.add_option("-C", "--annotate", action="store_true", | 310 parser.add_option("-C", "--annotate", action="store_true", |
309 help="output files annotated with coverage") | 311 help="output files annotated with coverage") |
310 parser.add_option("-c", "--cover", action="store_true", | 312 parser.add_option("-c", "--cover", action="store_true", |
2277 parser = parser or getparser() | 2279 parser = parser or getparser() |
2278 options, args = parseargs(args, parser) | 2280 options, args = parseargs(args, parser) |
2279 # positional arguments are paths to test files to run, so | 2281 # positional arguments are paths to test files to run, so |
2280 # we make sure they're all bytestrings | 2282 # we make sure they're all bytestrings |
2281 args = [_bytespath(a) for a in args] | 2283 args = [_bytespath(a) for a in args] |
2284 if options.test_list is not None: | |
2285 for listfile in options.test_list: | |
2286 with open(listfile, 'rb') as f: | |
2287 args.extend(t for t in f.read().splitlines() if t) | |
2282 self.options = options | 2288 self.options = options |
2283 | 2289 |
2284 self._checktools() | 2290 self._checktools() |
2285 testdescs = self.findtests(args) | 2291 testdescs = self.findtests(args) |
2286 if options.profile_runner: | 2292 if options.profile_runner: |