Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix testsuite completion.exp test for builddir==srcdir
@ 2002-05-01  7:48 Fred Fish
  2002-05-01  7:57 ` Fernando Nasser
  2002-05-01 10:48 ` Elena Zannoni
  0 siblings, 2 replies; 4+ messages in thread
From: Fred Fish @ 2002-05-01  7:48 UTC (permalink / raw)
  To: gdb-patches; +Cc: fnf

If you configure and build in the source tree, the completion.exp
test produces:

  FAIL: gdb.base/completion.exp: (timeout) complete 'file ./Make'
  ERROR: Got interactive prompt.
  UNRESOLVED: gdb.base/completion.exp: cd to ${srcdir}
  FAIL: gdb.base/completion.exp: (timeout) complete 'file ./gdb.base/compl'
  FAIL: gdb.base/completion.exp: (timeout) complete 'info func mar'
  FAIL: gdb.base/completion.exp: (timeout) complete 'set follow-fork-mode'

due to having more than one file that completes "./Make".  This patch
fixes that.

On a related note, it is probably a bad idea to have these tests depend
upon details of the source tree like this.  A better long term solution
would be to create a temporary directory, populate it with some known
names, and do completions there.  I should probably add this comment to
the completion.exp header if this patch is approved.

-Fred

2002-05-01  Fred Fish  <fnf@redhat.com>

	* gdb.base/completion.exp: Handle completions of "./Make" for
	more than one completion possibility, as is the case when we
	build and test in the source tree.

