Class Registry¶
Defined in File Registry.hpp
Class Documentation¶
-
class Registry¶
[source] Central repository of all registered tests.
Tests are registered automatically at static-initialization time by Installer instances created by the TEST() and TEST_GROUP() macros. CommandLineRunner retrieves the current registry via get_current_registry() and delegates to run_all_tests() to execute them.
Public Functions
-
virtual void add_test(Shell *test)¶
Append
testto the registered test list.- Parameters:
test – Shell to register.
-
virtual void un_do_last_add_test()¶
[source] Remove the most recently added test (used by Installer::un_do()).
-
virtual void run_all_tests(Result &result)¶
Run all tests that pass the current filters.
- Parameters:
result – Accumulator for results and output.
-
virtual void shuffle_tests(size_t seed)¶
Shuffle the test execution order using a seeded algorithm.
- Parameters:
seed – Random seed.
-
virtual void list_test_group_names(Result &result)¶
Print all registered group names to
result.- Parameters:
result – Output sink.
-
virtual void list_test_group_and_case_names(Result &result)¶
Print all
group.casenames toresult.- Parameters:
result – Output sink.
-
virtual void list_test_locations(Result &result)¶
Print all test source locations to
result.- Parameters:
result – Output sink.
-
virtual void list_ordered_test_locations(Result &result)¶
Print all ordered-test source locations to
result.- Parameters:
result – Output sink.
-
virtual void list_test_group_locations(Result &result)¶
Print all test-group source locations to
result.Each line has the format
group.file.line. Locations are taken from mu::tiny::test::GroupLocation instances registered by the TEST_GROUP() macro, so they point to the group declaration itself rather than any individual test inside it.- Parameters:
result – Output sink.
-
virtual void set_name_filters(const Filter *filters)¶
Set the name filters applied when running tests.
- Parameters:
filters – Linked list of name filters; may be nullptr.
-
virtual void set_group_filters(const Filter *filters)¶
Set the group filters applied when running tests.
- Parameters:
filters – Linked list of group filters; may be nullptr.
-
virtual void install_plugin(Plugin *plugin)¶
Append
pluginto the plugin chain.- Parameters:
plugin – Plugin to install.
-
virtual void restore_plugins(Plugin *head)¶
Restore the plugin chain to a previously saved head.
Intended for use with get_first_plugin(): save the head before installing temporary plugins, then call this to undo those installations.
- Parameters:
head – Plugin to make the new head of the chain.
-
virtual Shell *get_test_with_next(Shell *test)¶
Return the test after
testin registration order.- Parameters:
test – Current test.
- Returns:
The next test, or nullptr.
-
virtual Shell *find_test_with_name(const String &name)¶
Find the first test whose name matches
name.
-
virtual Shell *find_test_with_group(const String &name)¶
Find the first test in the group named
name.- Parameters:
name – Group name to search for.
- Returns:
The matching Shell, or nullptr.
-
virtual void set_current_registry(Registry *registry)¶
Replace the process-wide current registry.
- Parameters:
registry – New current registry.
-
inline int get_current_repetition() const¶
- Returns:
The current repetition number (1-based during a multi-run).
-
void set_run_skipped()¶
[source] Enable running SKIPPED_TEST() tests in this registry.
Public Static Functions
-
static Registry *get_current_registry()¶
[source] - Returns:
The process-wide current registry (used by the TEST() macro and CommandLineRunner).
-
virtual void add_test(Shell *test)¶