From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3046 invoked by alias); 8 Aug 2006 23:00:59 -0000 Received: (qmail 3035 invoked by uid 22791); 8 Aug 2006 23:00:58 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 08 Aug 2006 23:00:52 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id D7A2948CDC3 for ; Tue, 8 Aug 2006 19:00:46 -0400 (EDT) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 00088-02 for ; Tue, 8 Aug 2006 19:00:46 -0400 (EDT) Received: from takamaka.act-europe.fr (unknown [70.71.0.212]) by nile.gnat.com (Postfix) with ESMTP id 5487148CD9F for ; Tue, 8 Aug 2006 19:00:46 -0400 (EDT) Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 8C9D047EFA; Tue, 8 Aug 2006 16:00:45 -0700 (PDT) Date: Tue, 08 Aug 2006 23:00:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [RFA/testsuite] New testcase for set/unset/show substitute-path Message-ID: <20060808230045.GF19846@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="wq9mPyueHGvFACwf" Content-Disposition: inline User-Agent: Mutt/1.4i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00067.txt.bz2 --wq9mPyueHGvFACwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 490 Hello, Here is a first try at implementing a testcase for the new substitute-path commands. I'm only testing the manipulation of the list of substitution rules at this point, because I still don't see how to implement something that would test the actual substitution and work in all cases. I figured this is better than nothing for now. 2006-08-08 Joel Brobecker * gdb.base/subst.exp: New testcase. Tested on x86-linux. OK to apply? Thanks, -- Joel --wq9mPyueHGvFACwf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="subst.exp" Content-length: 5444 # Copyright 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA if $tracelevel { strace $tracelevel } gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir # Do a bunch of testing of the set/unset/show substitute-path # commands that do not require the presence of an executable. gdb_test "set confirm off" \ "" \ "deactivate GDB's confirmation interface" gdb_test "show substitute-path" \ "List of all source path substitution rules:" \ "show substitute-path, no rule entered yet" gdb_test "show substitute-path from" \ "Source path substitution rule matching `from':" \ "show substitute-path from, no rule entered yet" gdb_test "show substitute-path too many" \ "Too many arguments in command" \ "show substitute-path, too many arguments" gdb_test "unset substitute-path from" \ "No substitution rule defined for `from'" \ "unset substitute-path from, no rule entered yet" gdb_test "unset substitute-path" \ "" \ "unset substitute-path, no rule entered yet" gdb_test "unset substitute-path from" \ "No substitution rule defined for `from'" \ "unset substitute-path from, no rule entered yet" gdb_test "unset substitute-path from to" \ "Incorrect usage, too many arguments in command" \ "unset substitute-path, too many arguments" gdb_test "set substitute-path too many arguments" \ "Incorrect usage, too many arguments in command" \ "set substitute-path, too many arguments" gdb_test "set substitute-path missing" \ "Incorrect usage, too few arguments in command" \ "set substitute-path, too few arguments" gdb_test "set substitute-path '' to" \ "First argument must be at least one character long" \ "set substitute-path, first argument is empty string" gdb_test "set substitute-path from to" \ "" \ "add from -> to substitution rule" gdb_test "set substitute-path from1 to1/" \ "" \ "add from1 -> to1 substitution rule" gdb_test "set substitute-path source destination" \ "" \ "add source -> destination substitution rule" gdb_test "set substitute-path depuis/ vers" \ "" \ "add depuis -> vers substitution rule" gdb_test "set substitute-path empty ''" \ "" \ "add substitution rule to empty string" gdb_test "show substitute-path" \ "List of all source path substitution rules:\r\n +`from' -> `to'.\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \ "show substitute-path after all paths added" gdb_test "show substitute-path from" \ "Source path substitution rule matching `from':\r\n +`from' -> `to'." \ "show substitute-path from, after all paths added" gdb_test "show substitute-path depuis" \ "Source path substitution rule matching `depuis':\r\n +`depuis' -> `vers'." \ "show substitute-path depuis, after all paths added" gdb_test "show substitute-path garbage" \ "Source path substitution rule matching `garbage':" \ "show substitute-path garbage, after all paths added" gdb_test "unset substitute-path from" \ "" \ "unset substitute-path from" gdb_test "show substitute-path from" \ "Source path substitution rule matching `from':" \ "" gdb_test "show substitute-path" \ "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \ "show substitute-path after from rule removed" gdb_test "unset substitute-path from" \ "No substitution rule defined for `from'" \ "unset substitute-path from after the rule was removed" gdb_test "unset substitute-path depuis" \ "" \ "unset substitute-path depuis (middle of list)" gdb_test "show substitute-path" \ "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`empty' -> `'." \ "show substitute-path after depuis rule removed" gdb_test "unset substitute-path empty" \ "" \ "unset substitute-path empty (end of list)" gdb_test "show substitute-path" \ "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'." \ "show substitute-path after empty rule removed" gdb_test "unset substitute-path" \ "" \ "remove all remaining substitution rules" gdb_test "show substitute-path" \ "List of all source path substitution rules:" \ "show substitute-path after all remaining rules removed" --wq9mPyueHGvFACwf--