Skip to content

Conversation

@lucasperin
Copy link

@lucasperin lucasperin commented Feb 23, 2022

Fixes #81 and #83

Changes

  • Fix issue where the number of iterations in nested suites is not used.

Example:

...
static MunitSuite main_suite[] = {
    {"unit_tests/", unit_tests, NULL, 1, MUNIT_SUITE_OPTION_NONE },
    {"benchmarks/", benchmarks, NULL, 100, MUNIT_SUITE_OPTION_NONE },
    { NULL, NULL, NULL, 0, MUNIT_SUITE_OPTION_NONE}
};

static const MunitSuite test_suite = {"", NULL, main_suite, 1, MUNIT_SUITE_OPTION_NONE };

All tests will run 1 iteration and the value 100 in benchmark is never accessed.

  • Add case to allow calling tests by their suite prefix

Using the same example above, now it is possible to call the test passing unit or benchmark to execute all unit tests or benchmark tests. Previously the input arguments were required to match the test name + suite prefix.

  • Added a compilation flag that returns EXIT_FAILURE in case no tests are run. This is an optional feature that helps pipelines detect (by failing) in case there is a typo or some misconfiguration in the CI file calling the tests.

@lucasperin lucasperin force-pushed the fix_iterations_and_suite_prefix branch 2 times, most recently from b0ae6ca to 82ff314 Compare February 23, 2022 06:08
…TEST_RUN compilation definition to fail tests if no tests are run. Added case to allow comparing user input test name to suite name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Number of iterations of chained suites not used.

1 participant