* [PATCH]: testsuite/gdb.base/ending-run.*
@ 2001-09-12 7:46 Corinna Vinschen
2001-09-18 6:32 ` Fernando Nasser
0 siblings, 1 reply; 6+ messages in thread
From: Corinna Vinschen @ 2001-09-12 7:46 UTC (permalink / raw)
To: gdb-patches
Hi,
I want to propose the following patch to the ending-run test to
make it more robust even on very small target systems.
The C code of the test generates the following output in a loop:
-1 2 7 14 23 34 47 62 79 Goodbye!
This loop prints one number after the other. Unfortunately, this
test is obviously dependent of the stdout buffer size. On a very
small target system (as the current Sanyo Stormy16 I'm working on),
the default buffer size is set to 16 bytes. That has the unfortunate
effect to split the output into two runs. The result is, that the
first half of the output is already printed before the testsuite
expects it. For that reason the test fails even if it in reality
works ok, just the buffer size prevented the testsuite to pass.
The following patch adds setting the stdout buffersize to a fixed
value which is in order on all targets then, also on very small ones.
The second part of the patch adds an expected regular expression
on the Stormy16 target (which I'm going to contribute to gdb soon)
which results in a full 22 succeeding tests in ending-run.exp.
Corinna
ChangeLog:
==========
2001-09-12 Corinna Vinschen <vinschen@redhat.com>
* gdb.base/ending-run.c (main): Set stdout buffersize
to the same reasonable value for any target.
* gdb.base/ending-run.exp: Add a regular expression
to make testsuite happy on Sanyo Stormy16 target
Index: ending-run.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 ending-run.c
--- ending-run.c 1999/06/28 16:03:08 1.1.1.2
+++ ending-run.c 2001/09/12 14:45:07
@@ -22,7 +22,7 @@ int main()
int i;
p = (int *) malloc( 4 );
-
+ setvbuf (stdout, alloca (64), _IOLBF, 64);
for (i = 1; i < 10; i++)
{
printf( "%d ", callee( i ));
Index: ending-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
retrieving revision 1.7
diff -u -p -r1.7 ending-run.exp
--- ending-run.exp 2001/07/25 22:41:43 1.7
+++ ending-run.exp 2001/09/12 14:45:07
@@ -170,6 +170,10 @@ gdb_expect {
# This is what happens on Solaris currently -sts 1999-08-25
pass "step out of main on Solaris"
}
+ -re ".*in _int_reset ().*$gdb_prompt $" {
+ # This is what happens on Sanyo Stormy16
+ pass "step out of main on Stormy16 thumb"
+ }
-re ".*in ..change.mode ().*$gdb_prompt $" {
# This is what happens on ARM in thumb mode -fn 2000-02-01
pass "step out of main on ARM thumb"
--
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH]: testsuite/gdb.base/ending-run.*
2001-09-12 7:46 [PATCH]: testsuite/gdb.base/ending-run.* Corinna Vinschen
@ 2001-09-18 6:32 ` Fernando Nasser
2001-09-18 7:42 ` Corinna Vinschen
0 siblings, 1 reply; 6+ messages in thread
From: Fernando Nasser @ 2001-09-18 6:32 UTC (permalink / raw)
To: gdb-patches
Corinna Vinschen wrote:
>
> Hi,
>
> I want to propose the following patch to the ending-run test to
> make it more robust even on very small target systems.
>
> The C code of the test generates the following output in a loop:
>
> -1 2 7 14 23 34 47 62 79 Goodbye!
>
> This loop prints one number after the other. Unfortunately, this
> test is obviously dependent of the stdout buffer size. On a very
> small target system (as the current Sanyo Stormy16 I'm working on),
> the default buffer size is set to 16 bytes. That has the unfortunate
> effect to split the output into two runs. The result is, that the
> first half of the output is already printed before the testsuite
> expects it. For that reason the test fails even if it in reality
> works ok, just the buffer size prevented the testsuite to pass.
>
> The following patch adds setting the stdout buffersize to a fixed
> value which is in order on all targets then, also on very small ones.
>
> The second part of the patch adds an expected regular expression
> on the Stormy16 target (which I'm going to contribute to gdb soon)
> which results in a full 22 succeeding tests in ending-run.exp.
>
> Corinna
>
Thanks for the patch.
It is approved with a small change (see below). It is OK fr the tests
to expect alternative patterns depending on the target, but the
test identification must remain the same nevertheless (it would
confuse people's test result analysis scripts otherwise).
The reference that matches the pattern to the architecture must
be on the comment (only).
Regards,
Fernando
P.S.: It is OK to still say "ARM thumb" as ARM is the reference
architecture
that is licensed by chip manufacturers (it is still ARM at the core).
> ChangeLog:
> ==========
>
> 2001-09-12 Corinna Vinschen <vinschen@redhat.com>
>
> * gdb.base/ending-run.c (main): Set stdout buffersize
> to the same reasonable value for any target.
> * gdb.base/ending-run.exp: Add a regular expression
> to make testsuite happy on Sanyo Stormy16 target
>
> Index: ending-run.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.c,v
> retrieving revision 1.1.1.2
> diff -u -p -r1.1.1.2 ending-run.c
> --- ending-run.c 1999/06/28 16:03:08 1.1.1.2
> +++ ending-run.c 2001/09/12 14:45:07
> @@ -22,7 +22,7 @@ int main()
> int i;
>
> p = (int *) malloc( 4 );
> -
> + setvbuf (stdout, alloca (64), _IOLBF, 64);
> for (i = 1; i < 10; i++)
> {
> printf( "%d ", callee( i ));
> Index: ending-run.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
> retrieving revision 1.7
> diff -u -p -r1.7 ending-run.exp
> --- ending-run.exp 2001/07/25 22:41:43 1.7
> +++ ending-run.exp 2001/09/12 14:45:07
> @@ -170,6 +170,10 @@ gdb_expect {
> # This is what happens on Solaris currently -sts 1999-08-25
> pass "step out of main on Solaris"
> }
> + -re ".*in _int_reset ().*$gdb_prompt $" {
> + # This is what happens on Sanyo Stormy16
> + pass "step out of main on Stormy16 thumb"
^^^^^^^^
ARM
> + }
> -re ".*in ..change.mode ().*$gdb_prompt $" {
> # This is what happens on ARM in thumb mode -fn 2000-02-01
> pass "step out of main on ARM thumb"
>
> --
> Corinna Vinschen
> Cygwin Developer
> Red Hat, Inc.
> mailto:vinschen@redhat.com
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH]: testsuite/gdb.base/ending-run.*
2001-09-18 6:32 ` Fernando Nasser
@ 2001-09-18 7:42 ` Corinna Vinschen
2001-09-18 7:57 ` Fernando Nasser
0 siblings, 1 reply; 6+ messages in thread
From: Corinna Vinschen @ 2001-09-18 7:42 UTC (permalink / raw)
To: gdb-patches
On Tue, Sep 18, 2001 at 09:28:19AM -0400, Fernando Nasser wrote:
> Thanks for the patch.
>
> It is approved with a small change (see below). It is OK fr the tests
> to expect alternative patterns depending on the target, but the
> test identification must remain the same nevertheless (it would
> confuse people's test result analysis scripts otherwise).
> The reference that matches the pattern to the architecture must
> be on the comment (only).
>
> Regards,
> Fernando
>
> P.S.: It is OK to still say "ARM thumb" as ARM is the reference
> architecture
> that is licensed by chip manufacturers (it is still ARM at the core).
I'm sorry about that. It's not an ARM in thumb mode. I just
copied the text from the case below and didn't remove the "thumb"
text. It should be
pass "step out of main on Stormy16"
Still ok?
Corinna
--
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH]: testsuite/gdb.base/ending-run.*
2001-09-18 7:42 ` Corinna Vinschen
@ 2001-09-18 7:57 ` Fernando Nasser
2001-09-18 8:26 ` Corinna Vinschen
0 siblings, 1 reply; 6+ messages in thread
From: Fernando Nasser @ 2001-09-18 7:57 UTC (permalink / raw)
To: gdb-patches
Corinna Vinschen wrote:
>
> On Tue, Sep 18, 2001 at 09:28:19AM -0400, Fernando Nasser wrote:
> > Thanks for the patch.
> >
> > It is approved with a small change (see below). It is OK fr the tests
> > to expect alternative patterns depending on the target, but the
> > test identification must remain the same nevertheless (it would
> > confuse people's test result analysis scripts otherwise).
> > The reference that matches the pattern to the architecture must
> > be on the comment (only).
> >
> > Regards,
> > Fernando
> >
> > P.S.: It is OK to still say "ARM thumb" as ARM is the reference
> > architecture
> > that is licensed by chip manufacturers (it is still ARM at the core).
>
> I'm sorry about that. It's not an ARM in thumb mode. I just
> copied the text from the case below and didn't remove the "thumb"
> text. It should be
>
> pass "step out of main on Stormy16"
>
> Still ok?
>
No, all the "pass" statements (as well as the "fail", "xfail" etc.) must
have the same test id string. In this case, all the "-re" patterns
must result in a "pass" or "fail" with that same string (except that the
"fail" may have a reason between parenthesis after the test id string,
like "(timeout)" for instance).
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH]: testsuite/gdb.base/ending-run.*
2001-09-18 7:57 ` Fernando Nasser
@ 2001-09-18 8:26 ` Corinna Vinschen
2001-09-18 9:34 ` Fernando Nasser
0 siblings, 1 reply; 6+ messages in thread
From: Corinna Vinschen @ 2001-09-18 8:26 UTC (permalink / raw)
To: gdb-patches
On Tue, Sep 18, 2001 at 10:53:21AM -0400, Fernando Nasser wrote:
> Corinna Vinschen wrote:
> >
> > On Tue, Sep 18, 2001 at 09:28:19AM -0400, Fernando Nasser wrote:
> > > Thanks for the patch.
> > >
> > > It is approved with a small change (see below). It is OK fr the tests
> > > to expect alternative patterns depending on the target, but the
> > > test identification must remain the same nevertheless (it would
> > > confuse people's test result analysis scripts otherwise).
> > > The reference that matches the pattern to the architecture must
> > > be on the comment (only).
> > >
> > > Regards,
> > > Fernando
> > >
> > > P.S.: It is OK to still say "ARM thumb" as ARM is the reference
> > > architecture
> > > that is licensed by chip manufacturers (it is still ARM at the core).
> >
> > I'm sorry about that. It's not an ARM in thumb mode. I just
> > copied the text from the case below and didn't remove the "thumb"
> > text. It should be
> >
> > pass "step out of main on Stormy16"
> >
> > Still ok?
> >
>
> No, all the "pass" statements (as well as the "fail", "xfail" etc.) must
> have the same test id string. In this case, all the "-re" patterns
> must result in a "pass" or "fail" with that same string (except that the
> "fail" may have a reason between parenthesis after the test id string,
> like "(timeout)" for instance).
I don't understand the difference in my case. The output strings
are already different:
-re ".*Program exited normally.*$gdb_prompt $" {
# This is what happens on Linux i86 (and I would expect others)
set program_exited 1
pass "step out of main"
}
-re ".*in .nope ().*$gdb_prompt $" {
# This is what happens on Solaris currently -sts 1999-08-25
pass "step out of main on Solaris"
}
-re ".*in ..change.mode ().*$gdb_prompt $" {
# This is what happens on ARM in thumb mode -fn 2000-02-01
pass "step out of main on ARM thumb"
}
Why should my non-ARM target use the ARM specific output?!?
Corinna
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH]: testsuite/gdb.base/ending-run.*
2001-09-18 8:26 ` Corinna Vinschen
@ 2001-09-18 9:34 ` Fernando Nasser
0 siblings, 0 replies; 6+ messages in thread
From: Fernando Nasser @ 2001-09-18 9:34 UTC (permalink / raw)
To: gdb-patches
Corinna Vinschen wrote:
>
> I don't understand the difference in my case. The output strings
> are already different:
>
Sorry, I only saw your patch and the context had only one other entry.
Unfortunately you found a bad example. This is how things should _not_
be done.
Just say "step out of main". I will clean up the other messages later
Thanks,
Fernando.
> -re ".*Program exited normally.*$gdb_prompt $" {
> # This is what happens on Linux i86 (and I would expect others)
> set program_exited 1
> pass "step out of main"
> }
> -re ".*in .nope ().*$gdb_prompt $" {
> # This is what happens on Solaris currently -sts 1999-08-25
> pass "step out of main on Solaris"
> }
> -re ".*in ..change.mode ().*$gdb_prompt $" {
> # This is what happens on ARM in thumb mode -fn 2000-02-01
> pass "step out of main on ARM thumb"
> }
>
> Why should my non-ARM target use the ARM specific output?!?
>
It should nor use _any_ specific output for the reasons I gave in my
previous
postings.
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-09-18 9:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-12 7:46 [PATCH]: testsuite/gdb.base/ending-run.* Corinna Vinschen
2001-09-18 6:32 ` Fernando Nasser
2001-09-18 7:42 ` Corinna Vinschen
2001-09-18 7:57 ` Fernando Nasser
2001-09-18 8:26 ` Corinna Vinschen
2001-09-18 9:34 ` Fernando Nasser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox