Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Make first and last lines of 'command help documentation' consistent.
Date: Wed, 10 Jul 2019 22:31:00 -0000	[thread overview]
Message-ID: <1562797898.1521.10.camel@skynet.be> (raw)
In-Reply-To: <874l3tg6vh.fsf@tromey.com>

On Wed, 2019-07-10 at 11:02 -0600, Tom Tromey wrote:
> Philippe> +  /* Checks that the documentation does not help with a new line.
> Philippe> +     If it does, output a special marker string that gdb.base/help.exp
> Philippe> +     will detect.  */
> Philippe> +  if (c->doc[strlen (c->doc) - 1] == '\n')
> Philippe> +    fprintf_filtered (stream, "END_OF_LINE@END_OF_DOC %s%s\n",
> Philippe> +		      prefix, c->name);
> 
> I think this can't be an assertion, because user commands could hit it,
> and that seems too harsh; but could it be a unit test?  That might be
> better than printing something magic, especially since IIUC the user can
> end up seeing this stuff.
Effectively, the user can end up seeing this, but only if the GDB test
was not run and/or was not fixed.


> Philippe> +gdb_test_no_output \
> Philippe> +    "|apropos .| grep -e '\[^\.\]$' -e '^END_OF_LINE@END_OF_DOC '" \
> Philippe> +    "command help doc first line ends with a dot, doc does not end with eol"
> 
> I'm not sure we can rely on having grep in the test suite.  If you
> switch the patch to a self-test, then this is moot; otherwise, is this
> used elsewhere?  I think a different approach is to write to a log file
> and then examine it with Tcl.  I believe some other tests do this.
The testsuite uses various unix commands such as mv/touch/grep/stty/...
But maybe these tests are all failing e.g. on windows ?

In any case, I will see if it is easy to do a selftest instead,
without duplicating too much of e.g. the recursive traversal of the commands,
maybe by adding a 'for_self_test' boolean arg to apropos_command ...

Thanks for the comments,

Philippe



  reply	other threads:[~2019-07-10 22:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-16 19:58 Philippe Waroquiers
2019-07-05 20:04 ` PING " Philippe Waroquiers
2019-07-10 17:02 ` Tom Tromey
2019-07-10 22:31   ` Philippe Waroquiers [this message]
2019-07-11 12:22     ` Tom Tromey
2019-07-11 12:53       ` Pedro Alves
2019-07-11 13:12         ` Tom Tromey
2019-07-11 15:49           ` Pedro Alves
2019-07-11 15:51             ` Pedro Alves
2019-07-11 15:58               ` Tom Tromey
2019-07-11 15:44   ` Pedro Alves
2019-07-11 13:49 ` Pedro Alves
2019-07-29 21:27   ` Philippe Waroquiers
2019-07-11 14:18 ` Pedro Alves
2019-07-11 15:39 ` Pedro Alves
2019-07-11 15:43 ` Pedro Alves

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=1562797898.1521.10.camel@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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