linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [libgpiod v2][PATCH v4 0/5] tools: improvements for v2
Date: Wed, 16 Nov 2022 08:12:23 +0800	[thread overview]
Message-ID: <Y3Qq512/3lPqc4xt@sol> (raw)
In-Reply-To: <CAMRc=McQQYPRO1NzbJ26SSD+b_Q+-sLiDHCesSn1tcv8nM52sg@mail.gmail.com>

On Tue, Nov 15, 2022 at 03:32:57PM +0100, Bartosz Golaszewski wrote:
> On Tue, Nov 15, 2022 at 4:44 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > On Mon, Nov 14, 2022 at 11:12:25PM +0800, Kent Gibson wrote:
> > > On Mon, Nov 14, 2022 at 03:26:38PM +0100, Bartosz Golaszewski wrote:
> > > > On Mon, Nov 14, 2022 at 5:01 AM Kent Gibson <warthog618@gmail.com> wrote:
> > > > >
> > > >
> > > > I played with the tools a bit and really like the way they look now. I
> > > > think they're ready to hop into master, I'll do some more testing and
> > > > they should be in this week. Just one last request from my side: would
> > > > you mind updating the TOOLS section of the README? I'm aware it's not
> > > > yet updated for v2 and I plan to do it soon but we could already start
> > > > with the tools examples. You can send an incremental patch on top of
> > > > this series.
> > > >
> > >
> > > Good point - I totally forgot about the README.
> > > I'll take a look at it.
> > >
> >
> > And while collecting examples for the README I find the interactive mode
> > tab completion is now broken. It seems I broke it when fixing the prompt
> > behaviour when called from a script.
> > And when fixing that I notice some other odd tab completion behaviour -
> > seems there are at least two separate bugs in in_line_buffer().
> > All things that gpio-tools-tests doesn't currently test for, so I
> > should extend the test coverage as well.
> >
> > And gpiomon --unquoted aborts as I forgot to cut-and-paste the parser
> > handler - and forgot to add a test for it too.
> > So another fix and more tests to add.
> >
> > I probably wont get that done for a day or two, so you might want to hold
> > off on merging - or I can always provide patches later.
> >
> > I also note that interactive mode does not support quoted line names on
> > the interactive command line yet. Adding that is sure to be entertaining.
> > Do you want to wait for me to patch that, or add it to the TODO list?
> >
> 
> Yeah, I can wait.
> 

It seems that, as per the prompt, libedit doesn't provide tab completion
when stdin/stdout isn't a tty, so automated testing of it will require a
different approach such as a pty. Not sure how to do that from bash.
Unless I have an epiphany, or you have a better suggestion, for the moment
I'll just test it manually as it isn't critical functionality - it is just
a nice to have.

> While at it: can you move the following test case:
> 
> @test "gpioget: with consumer" {
> gpiosim_chip sim0 num_lines=4 line_name=1:foo line_name=2:bar
> gpiosim_chip sim1 num_lines=8 line_name=3:baz line_name=4:xyz
> 
> dut_run gpionotify --banner -F "%l %E %C" foo baz
> 
> run_tool gpioget --consumer gpio-tools-tests foo baz
> status_is 0
> 
> dut_read
> output_regex_match "foo requested gpio-tools-tests"
> output_regex_match "baz requested gpio-tools-tests"
> }
> 
> to after you actually add gpionotify? Otherwise the test suite fails
> and bisectability is lost.
> 

Well that is iritating.  I could rework the test to not rely on
gpionotify - it could use the settling period to make gpioget hold the
line while gpioinfo checks - but it would be slower and uglier.
So I'll add that test with the gpionotify tests, as you suggest.

Cheers,
Kent.

  reply	other threads:[~2022-11-16  0:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14  4:00 [libgpiod v2][PATCH v4 0/5] tools: improvements for v2 Kent Gibson
2022-11-14  4:00 ` [libgpiod v2][PATCH v4 1/5] tools: remove old code to simplify review Kent Gibson
2022-11-14  4:00 ` [libgpiod v2][PATCH v4 2/5] tools: line name focussed rework Kent Gibson
2022-11-14  4:01 ` [libgpiod v2][PATCH v4 3/5] tools: tests for " Kent Gibson
2022-11-15 13:08   ` Bartosz Golaszewski
2022-11-15 23:25     ` Kent Gibson
2022-11-14  4:01 ` [libgpiod v2][PATCH v4 4/5] tools: add gpionotify Kent Gibson
2022-11-14  4:01 ` [libgpiod v2][PATCH v4 5/5] tools: gpionotify tests Kent Gibson
2022-11-14 14:26 ` [libgpiod v2][PATCH v4 0/5] tools: improvements for v2 Bartosz Golaszewski
2022-11-14 15:12   ` Kent Gibson
2022-11-14 16:42     ` Bartosz Golaszewski
2022-11-14 23:35       ` Kent Gibson
2022-11-15  3:44     ` Kent Gibson
2022-11-15 14:32       ` Bartosz Golaszewski
2022-11-16  0:12         ` Kent Gibson [this message]
2022-11-16  8:14           ` Bartosz Golaszewski

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=Y3Qq512/3lPqc4xt@sol \
    --to=warthog618@gmail.com \
    --cc=brgl@bgdev.pl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).