Class JUnitOutputPlugin

Inheritance Relationships

Base Type

Class Documentation

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

Plugin that produces a JUnit-style XML report alongside console output.

Install this plugin before calling CommandLineRunner::run_all_tests_main() to enable the -pjunit[=<name>] command-line argument. When activated, create_output() returns a JUnitOutput that writes XML alongside console output.

Public Functions

explicit JUnitOutputPlugin(const String &default_package_name = "")

Construct the plugin with an optional default package name.

Parameters:

default_package_name – Used as the JUnit package name when -pjunit is given without an explicit =name suffix. Pass the executable basename to reproduce the standard behaviour. Defaults to empty, which leaves the package name unset.

virtual bool parse_arguments(int argc, const char *const *argv) override

Handle the -pjunit[=<name>] command-line argument.

Parameters:
  • argc – Remaining argument count (argv[0] through end).

  • argv – Pointer to the current argument.

Returns:

true if the argument was consumed.

virtual String get_help() const override

Return help text for the -pjunit option.

Returns:

A String describing the argument.

virtual Output *create_output() override
[source]

Create the JUnit XML output object when -pjunit was supplied.

Returns:

A new JUnitOutput, or nullptr if the plugin is not active.