diff options
Diffstat (limited to 'gdb/maint.c')
-rw-r--r-- | gdb/maint.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/maint.c b/gdb/maint.c index 5da1c11..d2c9346 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -41,6 +41,7 @@ #include "top.h" #include "timeval-utils.h" #include "maint.h" +#include "selftest.h" #include "cli/cli-decode.h" #include "cli/cli-utils.h" @@ -981,6 +982,16 @@ show_per_command_cmd (char *args, int from_tty) cmd_show_list (per_command_showlist, from_tty, ""); } + +/* The "maintenance selftest" command. */ + +static void +maintenance_selftest (char *args, int from_tty) +{ + run_self_tests (); +} + + void _initialize_maint_cmds (void) { @@ -1153,6 +1164,13 @@ testsuite can check the command deprecator. You probably shouldn't use this,\n\ If you decide you want to use it: maintenance undeprecate 'commandname'"), &maintenancelist); + add_cmd ("selftest", class_maintenance, maintenance_selftest, _("\ +Run gdb's unit tests.\n\ +Usage: maintenance selftest\n\ +This will run any unit tests that were built in to gdb.\n\ +gdb will abort if any test fails."), + &maintenancelist); + add_setshow_zinteger_cmd ("watchdog", class_maintenance, &watchdog, _("\ Set watchdog timer."), _("\ Show watchdog timer."), _("\ |