Re: [libgpiod v2][PATCH v4 0/5] tools: improvements for v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxx> 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.



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux