From: Bartosz Golaszewski Date: Wed, 15 Mar 2017 13:48:59 +0000 (+0100) Subject: tests: add support for named lines X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=173990921ea720c15e391e071db34db29bc4deb0;p=qemu-gpiodev%2Flibgpiod.git tests: add support for named lines If the named_lines field is true in the test description, pass an additional module parameter to gpio-mockup to have the GPIO lines named. Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/unit/gpiod-unit.c b/tests/unit/gpiod-unit.c index edb30b9..8c3a1da 100644 --- a/tests/unit/gpiod-unit.c +++ b/tests/unit/gpiod-unit.c @@ -296,11 +296,8 @@ static void test_load_module(struct _gu_chip_descr *descr) modarg = xappend(modarg, "-1,%u,", descr->num_lines[i]); modarg[strlen(modarg) - 1] = '\0'; /* Remove the last comma. */ - /* - * TODO Once the support for named lines in the gpio-mockup module - * is merged upstream, implement checking the named_lines field of - * the test description and setting the corresponding module param. - */ + if (descr->named_lines) + modarg = xappend(modarg, " gpio_mockup_named_lines"); status = kmod_module_probe_insert_module(globals.module, 0, modarg, NULL, NULL, NULL);