From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] testsuite: Error on trailing newlines [Re: [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline]
Date: Wed, 02 Jun 2010 23:02:00 -0000 [thread overview]
Message-ID: <20100602230235.GH3019@adacore.com> (raw)
In-Reply-To: <20100602223124.GA2335@host0.dyn.jankratochvil.net>
> It now generates some:
> Running ./gdb.cp/ref-types.exp ...
> ERROR: tcl error sourcing ./gdb.cp/ref-types.exp.
> ERROR: gdb_test_multiple: "print value of UI" used trailing newline
> while executing
> "error "gdb_test_multiple: \"$message\" used trailing newline""
> invoked from within
> "if [string match "*\[\r\n\]" $command] {
Thanks for doing that.
I think it's a step in the right direction. I did double-check the
implementation of gdb_test_multiple and it showed that the \n is added
there (so should never be added by the caller), and that a trailing
\n would cause the function to send an empty command.
The problem is that we are probably removing the ability of using that
function to test repeat/non-repeat commands. But I think that this is
the exception rather than the norm, and I suggest we use...
send_gdb "\n"
gdb_test/gdb_test_multiple "" [...]
... when we want to send empty commands.
> OK to check-in? There may be regressions for testcases not tested on this
> platform.
I think that's fine, it's easy to fix.
> * gdb.base/commands.exp (add printf tbreak command): Remove trailing
> newline.
> * gdb.gdb/complaints.exp (empty non-verbose non-noisy clear)
> (empty verbose non-noisy clear, empty verbose noisy clear)
> (empty non-verbose noisy clear): Likewise.
This part is definitely OK (you've treated them as obvious so far).
So let's commit them now.
> * lib/gdb.exp (gdb_test_multiple): Error on trailing newlines.
This part is OK as far as I am concerned, but let's hold off on it
for a couple of days, to see if others have any comment about it.
I'd like to take this opportunity to adjust the error message a bit
to make it clearer that it's the command that has a trailing new-line,
not the message. Something like this, maybe?
Invalid trailing newline in \"$message\" test
? I don't mind the gdb_test_multiple in the error message if you think
it makes a difference, but I can see how it can confuse people who are
not familiar with the testsuite infrastructure if the test was written
using gdb_test...
--
Joel
next prev parent reply other threads:[~2010-06-02 23:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-02 21:40 [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline Jan Kratochvil
2010-06-02 21:44 ` Joel Brobecker
2010-06-02 22:31 ` [patch] testsuite: Error on trailing newlines [Re: [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline] Jan Kratochvil
2010-06-02 23:02 ` Joel Brobecker [this message]
2010-06-04 14:31 ` [patch] testsuite: Error on trailing newlines Jan Kratochvil
2010-06-28 19:51 ` Jan Kratochvil
2010-06-28 19:55 ` Joel Brobecker
2010-06-28 20:10 ` Jan Kratochvil
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=20100602230235.GH3019@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.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