Mercurial > public > mercurial-scm > hg-stable
diff tests/run-tests.py @ 34270: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 |
line wrap: on
line diff
--- a/tests/run-tests.py Mon Sep 18 15:34:50 2017 -0400 +++ b/tests/run-tests.py Mon Sep 18 17:11:32 2017 -0400 @@ -303,6 +303,8 @@ help="skip tests listed in the specified blacklist file") parser.add_option("--whitelist", action="append", help="always run tests listed in the specified whitelist file") + parser.add_option("--test-list", action="append", + help="read tests to run from the specified file") parser.add_option("--changed", type="string", help="run tests that are changed in parent rev or working directory") parser.add_option("-C", "--annotate", action="store_true", @@ -2279,6 +2281,10 @@ # positional arguments are paths to test files to run, so # we make sure they're all bytestrings args = [_bytespath(a) for a in args] + if options.test_list is not None: + for listfile in options.test_list: + with open(listfile, 'rb') as f: + args.extend(t for t in f.read().splitlines() if t) self.options = options self._checktools()