This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: "show user" output


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]