[PATCH v2 3/8] Add self-test framework to gdb
Eli Zaretskii
eliz@gnu.org
Thu Apr 28 05:00:00 GMT 2016
> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>
> Date: Wed, 27 Apr 2016 14:34:34 -0600
>
> I wanted to unit test the Rust lexer, so I added a simple unit testing
> command to gdb.
>
> The intent is that self tests will only be compiled into gdb in
> development mode. In release mode they simply won't exist. So, this
> exposes $development to C code as GDB_SELF_TEST.
>
> In development mode, test functions are registered with the self test
> module. A test function is just a function that does some checks, and
> aborts on failure. I chose this rather than something fancier because
> I think any such failure will require debugging anyhow.
>
> Then this adds a new "maint selftest" command which invokes the test
> functions, and a new dejagnu test case that invokes it.
>
> 2016-04-27 Tom Tromey <tom@tromey.com>
>
> * NEWS: Add "maint selftest" entry.
> * selftest.h: New file.
> * selftest.c: New file.
> * maint.c: Include selftest.h.
> (maintenance_selftest): New function.
> (_initialize_maint_cmds): Add "maint selftest" command.
> * configure.ac (GDB_SELF_TEST): Maybe define.
> * config.in, configure: Rebuild.
> * Makefile.in (SFILES): Add selftest.c.
> (COMMON_OBS): Add selftest.o.
>
> 2016-04-26 Tom Tromey <tom@tromey.com>
>
> * gdb.texinfo (Maintenance Commands): Document "maint selftest".
>
> 2016-04-26 Tom Tromey <tom@tromey.com>
>
> * gdb.gdb/unittest.exp: New file.
OK for the documentation parts.
Thanks.
More information about the Gdb-patches
mailing list