[PATCH 078 of 179 tests-refactor] run-tests: move test discovery into TestRunner.run()

Gregory Szorc gregory.szorc at gmail.com
Fri May 2 13:38:35 CDT 2014


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1398013455 25200
#      Sun Apr 20 10:04:15 2014 -0700
# Branch stable
# Node ID 0d99fc077685f2eeaa8b4f5f78763d581cb2480c
# Parent  1da4323a9c6cdcf34e7f15e34fdecb3cf5086910
run-tests: move test discovery into TestRunner.run()

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1007,22 +1007,24 @@ class TestRunner(object):
             '!': [],
             '~': [],
             's': [],
             'i': [],
         }
         self.abort = [False]
         self._createdfiles = []
 
-    def run(self, tests):
+    def run(self, args):
         """Run the test suite."""
 
         # Be kind and try to clean up after ourselves.
         oldenv = dict(os.environ)
         try:
+            tests = self.findtests(args)
+
             return self._run(tests)
         finally:
             os.environ.clear()
             os.environ.update(oldenv)
 
     def _run(self, tests):
         if self.options.random:
             random.shuffle(tests)
@@ -1461,14 +1463,12 @@ def main(args, runner=None, parser=None)
 
     parser = parser or getparser()
     (options, args) = parseargs(args, parser)
     runner.options = options
     os.umask(022)
 
     runner.checktools()
 
-    tests = runner.findtests(args)
-
-    return runner.run(tests)
+    return runner.run(args)
 
 if __name__ == '__main__':
     sys.exit(main(sys.argv[1:]))


More information about the Mercurial-devel mailing list