From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Jackie Smith Cashion Cc: GDB Patches Subject: Re: RFA: "show user" output Date: Mon, 10 Sep 2001 08:33:00 -0000 Message-id: <3B9CDC64.74D5A577@redhat.com> References: <3B97F051.7D3E36C2@redhat.com> <3B98D43B.777559DD@redhat.com> <3B990AFF.2B2AD149@redhat.com> <3B9A5FF3.6F86B916@redhat.com> <3B9ACF17.52E37573@redhat.com> <3B9B86B7.99F8745F@redhat.com> <3B9BA381.DD9F24B7@redhat.com> X-SW-Source: 2001-09/msg00130.html Jackie, gdb_test $2 is just a regular expression, just write/modify it as it was some regexp for grep or something and it will probably work. Just make sure that, if you add a new test, the id string is unique (i.e., no the same as other tests in the same file). Regards, Fernando Jackie Smith Cashion wrote: > > Fernando Nasser wrote: > > > > I have only one question: how come there wasn't a FAILing test in > > gdb.base/commands.exp (or there was)? And in gdb.mi? > > There is the following test in commands.exp: > > send_gdb "define mycommand\n" > ... > gdb_test "while \$arg0 > 0\nset \$arg0 -= 1\nif \(\$arg0 % 2\) == > 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" \ > ... > gdb_test "mycommand \$foo" \ > ... > gdb_test "show user mycommand" \ > "while.*set.*if.*p/x.*else.*p/x.*end.*" \ > "display user command in user_defined_command_test" > > Obviously, I've cut out several lines from the actual test. But if you > look at the last call to gdb_test you see that it simply checks to see > that the macro keywords appear in the output. The test doesn't look for > proper "whitespace". This test also would not detect our current problem > where the keywords are printed twice. > > > Tradition says that as you've fixed it you should also add a little > > test to prevent it to be broken again ;-) > > At this time I know nearly nothing about expect scripts. I don't mind > learning about them. To help me along does anyone want to offer a > suggestion about testing for "whitespace" and extra keyword output in > this test? > > Jackie Smith Cashion > > email: jsmith@redhat.com > phone: 931 438 2432 -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9