diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2012-04-17 12:08:07 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2012-04-18 18:45:29 -0700 |
commit | dc82a01d295058a752c0a5a2a9feb4c863405b4f (patch) | |
tree | c08de7da193d1e318f58dd7df5d24c4cf4bcf6b4 /framework | |
parent | a9c68fef7d0a2d59c69fa5cff1906631e0631e08 (diff) |
framework: Split a TestProfile.prepare_test_list helper out of run().
Before scheduling or running the tests, run() prepared the final list of
tests to run: first, flatten the Group() hierarchy; second, filter out
tests based on the -t and -x options.
It makes sense to have this as a helper function. Doing so will also
enable other utilities that (for example) print a list of tests that
would be run and their command line programs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/core.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/framework/core.py b/framework/core.py index b85072a1..4c255ca7 100644 --- a/framework/core.py +++ b/framework/core.py @@ -510,13 +510,9 @@ class TestProfile: # Clear out the old Group() self.tests = Group() - def run(self, env, json_writer): + def prepare_test_list(self, env): self.flatten_group_hierarchy() - ''' - Schedule all tests in profile for execution. - See ``Test.schedule`` and ``Test.run``. - ''' def matches_any_regexp(x, re_list): return True in map(lambda r: r.search(x) != None, re_list) @@ -528,6 +524,15 @@ class TestProfile: # Filter out unwanted tests self.test_list = dict(filter(test_matches, self.test_list.items())) + def run(self, env, json_writer): + ''' + Schedule all tests in profile for execution. + + See ``Test.schedule`` and ``Test.run``. + ''' + + self.prepare_test_list(env) + # Queue up all the concurrent tests, so the pool is filled # at the start of the test run. if env.concurrent: |