Commit 4f5f852e authored by Dylan Baker's avatar Dylan Baker

framework: Exit if a filter removes all tests from a profile

It doesn't makes sense to run if a user has removed all tests from
selected profiles, and currently if all tests are removed, then an
assertion will be hit in the backend that isn't extremely clear about
what went wrong. This should be much easier to understand.

v2: - simplify logic somewhat.
Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Tested-by: Brian Paul <brianp@vmware.com> (v1)
parent 39e9075f
......@@ -387,6 +387,10 @@ def run(profiles, logger, backend, concurrency):
profiles = [(p, list(p.itertests())) for p in profiles]
log = LogManager(logger, sum(len(l) for _, l 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')
def test(name, test, profile, this_pool=None):
"""Function to call test.execute from map"""
with backend.write_test(name) as w:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment