* [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline
@ 2010-06-02 21:40 Jan Kratochvil
2010-06-02 21:44 ` Joel Brobecker
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2010-06-02 21:40 UTC (permalink / raw)
To: gdb-patches
Hi,
there has been now checked-in random
FAIL: gdb.cp/ref-types.exp: print value of rL
Checked-in the fix.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2010-06/msg00019.html
--- src/gdb/testsuite/ChangeLog 2010/06/02 20:03:15 1.2302
+++ src/gdb/testsuite/ChangeLog 2010/06/02 21:38:32 1.2303
@@ -1,3 +1,7 @@
+2010-06-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.cp/ref-types.exp (print value of UI): Remove excessive newline.
+
2010-06-02 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* gdb.cp/class2.exp: Use gdb_test_no_output.
--- src/gdb/testsuite/gdb.cp/ref-types.exp 2010/06/01 18:18:35 1.15
+++ src/gdb/testsuite/gdb.cp/ref-types.exp 2010/06/02 21:38:32 1.16
@@ -254,7 +254,7 @@
gdb_test "print rI" ".\[0-9\]* = \\(int &\\) @$hex: 102" \
pass "print value of rI"
-gdb_test "print rUI\n" \
+gdb_test "print rUI" \
".\[0-9\]* = \\(unsigned int &\\) @$hex: 1002" \
pass "print value of UI"
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline
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
0 siblings, 1 reply; 8+ messages in thread
From: Joel Brobecker @ 2010-06-02 21:44 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
> +2010-06-02 Jan Kratochvil <jan.kratochvil@redhat.com>
> +
> + * gdb.cp/ref-types.exp (print value of UI): Remove excessive newline.
> +
How about automatically catching those? I wonder what would happen if
we raised an exception if the command sent by gdb_test ended in a
newline? Same question about gdb_test_multiple...
--
Joel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [patch] testsuite: Error on trailing newlines [Re: [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline]
2010-06-02 21:44 ` Joel Brobecker
@ 2010-06-02 22:31 ` Jan Kratochvil
2010-06-02 23:02 ` Joel Brobecker
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2010-06-02 22:31 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Wed, 02 Jun 2010 23:43:50 +0200, Joel Brobecker wrote:
> How about automatically catching those? I wonder what would happen if
> we raised an exception if the command sent by gdb_test ended in a
> newline? Same question about gdb_test_multiple...
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] {
No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
(But in fact the fixed testcases were tested only on x86_64-fedora13-linux-gnu.
OK to check-in? There may be regressions for testcases not tested on this
platform.
Thanks,
Jan
gdb/testsuite/
2010-06-03 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/gdb.exp (gdb_test_multiple): Error on trailing newlines.
* 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.
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -503,7 +503,7 @@ proc temporary_breakpoint_commands {} {
pass "add silent tbreak command"
}
}
- gdb_test_multiple "printf \"factorial tbreak commands executed\\n\"\n" \
+ gdb_test_multiple "printf \"factorial tbreak commands executed\\n\"" \
"add printf tbreak command" {
-re ">$" {
pass "add printf tbreak command"
--- a/gdb/testsuite/gdb.gdb/complaints.exp
+++ b/gdb/testsuite/gdb.gdb/complaints.exp
@@ -207,13 +207,13 @@ proc test_empty_complaint { cmd msg } {
proc test_empty_complaints { } {
- test_empty_complaint "call clear_complaints(&symfile_complaints,0,0)\n" \
+ test_empty_complaint "call clear_complaints(&symfile_complaints,0,0)" \
"empty non-verbose non-noisy clear"
- test_empty_complaint "call clear_complaints(&symfile_complaints,1,0)\n" \
+ test_empty_complaint "call clear_complaints(&symfile_complaints,1,0)" \
"empty verbose non-noisy clear"
- test_empty_complaint "call clear_complaints(&symfile_complaints,1,1)\n" \
+ test_empty_complaint "call clear_complaints(&symfile_complaints,1,1)" \
"empty verbose noisy clear"
- test_empty_complaint "call clear_complaints(&symfile_complaints,0,1)\n" \
+ test_empty_complaint "call clear_complaints(&symfile_complaints,0,1)" \
"empty non-verbose noisy clear"
return 0
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -573,6 +573,10 @@ proc gdb_test_multiple { command message user_code } {
set message $command
}
+ if [string match "*\[\r\n\]" $command] {
+ error "gdb_test_multiple: \"$message\" used trailing newline"
+ }
+
# TCL/EXPECT WART ALERT
# Expect does something very strange when it receives a single braced
# argument. It splits it along word separators and performs substitutions.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch] testsuite: Error on trailing newlines [Re: [obv] testsuite: gdb.cp/ref-types.exp: Excessive newline]
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
2010-06-04 14:31 ` [patch] testsuite: Error on trailing newlines Jan Kratochvil
2010-06-28 19:51 ` Jan Kratochvil
0 siblings, 2 replies; 8+ messages in thread
From: Joel Brobecker @ 2010-06-02 23:02 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch] testsuite: Error on trailing newlines
2010-06-02 23:02 ` Joel Brobecker
@ 2010-06-04 14:31 ` Jan Kratochvil
2010-06-28 19:51 ` Jan Kratochvil
1 sibling, 0 replies; 8+ messages in thread
From: Jan Kratochvil @ 2010-06-04 14:31 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Thu, 03 Jun 2010 01:02:35 +0200, Joel Brobecker wrote:
> > * 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.
True, checked-in.
> 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...
I do not mind that message change, thanks.
Regards,
Jan
http://sourceware.org/ml/gdb-cvs/2010-06/msg00040.html
--- src/gdb/testsuite/ChangeLog 2010/06/03 23:54:17 1.2313
+++ src/gdb/testsuite/ChangeLog 2010/06/04 14:26:47 1.2314
@@ -1,3 +1,11 @@
+2010-06-04 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * 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.
+
2010-06-03 Michael Snyder <msnyder@vmware.com>
* gdb.base/commands.exp: Replace gdb_test with gdb_test_no_output.
--- src/gdb/testsuite/gdb.base/commands.exp 2010/06/03 23:54:17 1.38
+++ src/gdb/testsuite/gdb.base/commands.exp 2010/06/04 14:26:49 1.39
@@ -503,7 +503,7 @@
pass "add silent tbreak command"
}
}
- gdb_test_multiple "printf \"factorial tbreak commands executed\\n\"\n" \
+ gdb_test_multiple "printf \"factorial tbreak commands executed\\n\"" \
"add printf tbreak command" {
-re ">$" {
pass "add printf tbreak command"
--- src/gdb/testsuite/gdb.gdb/complaints.exp 2010/05/26 18:31:25 1.13
+++ src/gdb/testsuite/gdb.gdb/complaints.exp 2010/06/04 14:26:52 1.14
@@ -207,13 +207,13 @@
proc test_empty_complaints { } {
- test_empty_complaint "call clear_complaints(&symfile_complaints,0,0)\n" \
+ test_empty_complaint "call clear_complaints(&symfile_complaints,0,0)" \
"empty non-verbose non-noisy clear"
- test_empty_complaint "call clear_complaints(&symfile_complaints,1,0)\n" \
+ test_empty_complaint "call clear_complaints(&symfile_complaints,1,0)" \
"empty verbose non-noisy clear"
- test_empty_complaint "call clear_complaints(&symfile_complaints,1,1)\n" \
+ test_empty_complaint "call clear_complaints(&symfile_complaints,1,1)" \
"empty verbose noisy clear"
- test_empty_complaint "call clear_complaints(&symfile_complaints,0,1)\n" \
+ test_empty_complaint "call clear_complaints(&symfile_complaints,0,1)" \
"empty non-verbose noisy clear"
return 0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch] testsuite: Error on trailing newlines
2010-06-02 23:02 ` Joel Brobecker
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
1 sibling, 1 reply; 8+ messages in thread
From: Jan Kratochvil @ 2010-06-28 19:51 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Thu, 03 Jun 2010 01:02:35 +0200, Joel Brobecker wrote:
> > * 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.
After 25 days going to check it in a day (or upon approval).
Changed the message text.
Rechecked no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
Thanks,
Jan
gdb/testsuite/
2010-06-28 Jan Kratochvil <jan.kratochvil@redhat.com>
Joel Brobecker <brobecker@adacore.com>
* lib/gdb.exp (gdb_test_multiple): Error on trailing newlines.
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -573,6 +573,10 @@ proc gdb_test_multiple { command message user_code } {
set message $command
}
+ if [string match "*\[\r\n\]" $command] {
+ error "Invalid trailing newline in \"$message\" test"
+ }
+
# TCL/EXPECT WART ALERT
# Expect does something very strange when it receives a single braced
# argument. It splits it along word separators and performs substitutions.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch] testsuite: Error on trailing newlines
2010-06-28 19:51 ` Jan Kratochvil
@ 2010-06-28 19:55 ` Joel Brobecker
2010-06-28 20:10 ` Jan Kratochvil
0 siblings, 1 reply; 8+ messages in thread
From: Joel Brobecker @ 2010-06-28 19:55 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
> gdb/testsuite/
> 2010-06-28 Jan Kratochvil <jan.kratochvil@redhat.com>
> Joel Brobecker <brobecker@adacore.com>
>
> * lib/gdb.exp (gdb_test_multiple): Error on trailing newlines.
Since it's been 25 days, you should just go ahead and commit now.
--
Joel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch] testsuite: Error on trailing newlines
2010-06-28 19:55 ` Joel Brobecker
@ 2010-06-28 20:10 ` Jan Kratochvil
0 siblings, 0 replies; 8+ messages in thread
From: Jan Kratochvil @ 2010-06-28 20:10 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Mon, 28 Jun 2010 21:55:46 +0200, Joel Brobecker wrote:
> > gdb/testsuite/
> > 2010-06-28 Jan Kratochvil <jan.kratochvil@redhat.com>
> > Joel Brobecker <brobecker@adacore.com>
> >
> > * lib/gdb.exp (gdb_test_multiple): Error on trailing newlines.
>
> Since it's been 25 days, you should just go ahead and commit now.
Checked-in:
http://sourceware.org/ml/gdb-cvs/2010-06/msg00195.html
Thanks,
Jan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-06-28 20:10 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
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 read-only IMAP folder(s) and NNTP newsgroup(s).