Index: gdb.base/completion.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.11
diff -c -p -r1.11 completion.exp
*** gdb.base/completion.exp	13 Jan 2002 22:13:06 -0000	1.11
--- gdb.base/completion.exp	1 May 2002 14:34:15 -0000
*************** gdb_expect  {
*** 631,642 ****
  #
  # So, we avoid long lines.  We `cd' to ${objdir} first, and then do
  # the completion relative to the current directory.
  
  gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
  send_gdb "file ./Make\t"
  sleep 1
  gdb_expect  {
!         -re "file ./Makefile.*$"\
              { send_gdb "\n"
                gdb_expect {
                        -re "\r\nA program is being debugged already\\.  Kill it\\? \\(y or n\\) $"\
--- 631,645 ----
  #
  # So, we avoid long lines.  We `cd' to ${objdir} first, and then do
  # the completion relative to the current directory.
+ #
+ # Note that if we are building in the source tree, then there will be
+ # more than one completion for ./Make, so we need to handle that also.
  
  gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
  send_gdb "file ./Make\t"
  sleep 1
  gdb_expect  {
!         -re "^file ./Make(\\\x07|)file.*$"\
              { send_gdb "\n"
                gdb_expect {
                        -re "\r\nA program is being debugged already\\.  Kill it\\? \\(y or n\\) $"\


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] Fix testsuite completion.exp test for builddir==srcdir
  2002-05-01  7:48 [RFA] Fix testsuite completion.exp test for builddir==srcdir Fred Fish
@ 2002-05-01  7:57 ` Fernando Nasser
  2002-05-01 10:48 ` Elena Zannoni
  1 sibling, 0 replies; 4+ messages in thread
From: Fernando Nasser @ 2002-05-01  7:57 UTC (permalink / raw)
  To: fnf; +Cc: gdb-patches

Fred Fish wrote:
> 
> If you configure and build in the source tree, the completion.exp
> test produces:
> 
>   FAIL: gdb.base/completion.exp: (timeout) complete 'file ./Make'
>   ERROR: Got interactive prompt.
>   UNRESOLVED: gdb.base/completion.exp: cd to ${srcdir}
>   FAIL: gdb.base/completion.exp: (timeout) complete 'file ./gdb.base/compl'
>   FAIL: gdb.base/completion.exp: (timeout) complete 'info func mar'
>   FAIL: gdb.base/completion.exp: (timeout) complete 'set follow-fork-mode'
> 
> due to having more than one file that completes "./Make".  This patch
> fixes that.
> 
> On a related note, it is probably a bad idea to have these tests depend
> upon details of the source tree like this.  A better long term solution
> would be to create a temporary directory, populate it with some known
> names, and do completions there.  I should probably add this comment to
> the completion.exp header if this patch is approved.
> 
> -Fred
> 

Hi Fred,

Patch approved.  You can add the comment as well.

Thanks for the fix.

Regards,
Fernando


> 2002-05-01  Fred Fish  <fnf@redhat.com>
> 
>         * gdb.base/completion.exp: Handle completions of "./Make" for
>         more than one completion possibility, as is the case when we
>         build and test in the source tree.
> 
> Index: gdb.base/completion.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v
> retrieving revision 1.11
> diff -c -p -r1.11 completion.exp
> *** gdb.base/completion.exp     13 Jan 2002 22:13:06 -0000      1.11
> --- gdb.base/completion.exp     1 May 2002 14:34:15 -0000
> *************** gdb_expect  {
> *** 631,642 ****
>   #
>   # So, we avoid long lines.  We `cd' to ${objdir} first, and then do
>   # the completion relative to the current directory.
> 
>   gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
>   send_gdb "file ./Make\t"
>   sleep 1
>   gdb_expect  {
> !         -re "file ./Makefile.*$"\
>               { send_gdb "\n"
>                 gdb_expect {
>                         -re "\r\nA program is being debugged already\\.  Kill it\\? \\(y or n\\) $"\
> --- 631,645 ----
>   #
>   # So, we avoid long lines.  We `cd' to ${objdir} first, and then do
>   # the completion relative to the current directory.
> + #
> + # Note that if we are building in the source tree, then there will be
> + # more than one completion for ./Make, so we need to handle that also.
> 
>   gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
>   send_gdb "file ./Make\t"
>   sleep 1
>   gdb_expect  {
> !         -re "^file ./Make(\\\x07|)file.*$"\
>               { send_gdb "\n"
>                 gdb_expect {
>                         -re "\r\nA program is being debugged already\\.  Kill it\\? \\(y or n\\) $"\

-- 
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] 4+ messages in thread

* Re: [RFA] Fix testsuite completion.exp test for builddir==srcdir
  2002-05-01  7:48 [RFA] Fix testsuite completion.exp test for builddir==srcdir Fred Fish
  2002-05-01  7:57 ` Fernando Nasser
@ 2002-05-01 10:48 ` Elena Zannoni
  2002-05-01 11:45   ` Fred Fish
  1 sibling, 1 reply; 4+ messages in thread
From: Elena Zannoni @ 2002-05-01 10:48 UTC (permalink / raw)
  To: fnf; +Cc: gdb-patches

Fred Fish writes:
 > If you configure and build in the source tree, the completion.exp
 > test produces:
 > 
 >   FAIL: gdb.base/completion.exp: (timeout) complete 'file ./Make'
 >   ERROR: Got interactive prompt.
 >   UNRESOLVED: gdb.base/completion.exp: cd to ${srcdir}
 >   FAIL: gdb.base/completion.exp: (timeout) complete 'file ./gdb.base/compl'
 >   FAIL: gdb.base/completion.exp: (timeout) complete 'info func mar'
 >   FAIL: gdb.base/completion.exp: (timeout) complete 'set follow-fork-mode'
 > 
 > due to having more than one file that completes "./Make".  This patch
 > fixes that.
 > 
 > On a related note, it is probably a bad idea to have these tests depend
 > upon details of the source tree like this.  A better long term solution
 > would be to create a temporary directory, populate it with some known
 > names, and do completions there.  I should probably add this comment to
 > the completion.exp header if this patch is approved.


Hmmm, I thought that we shouldn't build in the source tree.

But your patch looks ok.

Elena



 > 
 > -Fred
 > 
 > 2002-05-01  Fred Fish  <fnf@redhat.com>
 > 
 > 	* gdb.base/completion.exp: Handle completions of "./Make" for
 > 	more than one completion possibility, as is the case when we
 > 	build and test in the source tree.
 > 
 > Index: gdb.base/completion.exp
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v
 > retrieving revision 1.11
 > diff -c -p -r1.11 completion.exp
 > *** gdb.base/completion.exp	13 Jan 2002 22:13:06 -0000	1.11
 > --- gdb.base/completion.exp	1 May 2002 14:34:15 -0000
 > *************** gdb_expect  {
 > *** 631,642 ****
 >   #
 >   # So, we avoid long lines.  We `cd' to ${objdir} first, and then do
 >   # the completion relative to the current directory.
 >   
 >   gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
 >   send_gdb "file ./Make\t"
 >   sleep 1
 >   gdb_expect  {
 > !         -re "file ./Makefile.*$"\
 >               { send_gdb "\n"
 >                 gdb_expect {
 >                         -re "\r\nA program is being debugged already\\.  Kill it\\? \\(y or n\\) $"\
 > --- 631,645 ----
 >   #
 >   # So, we avoid long lines.  We `cd' to ${objdir} first, and then do
 >   # the completion relative to the current directory.
 > + #
 > + # Note that if we are building in the source tree, then there will be
 > + # more than one completion for ./Make, so we need to handle that also.
 >   
 >   gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
 >   send_gdb "file ./Make\t"
 >   sleep 1
 >   gdb_expect  {
 > !         -re "^file ./Make(\\\x07|)file.*$"\
 >               { send_gdb "\n"
 >                 gdb_expect {
 >                         -re "\r\nA program is being debugged already\\.  Kill it\\? \\(y or n\\) $"\


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] Fix testsuite completion.exp test for builddir==srcdir
  2002-05-01 10:48 ` Elena Zannoni
@ 2002-05-01 11:45   ` Fred Fish
  0 siblings, 0 replies; 4+ messages in thread
From: Fred Fish @ 2002-05-01 11:45 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: fnf, gdb-patches

> Hmmm, I thought that we shouldn't build in the source tree.

Generally not, but "rpm -bc gdb.specs" seems to want to do that.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-01 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-01  7:48 [RFA] Fix testsuite completion.exp test for builddir==srcdir Fred Fish
2002-05-01  7:57 ` Fernando Nasser
2002-05-01 10:48 ` Elena Zannoni
2002-05-01 11:45   ` Fred Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox