tests: add support for named lines
authorBartosz Golaszewski <bartekgola@gmail.com>
Wed, 15 Mar 2017 13:48:59 +0000 (14:48 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 19 Apr 2017 16:34:17 +0000 (18:34 +0200)
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 <bartekgola@gmail.com>
tests/unit/gpiod-unit.c

index edb30b947bd41e3ca610402d902581636e1552b4..8c3a1daea7e163ce58439f9fdf12d91bbd24f152 100644 (file)
@@ -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);