* [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info
@ 2001-12-05 11:25 Corinna Vinschen
2001-12-05 11:55 ` Daniel Jacobowitz
2002-01-20 16:08 ` Andrew Cagney
0 siblings, 2 replies; 6+ messages in thread
From: Corinna Vinschen @ 2001-12-05 11:25 UTC (permalink / raw)
To: gdb-patches
Hi,
the first test in a2-bin.exp checks if the return code is 1 when
the application is called w/o parameter. Unfortunately there are
(remote) targets which aren't able to return a return code so that
the return code is always set to 0. That results in a failing
first test in a2-bin.exp even though the target is doing the right
thing.
To indicate that a target can't return a return code, there's
a setting `set_board_info needs_status_wrapper 1' which just
isn't taken into account in a2-bin.exp.
The following patch changes that.
Corinna
2001-12-05 Corinna Vinschen <vinschen@redhat.com>
* gdb.base/a2-bin.exp: Pass first test even if the return
code is 0 if target_info `needs_status_wrapper' exists.
Index: a2-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/a2-run.exp,v
retrieving revision 1.3
diff -u -p -r1.3 a2-run.exp
--- a2-run.exp 2001/03/06 08:21:50 1.3
+++ a2-run.exp 2001/12/05 19:10:31
@@ -80,6 +80,13 @@ if [istarget "*-*-vxworks*"] then {
-re ".*usage: factorial <number>.*Program exited with code 01.*$gdb_prompt $" {
pass "run \"$testfile\" with no args"
}
+ -re ".*usage: factorial <number>.*Program exited normally.*$gdb_prompt $" {
+ if [target_info exists needs_status_wrapper] then {
+ pass "run \"$testfile\" with no args"
+ } else {
+ fail "run \"$testfile\" with no args"
+ }
+ }
-re ".*$gdb_prompt $" {
fail "run \"$testfile\" with no args"
verbose "expect_out is $expect_out(buffer)" 2
--
Corinna Vinschen
Red Hat, Inc.
mailto:vinschen@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info
2001-12-05 11:25 [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info Corinna Vinschen
@ 2001-12-05 11:55 ` Daniel Jacobowitz
2001-12-05 12:17 ` Corinna Vinschen
2002-01-20 16:08 ` Andrew Cagney
1 sibling, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2001-12-05 11:55 UTC (permalink / raw)
To: gdb-patches
On Wed, Dec 05, 2001 at 08:25:07PM +0100, Corinna Vinschen wrote:
> 2001-12-05 Corinna Vinschen <vinschen@redhat.com>
>
> * gdb.base/a2-bin.exp: Pass first test even if the return
> code is 0 if target_info `needs_status_wrapper' exists.
Please don't turn this into a PASS; it didn't really test anything as I
read it. "unsupported" is probably the appropriate return code.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info
2001-12-05 11:55 ` Daniel Jacobowitz
@ 2001-12-05 12:17 ` Corinna Vinschen
2001-12-05 12:29 ` Daniel Jacobowitz
2002-01-21 8:12 ` Fernando Nasser
0 siblings, 2 replies; 6+ messages in thread
From: Corinna Vinschen @ 2001-12-05 12:17 UTC (permalink / raw)
To: gdb-patches
On Wed, Dec 05, 2001 at 02:54:40PM -0500, Daniel Jacobowitz wrote:
> On Wed, Dec 05, 2001 at 08:25:07PM +0100, Corinna Vinschen wrote:
> > 2001-12-05 Corinna Vinschen <vinschen@redhat.com>
> >
> > * gdb.base/a2-bin.exp: Pass first test even if the return
> > code is 0 if target_info `needs_status_wrapper' exists.
>
> Please don't turn this into a PASS; it didn't really test anything as I
> read it. "unsupported" is probably the appropriate return code.
I don't think so. The test tests that the application returns
it's usage so it has tested that the application got it's argc
correctly. That's what the test is for, right? It's just an
_additional_ test that the return code is 1. It's not GDB's
fault that the target can't return the return code correctly.
Corinna
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info
2001-12-05 12:17 ` Corinna Vinschen
@ 2001-12-05 12:29 ` Daniel Jacobowitz
2002-01-21 8:12 ` Fernando Nasser
1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2001-12-05 12:29 UTC (permalink / raw)
To: gdb-patches
On Wed, Dec 05, 2001 at 09:17:08PM +0100, Corinna Vinschen wrote:
> On Wed, Dec 05, 2001 at 02:54:40PM -0500, Daniel Jacobowitz wrote:
> > On Wed, Dec 05, 2001 at 08:25:07PM +0100, Corinna Vinschen wrote:
> > > 2001-12-05 Corinna Vinschen <vinschen@redhat.com>
> > >
> > > * gdb.base/a2-bin.exp: Pass first test even if the return
> > > code is 0 if target_info `needs_status_wrapper' exists.
> >
> > Please don't turn this into a PASS; it didn't really test anything as I
> > read it. "unsupported" is probably the appropriate return code.
>
> I don't think so. The test tests that the application returns
> it's usage so it has tested that the application got it's argc
> correctly. That's what the test is for, right? It's just an
> _additional_ test that the return code is 1. It's not GDB's
> fault that the target can't return the return code correctly.
[BTW, it's a2-run.exp]
OK, I misread. You might want to break this up into two tests;
you can just replace the one pass by two passes, and the pass you were
adding by a pass and an unsupported. May not be worth the effort.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info
2001-12-05 12:17 ` Corinna Vinschen
2001-12-05 12:29 ` Daniel Jacobowitz
@ 2002-01-21 8:12 ` Fernando Nasser
1 sibling, 0 replies; 6+ messages in thread
From: Fernando Nasser @ 2002-01-21 8:12 UTC (permalink / raw)
To: gdb-patches
Daniel's observation is valid in general, i.e., if we can't test
something we must say "unsupported" (BTW, the vxworks version of
this test uses it wrong -- it seems it should be fail in that case).
W.r.t. this specific test though Corinna is right: the goal of the
test is to see if the program returns the "Usage" message when called
with no arguments. If the return code was the only thing tested
we would say "unsupported". (We cant say "1/2 unsupported",
which could be the more exact description :-)
Check it in please Corinna.
Thanks for the fix.
Fernando
P.S.: And thanks to Daniel for reviewing and watching over the details.
Corinna Vinschen wrote:
>
> On Wed, Dec 05, 2001 at 02:54:40PM -0500, Daniel Jacobowitz wrote:
> > On Wed, Dec 05, 2001 at 08:25:07PM +0100, Corinna Vinschen wrote:
> > > 2001-12-05 Corinna Vinschen <vinschen@redhat.com>
> > >
> > > * gdb.base/a2-bin.exp: Pass first test even if the return
> > > code is 0 if target_info `needs_status_wrapper' exists.
> >
> > Please don't turn this into a PASS; it didn't really test anything as I
> > read it. "unsupported" is probably the appropriate return code.
>
> I don't think so. The test tests that the application returns
> it's usage so it has tested that the application got it's argc
> correctly. That's what the test is for, right? It's just an
> _additional_ test that the return code is 1. It's not GDB's
> fault that the target can't return the return code correctly.
>
> Corinna
--
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: [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info
2001-12-05 11:25 [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info Corinna Vinschen
2001-12-05 11:55 ` Daniel Jacobowitz
@ 2002-01-20 16:08 ` Andrew Cagney
1 sibling, 0 replies; 6+ messages in thread
From: Andrew Cagney @ 2002-01-20 16:08 UTC (permalink / raw)
To: gdb-patches, Fernando Nasser
Hello,
Did anything come of this patch?
Andrew
> Hi,
>
> the first test in a2-bin.exp checks if the return code is 1 when
> the application is called w/o parameter. Unfortunately there are
> (remote) targets which aren't able to return a return code so that
> the return code is always set to 0. That results in a failing
> first test in a2-bin.exp even though the target is doing the right
> thing.
>
> To indicate that a target can't return a return code, there's
> a setting `set_board_info needs_status_wrapper 1' which just
> isn't taken into account in a2-bin.exp.
>
> The following patch changes that.
>
> Corinna
>
>
> 2001-12-05 Corinna Vinschen <vinschen@redhat.com>
>
> * gdb.base/a2-bin.exp: Pass first test even if the return
> code is 0 if target_info `needs_status_wrapper' exists.
>
>
> Index: a2-run.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/a2-run.exp,v
> retrieving revision 1.3
> diff -u -p -r1.3 a2-run.exp
> --- a2-run.exp 2001/03/06 08:21:50 1.3
> +++ a2-run.exp 2001/12/05 19:10:31
> @@ -80,6 +80,13 @@ if [istarget "*-*-vxworks*"] then {
> -re ".*usage: factorial <number>.*Program exited with code 01.*$gdb_prompt $" {
> pass "run \"$testfile\" with no args"
> }
> + -re ".*usage: factorial <number>.*Program exited normally.*$gdb_prompt $" {
> + if [target_info exists needs_status_wrapper] then {
> + pass "run \"$testfile\" with no args"
> + } else {
> + fail "run \"$testfile\" with no args"
> + }
> + }
> -re ".*$gdb_prompt $" {
> fail "run \"$testfile\" with no args"
> verbose "expect_out is $expect_out(buffer)" 2
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-01-21 16:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-05 11:25 [RFA]: testsuite/gdb.base/a2-bin.exp: Consider `needs_status_wrapper' target_info Corinna Vinschen
2001-12-05 11:55 ` Daniel Jacobowitz
2001-12-05 12:17 ` Corinna Vinschen
2001-12-05 12:29 ` Daniel Jacobowitz
2002-01-21 8:12 ` Fernando Nasser
2002-01-20 16:08 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox