From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23175 invoked by alias); 1 May 2002 17:48:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23168 invoked from network); 1 May 2002 17:48:36 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 1 May 2002 17:48:36 -0000 Received: from localhost.redhat.com (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA02558; Wed, 1 May 2002 10:47:47 -0700 (PDT) Received: by localhost.redhat.com (Postfix, from userid 469) id ABBC210A8C; Wed, 1 May 2002 13:47:19 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15568.10791.510854.484213@localhost.redhat.com> Date: Wed, 01 May 2002 10:48:00 -0000 To: fnf@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix testsuite completion.exp test for builddir==srcdir In-Reply-To: <200205011448.g41EmWm27920@fred.ninemoons.com> References: <200205011448.g41EmWm27920@fred.ninemoons.com> X-SW-Source: 2002-05/txt/msg00012.txt.bz2 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 > > * 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\\) $"\