This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH 4/8] Add self-test framework to gdb


On 04/27/2016 03:49 AM, Tom Tromey wrote:
> 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.

IIUC, it'll internal error, not abort/crash directly, right?

> Then this adds a new "maint selftest" command which invokes the test
> functions, and a new dejagnu test case that invokes it.

Looks good to me.

Could you include a NEWS change for "maintenance selftest" ?

Thanks,
Pedro Alves


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