aboutsummaryrefslogtreecommitdiff
path: root/gdb/selftest.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-12Change selttest.c to use use std::vectorTom Tromey1-13/+7
This patch changes selftest.c to use std::vector rather than VEC. I think this is a small net plus. 2016-10-12 Tom Tromey <tom@tromey.com> * selftest.c: Include <vector>, not "vec.h". (self_test_function_ptr): Remove. (tests): Now a std::vector. (register_self_test, run_self_tests): Update.
2016-05-17Add self-test framework to gdbTom Tromey1-0/+67
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 throws an exception on failure. Then this adds a new "maint selftest" command which invokes the test functions, and a new dejagnu test case that invokes it. 2016-05-17 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-05-17 Tom Tromey <tom@tromey.com> * gdb.texinfo (Maintenance Commands): Document "maint selftest". 2016-05-17 Tom Tromey <tom@tromey.com> * gdb.gdb/unittest.exp: New file.