2 Copyright (C) 2016-2017 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* All the tests that have been registered. */
25 static std::vector<self_test_function *> tests;
30 register_self_test (self_test_function *function)
32 tests.push_back (function);
42 for (int i = 0; i < tests.size (); ++i)
50 CATCH (ex, RETURN_MASK_ERROR)
53 exception_fprintf (gdb_stderr, ex, _("Self test failed: "));
57 /* Clear GDB internal state. */
59 reinit_frame_cache ();
62 printf_filtered (_("Ran %lu unit tests, %d failed\n"),
63 (long) tests.size (), failed);