/* GDB self-testing.
- Copyright (C) 2016-2020 Free Software Foundation, Inc.
+ Copyright (C) 2016-2021 Free Software Foundation, Inc.
This file is part of GDB.
/* A test is just a function that does some checks and throws an
exception if something has gone wrong. */
-typedef void self_test_function (void);
-
namespace selftests
{
-/* Interface for the various kinds of selftests. */
-
-struct selftest
-{
- virtual ~selftest () = default;
- virtual void operator() () const = 0;
-};
-
-/* Register a new self-test. */
+/* True if selftest should run verbosely. */
-extern void register_test (const std::string &name, selftest *test);
+extern bool run_verbose ();
/* Register a new self-test. */
extern void register_test (const std::string &name,
- self_test_function *function);
+ std::function<void(void)> function);
/* Run all the self tests. This print a message describing the number
of test and the number of failures.
If FILTERS is not empty, only run tests with names containing one of the
element of FILTERS. */
-extern void run_tests (gdb::array_view<const char *const> filters);
+extern void run_tests (gdb::array_view<const char *const> filters,
+ bool verbose = false);
/* Reset GDB or GDBserver's internal state. */
extern void reset ();