This exposes a standard interface for getting the number of tests in a profile, which is itself nice. It will also allow us to encapsulate the differences between the various profiles added in this series. --- framework/profile.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/framework/profile.py b/framework/profile.py index b6deed0..925271e 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -284,6 +284,9 @@ class TestProfile(object): 'ignore_missing': False, } + def __len__(self): + return sum(1 for _ in self.itertests()) + def setup(self): """Method to do pre-run setup.""" @@ -381,15 +384,12 @@ def run(profiles, logger, backend, concurrency): """ chunksize = 1 - # The logger needs to know how many tests are running. Because of filters - # there's no way to do that without making a concrete list out of the - # filters profiles. - profiles = [(p, list(p.itertests())) for p in profiles] - log = LogManager(logger, sum(len(l) for _, l in profiles)) + profiles = [(p, p.itertests()) for p in profiles] + log = LogManager(logger, sum(len(p) for p, _ in profiles)) # check that after the filters are run there are actually tests to run. - if not any(l for _, l in profiles): - raise exceptions.PiglitUserError('no matching tests') + # if not any(l for _, l in profiles): + # raise exceptions.PiglitUserError('no matching tests') def test(name, test, profile, this_pool=None): """Function to call test.execute from map""" -- git-series 0.9.1 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit