From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Subject: Re: Need suggestions on how to test observer.c
Date: Mon, 10 Mar 2003 23:26:00 -0000 [thread overview]
Message-ID: <20030310232601.GA13541@nevyn.them.org> (raw)
In-Reply-To: <20030310224356.GG972@gnat.com>
On Mon, Mar 10, 2003 at 02:43:56PM -0800, Joel Brobecker wrote:
> The last time I needed to do some unit-testing, it was for the xfullpath
> command, and it was pretty easy to test it inside gdb.gdb by debugging
> gdb itself, and use inferior function calls with appropriate parameters.
> It would be good to use the same approach one more time. Unfortunately,
> it is not so easy this time. We could use the same trick, except that
> one of the parameters is a function pointer. That means we would need to
> find some functions in GDB that could be used as callbacks:
> - Second case: we add 3 dummy functions to the GDB code that would
> do exactly what that functions in my testdrive do: increment an
> integer each time they are called. We would then use them as
> callbacks, and use the integers to check that the notifiation
> worked properly.
I have no objection to adding these dummies to observer.c; I think I
prefer that, because it tests observer code in the closer to the same
way it will be used.
>
> So, to summarize, we have several options (in order of personnal
> preference):
> 1. Compile and run my little test_observer.c program outside of GDB
> and check the output. To compile it, use the trick above to avoid
> the dependency on the entire GDB code.
> 2. Update the makefile to give runtest the information necessary in
> order to be able to find libgdb.a and all dependents. Then setup
> the test to compile test_observer with that information. Run
> this program outside of GDB, and check the output.
> 3. Add new benign functions inside observer.c to allow the testing
> to be done via inferior function calls.
> 4. Find and use already defined functions in GDB, test the observer
> via inferior function calls.
> 5. Do not add an observer-specific test. When a bug shows up due to
> an observer.c bug, we'll then add a testcase as usual. The testing
> coverage for observer.c will slowly increase.
>
> Let me know what you prefer, and I'll go from there.
>
> Thanks,
> --
> Joel
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-03-10 23:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-10 22:43 Joel Brobecker
2003-03-10 23:26 ` Daniel Jacobowitz [this message]
2003-03-11 19:09 ` Joel Brobecker
2003-03-11 20:31 ` David Carlton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030310232601.GA13541@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox