diff options
Diffstat (limited to 'gdbsupport/selftest.h')
-rw-r--r-- | gdbsupport/selftest.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdbsupport/selftest.h b/gdbsupport/selftest.h index 5ca9bdc..661431d 100644 --- a/gdbsupport/selftest.h +++ b/gdbsupport/selftest.h @@ -23,6 +23,7 @@ #include "gdbsupport/function-view.h" #include "gdbsupport/iterator-range.h" #include <set> +#include <vector> /* A test is just a function that does some checks and throws an exception if something has gone wrong. */ @@ -61,6 +62,16 @@ extern bool run_verbose (); extern void register_test (const std::string &name, std::function<void(void)> function); +/* A selftest generator is a callback function used to delay the generation + of selftests. */ + +using selftests_generator = std::function<std::vector<selftest> (void)>; + +/* Register a function which can lazily register selftests once GDB is fully + initialized. */ + +extern void add_lazy_generator (selftests_generator generator); + /* Run all the self tests. This print a message describing the number of test and the number of failures. |