Class SupportPlugin

Inheritance Relationships

Base Type

Class Documentation

class SupportPlugin : public mu::tiny::test::Plugin
[source]

Plugin that manages mock lifecycle and comparator/copier registration.

pre_test_action() installs the plugin’s comparator/copier repository into the global mock scope. post_test_action() calls Support::check_expectations() and Support::clear() on the global mock, then removes the repository.

Public Functions

SupportPlugin(const String &name = "SupportPlugin")

Construct the plugin with an optional name.

Parameters:

name – Plugin identifier; defaults to “SupportPlugin”.

~SupportPlugin() override
[source]
virtual void pre_test_action(test::Shell &test, test::Result &result) override

Install the comparator/copier repository before the test runs.

Parameters:
  • test – The test shell about to run.

  • result – The active test result accumulator.

virtual void post_test_action(test::Shell &test, test::Result &result) override

Call mock().check_expectations() and mock().clear() after the test.

Parameters:
  • test – The test shell that just ran.

  • result – The active test result accumulator.

virtual void install_comparator(StringView name, NamedValueComparator &comparator)

Register a comparator for name that persists across tests.

The comparator is installed into the plugin’s internal repository and made available to all tests that run while this plugin is active.

Parameters:
  • name – Type name key.

  • comparator – Comparator whose lifetime must exceed this plugin.

virtual void install_copier(StringView name, NamedValueCopier &copier)

Register a copier for name that persists across tests.

Parameters:
  • name – Type name key.

  • copier – Copier whose lifetime must exceed this plugin.

void clear()
[source]

Remove all registered comparators and copiers from this plugin.