From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129645 invoked by alias); 31 May 2019 20:34:01 -0000 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 Received: (qmail 129632 invoked by uid 89); 31 May 2019 20:34:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway34.websitewelcome.com Received: from gateway34.websitewelcome.com (HELO gateway34.websitewelcome.com) (192.185.150.114) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 May 2019 20:34:00 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway34.websitewelcome.com (Postfix) with ESMTP id C0CF08D17E for ; Fri, 31 May 2019 15:33:58 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id WoDuhXkh34FKpWoDuhsXhG; Fri, 31 May 2019 15:33:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JyP4c9CoF3/7WmuE+xXxcoizp5IWTATFsjrrjfDo8Xw=; b=XSg9j8AW5x8bMQEFZDxOzGp47T 8fj09ciee7Fs8NULeOxqxf4v5iOi6j/G4A/yb8kxQDg/q63Y1w/qtcwsyMlTiKeA8XBxIS9NU7DXa n67MGNSRdJ/WJQwFpqI0aVl4b; Received: from 174-29-48-168.hlrn.qwest.net ([174.29.48.168]:56934 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hWoDu-003c94-Hr; Fri, 31 May 2019 15:33:58 -0500 From: Tom Tromey To: Philippe Waroquiers Cc: gdb-patches@sourceware.org Subject: Re: [RFA 3/4] Update tests following changes to "help" and "apropos" References: <20190531131903.21203-1-philippe.waroquiers@skynet.be> <20190531131903.21203-4-philippe.waroquiers@skynet.be> Date: Fri, 31 May 2019 20:34:00 -0000 In-Reply-To: <20190531131903.21203-4-philippe.waroquiers@skynet.be> (Philippe Waroquiers's message of "Fri, 31 May 2019 15:19:02 +0200") Message-ID: <871s0epdmy.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-05/txt/msg00756.txt.bz2 >>>>> "Philippe" == Philippe Waroquiers writes: Philippe> Factorizes the testing of the help output, by having a single place Philippe> that defines the common help trailer and/or prefix messages. Philippe> -test_class_help "aliases" {"Aliases of other commands\.\[\r\n\]+"} Philippe> +test_class_help "aliases" {"Aliases of other commands\.\[\r\n\]+"} {} Wow, test_class_help is ugly! Or more precisely, help_test_raw is pretty bad, following the "args" convention that is confusing: proc help_test_raw { gdb_command expected_lines args } { set message $gdb_command if [llength $args]>0 then { set message [lindex $args 0] } It seems like it would be way better to just have an optional argument there. Anyway, could the new argument to test_class_help be optional? Then some of the changes, like the one above, would not be needed. It could also change from using args to using an optional final param: proc test_class_help {command_class expected_initial_lines {list_of_commands {}} {test_name {}}} { Then at the end instead of eval it could just make a direct call: - eval [list help_test_raw "help ${command_class}" $l_entire_body] $args + help_test_raw "help ${command_class}" $l_entire_body $test_name To make this work, the help_test_raw change would have to be made. Philippe> +# Like test_class_help but specialised to test "help user-defined". Philippe> +proc test_user_defined_class_help { list_of_commands args } { Philippe> + test_class_help "user-defined" { Philippe> + "User-defined commands\.[\r\n]+" Philippe> + "The commands in this class are those defined by the user\.[\r\n]+" Philippe> + "Use the \"define\" command to define a command\.[\r\n]+" Philippe> + } $list_of_commands [list $args] Philippe> + # Unclear why, but if [list $args] is rather $args, the above is tested Philippe> + # but gives no PASS message (but gives a FAIL message if it fails) ??? With those changes you could make an optional name parameter here, and then remove the [list] and the comment. Tom