From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24288 invoked by alias); 2 May 2011 17:23:37 -0000 Received: (qmail 24277 invoked by uid 22791); 2 May 2011 17:23:35 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 May 2011 17:23:21 +0000 Received: (qmail 18995 invoked from network); 2 May 2011 17:23:20 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 May 2011 17:23:20 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFC] Fixing gdb.base/completion.exp (PR testsuite/12649) Date: Mon, 02 May 2011 17:23:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: Jan Kratochvil , Marek Polacek , Joel Brobecker References: <4DB82F26.30801@redhat.com> <201105021754.35146.pedro@codesourcery.com> <20110502170338.GA1976@host1.jankratochvil.net> In-Reply-To: <20110502170338.GA1976@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105021823.20657.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00032.txt.bz2 On Monday 02 May 2011 18:03:38, Jan Kratochvil wrote: > On Mon, 02 May 2011 18:54:34 +0200, Pedro Alves wrote: > > I had looked at your new readline test, and it didn't appear > > to cover every of interesting completion variant this > > completion.exp test exercises, but I think I may have overlooked. > > I believe the good enough test is that "\t" invokes GDB complete_line (via > readline_line_completion_function). GDB complete_command also obviously leads > to complete_line. > > Therefore if one tests "\t" really works in any single case (which is tested > by gdb.base/readline-ask.exp as it completes the inferior symbol names) one > can then test just the "complete" command for all the other completion > variants with the same coverage. I think it's mostly about the readline line buffer <-> gdb interaction. Some examples come to mind from reading completion.exp, not sure if your test covers all of these: - test that the command that was completed works after "\n", lest we got the completion correctly, but left the line/command buffer clobbered, and we execute the wrong command, for example. - test what happens if you write a full command, and try to expand, and there is no possible completion. execute the command. check that it did really execute, and that the completion code didn't clobber the internal line/command buffer. - test that gdb asks a question on completion request; test that the question looks sane, and that when we answer it, the correct answer is actually chosen. I think your test does some of this. - test that \t completion works correctly (or doesn't work) when there's a trailing whitespace -- Pedro Alves