From: Peter Hutterer Date: Wed, 16 Oct 2024 01:21:29 +0000 (+1000) Subject: test: move the deviceless check into ltest_add_tcase X-Git-Tag: 1.27.0~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1575fbce5418b2b0eddeaac99f0f0b4492630b0;p=platform%2Fupstream%2Flibinput.git test: move the deviceless check into ltest_add_tcase This is out of place here, check this when we are about to add the test, not later when the tests are about to be run. Part-of: --- diff --git a/test/litest.c b/test/litest.c index 1706c2fb..02a4252c 100644 --- a/test/litest.c +++ b/test/litest.c @@ -398,6 +398,9 @@ litest_add_tcase_for_device(struct suite *suite, { struct test *t; + if (run_deviceless) + return; + t = zalloc(sizeof(*t)); t->name = safe_strdup(funcname); t->devname = safe_strdup(dev->shortname); @@ -424,6 +427,9 @@ litest_add_tcase_no_device(struct suite *suite, fnmatch(filter_device, test_name, 0) != 0) return; + if (run_deviceless) + return; + t = zalloc(sizeof(*t)); t->name = safe_strdup(test_name); t->devname = safe_strdup("no device"); @@ -1024,14 +1030,6 @@ litest_run_suite(struct list *suites, int which, int max, int error_fd) TCase *tc; char *sname, *tname; - /* We run deviceless tests as part of the normal - * test suite runner, just in case. Filtering - * all the other ones out just for the case where - * we can't run the full runner. - */ - if (run_deviceless && !t->deviceless) - continue; - count = (count + 1) % max; if (max != 1 && (count % max) != which) continue;