Class Plugin¶
Defined in File Plugin.hpp
Inheritance Relationships¶
Derived Types¶
public mu::tiny::mock::SupportPlugin(Class SupportPlugin)public mu::tiny::test::JUnitOutputPlugin(Class JUnitOutputPlugin)public mu::tiny::test::SetPointerPlugin(Class SetPointerPlugin)public mu::tiny::test::TapOutputPlugin(Class TapOutputPlugin)
Class Documentation¶
-
class Plugin¶
[source] Base class for test lifecycle extensions.
Plugins are linked together in a chain; all pre_test_action(), post_test_action(), and parse_arguments() calls propagate through the entire chain automatically via the run_all_*() and parse_all_*() helpers.
Subclassed by mu::tiny::mock::SupportPlugin, mu::tiny::test::JUnitOutputPlugin, mu::tiny::test::SetPointerPlugin, mu::tiny::test::TapOutputPlugin
Public Functions
-
Plugin(const String &name)¶
Construct a named plugin.
- Parameters:
name – Identifier used for logging and retrieval by name.
-
virtual void pre_test_action(Shell &test, Result &result)¶
Called once before each test body executes.
Override to set up per-test state. The default implementation does nothing.
- Parameters:
test – The test shell about to run.
result – The active test result accumulator.
-
virtual void post_test_action(Shell &test, Result &result)¶
Called once after each test body completes (pass or fail).
Override to tear down per-test state. The default implementation does nothing.
- Parameters:
test – The test shell that just ran.
result – The active test result accumulator.
-
virtual bool parse_arguments(int argc, const char *const *argv)¶
Handle a custom command-line argument.
Called with a pre-sliced view where
argv[0] is the argument to inspect andargcis the number of remaining arguments (includingargv[0]). Return true to indicate the argument was consumed.- Parameters:
argc – Remaining argument count (
argv[0] through end).argv – Pointer to the current argument.
- Returns:
true if
argv[0] was consumed.
-
inline virtual String get_help() const¶
Return a help string for this plugin’s command-line arguments.
- Returns:
Help text, or an empty string if no arguments are accepted.
-
inline virtual Output *create_output()¶
[source] Create an Output for this plugin, if any.
- Returns:
A new Output, or nullptr if this plugin produces no output.
-
virtual Output *create_all_outputs()¶
[source] Collect all outputs from the plugin chain.
Calls create_output() on each enabled plugin in the chain and wires them together as a composite output.
- Returns:
Combined Output for the entire plugin chain.
-
virtual void run_all_pre_test_action(Shell &test, Result &result)¶
Invoke pre_test_action() on this plugin and all following plugins.
-
virtual void run_all_post_test_action(Shell &test, Result &result)¶
Invoke post_test_action() on this plugin and all following plugins.
-
virtual bool parse_all_arguments(int argc, const char *const *argv)¶
Invoke parse_arguments() on each plugin in the chain.
- Parameters:
argc – Remaining argument count (
argv[0] through end).argv – Pointer to the current argument.
- Returns:
true if any plugin consumed the argument.
-
virtual bool parse_all_arguments(int argc, char **argv)¶
Overload accepting a non-const argv.
- Parameters:
argc – Remaining argument count (
argv[0] through end).argv – Pointer to the current argument.
- Returns:
true if any plugin consumed the argument.
-
virtual String get_all_help() const¶
- Returns:
Concatenated help strings from all plugins in the chain.
-
virtual Plugin *add_plugin(Plugin *plugin)¶
Append
pluginto the end of the plugin chain.- Parameters:
plugin – Plugin to add; must not already be in a chain.
- Returns:
plugin.
-
Plugin(const String &name)¶