Class ExpectFailShell

Inheritance Relationships

Base Type

Class Documentation

class ExpectFailShell : public mu::tiny::test::Shell
[source]

Shell that inverts the pass/fail outcome of a test.

Used by the XFAIL_TEST() macro. The test body is expected to trigger a failure; if it passes without failing, the shell marks it as failed. See also XFAIL_TEST_C_WRAPPER.

Public Functions

ExpectFailShell() = default
[source]
explicit ExpectFailShell(const char *group_name, const char *test_name, const char *file_name, int_least32_t line_number)

Construct and register an expect-fail test.

Parameters:
  • group_name – Name of the test group.

  • test_name – Name of the individual test case.

  • file_name – Source file where the test is defined.

  • line_number – Line number of the test definition.

~ExpectFailShell() override = default
[source]
ExpectFailShell(const ExpectFailShell&) = delete
ExpectFailShell &operator=(const ExpectFailShell&) = delete

Protected Functions

virtual String get_macro_name() const override
Returns:

The macro name reported in failure messages ("XFAIL_TEST").

virtual void run_one_test(Plugin *plugin, Result &result) override

Run the test body and invert the result.

Parameters:
  • plugin – The active plugin chain.

  • result – The active result accumulator.