This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 3/8] Add self-test framework to gdb
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 28 Apr 2016 08:00:29 +0300
- Subject: Re: [PATCH v2 3/8] Add self-test framework to gdb
- Authentication-results: sourceware.org; auth=none
- References: <1461789279-15996-1-git-send-email-tom at tromey dot com> <1461789279-15996-4-git-send-email-tom at tromey dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.