From ad2a51152fe4f4f76f0588a230a53475ab7c72d2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 23 Aug 2016 10:39:16 +1000 Subject: [PATCH] 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 --- test/litest.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/litest.c b/test/litest.c index 9aa2548c..b339df1c 100644 --- a/test/litest.c +++ b/test/litest.c @@ -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(); }