aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/selftest.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-09-23 13:09:48 -0600
committerTom Tromey <tromey@adacore.com>2021-10-19 12:58:50 -0600
commitd7c68312bdeca52e242326e5cf155e0aa63268bb (patch)
tree8daa0e71c0de29b9bee9f0a8376dc431b65af861 /gdbsupport/selftest.h
parent4a2f674a688df474639066922f4ce70ce97b30d2 (diff)
downloadgdb-d7c68312bdeca52e242326e5cf155e0aa63268bb.zip
gdb-d7c68312bdeca52e242326e5cf155e0aa63268bb.tar.gz
gdb-d7c68312bdeca52e242326e5cf155e0aa63268bb.tar.bz2
Always use std::function for self-tests
Now that there is a register_test variant that accepts std::function, it seems to me that the 'selftest' struct and accompanying code is obsolete -- simply always using std::function is simpler. This patch implements this idea.
Diffstat (limited to 'gdbsupport/selftest.h')
-rw-r--r--gdbsupport/selftest.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/gdbsupport/selftest.h b/gdbsupport/selftest.h
index d76fc4b..2326eba 100644
--- a/gdbsupport/selftest.h
+++ b/gdbsupport/selftest.h
@@ -24,29 +24,15 @@
/* 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;
-};
-
/* True if selftest should run verbosely. */
extern bool run_verbose ();
/* Register a new self-test. */
-extern void register_test (const std::string &name, selftest *test);
-
-/* Register a new self-test. */
-
extern void register_test (const std::string &name,
std::function<void(void)> function);