test: only abort when we fail to add any tests and we have no filters

This prevents any tests from being added but not run in the normal setup. But
as soon as filters are manually specified on the list proceed anyway.
Otherwise it's impossible to run specific sets of tests, e.g. things like
running all tests applicable to a specific device with
   --filter-device=foo

Now that all tests are in the same binary we are guaranteed that at least some
tests don't apply, so the above was guaranteed to abort.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2016-08-23 10:39:16 +10:00
parent a43042425e
commit ad2a51152f

View file

@ -646,7 +646,10 @@ litest_add_tcase(const char *suite_name,
}
}
if (!added) {
if (!added &&
filter_test == NULL &&
filter_device == NULL &&
filter_group == NULL) {
fprintf(stderr, "Test '%s' does not match any devices. Aborting.\n", funcname);
abort();
}