All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Drew Fustini <drew@pdp7.com>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [PATCH v5 0/7] gpio: expose line bias flags to userspace
Date: Tue, 5 Nov 2019 13:34:51 +0800	[thread overview]
Message-ID: <20191105053451.GA32084@sol> (raw)
In-Reply-To: <20191105001213.GA3685@sol>

On Tue, Nov 05, 2019 at 08:12:13AM +0800, Kent Gibson wrote:
> On Mon, Nov 04, 2019 at 11:58:38AM -0800, Drew Fustini wrote:
> > On Mon, Nov 04, 2019 at 11:38:34PM +0800, Kent Gibson wrote:
> > > on a Raspberry Pi, in both cases using the feature/pud_set_config 
> > > branch of my Go gpiod library[2], as well as with my feature/pud 
> > > development branch of libgpiod[3].  Patch 7 has only been tested using 
> > > my gpiod library as libgpiod has not yet been updated to support the 
> > > SET_CONFIG ioctl.
> > > 
> > > Patch 1 adds pull-up/pull-down support to line handle requests.
> > > Patch 2 adds pull-up/pull-down support to line event requests.
> > > Patch 3 adds support for disabling bias.
> > > Patch 4 adds support for setting bias on output lines.
> > > Patch 5 adds pull-up/down support to the gpio-mockup for uAPI testing.
> > > Patch 6 refactors the flag validation from linehandle_create.
> > > Patch 7 adds the SET_CONFIG ioctl.
> > 
> > Hi Kent, thanks for continuing pushing this patch series forward.
> > 
> > I've not used gpiomockup before and I was hoping you might be able to share
> > the commands you use to run it to test the patches.
> > 
> 
> I refer you to the libgpiod tests, particularly
> libgpiod/tests/mockup/gpio-mockup.c as well as gpio/gpio-mockup.c
> itself.
> 
> If you run the libgpiod tests they will load and manipulate the module
> themselves.  My gpiod tests do similarly.  I run them in a VM to ensure
> they can't interfere with real hardware by accident.
> 

It occurs to me that you might want to know how to run the Go tests that
I'm refering to when I say I've tested against gpio-mockup using gpiod.
While that is probably obvious for Go developers, it probably isn't 
so obvious for kernel developers.

So here is a quick guide for running the gpiod tests:

1. Install Go[1].

2. Checkout gpiod:
  git clone https://github.com/warthog618/gpiod.git

3. The uapi sub-package contains the tests for the uapi itself so
  cd gpiod/uapi

4. Checkout the appropriate branch - in this case 
  git checkout feature/pud_set_config

5. Build the tests
  go test -c

6. Run the tests (requires modprobe rights hence the sudo)
  sudo ./uapi.test

You can get a list of the tests being run by adding a --test.v
parameter to uapi.test, or run particular tests with 
  uapi.test --test.run [pattern]

The tests themselves are in uapi_test.go, in case you get errors or want
to see what they do.  The gpio-mockup wrapper is in gpiod/mockup.

There are also tests for gpiod itself in gpiod/*_test.go, though 
those focus on the gpiod library rather than the uapi and kernel.

Cheers,
Kent.

[1] https://golang.org/doc/install


      reply	other threads:[~2019-11-05  5:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 15:38 [PATCH v5 0/7] gpio: expose line bias flags to userspace Kent Gibson
2019-11-04 15:38 ` [PATCH v5 1/7] gpio: expose pull-up/pull-down line " Kent Gibson
2019-11-04 15:38 ` [PATCH v5 2/7] gpiolib: add support for pull up/down to lineevent_create Kent Gibson
2019-11-04 15:38 ` [PATCH v5 3/7] gpiolib: add support for disabling line bias Kent Gibson
2019-11-04 15:38 ` [PATCH v5 4/7] gpiolib: add support for biasing output lines Kent Gibson
2019-11-04 15:50   ` Bartosz Golaszewski
2019-11-04 15:59     ` Kent Gibson
2019-11-04 16:19       ` Bartosz Golaszewski
2019-11-05  2:03         ` Kent Gibson
2019-11-05  6:06           ` Kent Gibson
2019-11-05  9:10             ` Bartosz Golaszewski
2019-11-04 15:38 ` [PATCH v5 5/7] gpio: mockup: add set_config to support pull up/down Kent Gibson
2019-11-04 15:38 ` [PATCH v5 6/7] gpiolib: move validation of line handle flags into helper function Kent Gibson
2019-11-04 15:38 ` [PATCH v5 7/7] gpio: add new SET_CONFIG ioctl() to gpio chardev Kent Gibson
2019-11-04 19:58 ` [PATCH v5 0/7] gpio: expose line bias flags to userspace Drew Fustini
2019-11-05  0:12   ` Kent Gibson
2019-11-05  5:34     ` Kent Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191105053451.GA32084@sol \
    --to=warthog618@gmail.com \
    --cc=drew@pdp7.com \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.