Repository navigation
Conversation
Contributor
|
Writing the same set of checks against several similar test subjects (e.g. verifying multiple implementations of an interface) currently means copy-pasting the test bodies per subject. These two macros let the body be written once and instantiated per case, with each case still expanding to an ordinary TEST() - independently named, filterable, and reported on failure - so nothing new is needed in the registry or runner.
Shows both a plain data-driven table and the interface-conformance use case (one suite of checks applied to several implementations), including the local-macro pattern for reusing a case list across multiple checks.
Adds PARAMETERIZED_TEST (mu/tiny/test.h) for defining the shared body in a C file, and PARAMETERIZED_TEST_CASE_C_WRAPPER (mu/tiny/test.hpp) for registering each case from the C++ bridge file - the same two-file pattern used by TEST_C_WRAPPER and TEST_ORDERED_C_WRAPPER, giving parameterized tests parity with the rest of the test-definition macros for C code.
thetic
force-pushed
the
parameterized-tests
branch
from
September 10, 2026 06:35
061ca9f to
62a6bb8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
PARAMETERIZED_TEST/PARAMETERIZED_TEST_CASE(mu/tiny/test.hpp): write a test body once and run it against several cases, each still expanding to an ordinaryTEST()- independently named, filterable, and reported on failure. Includes C interface parity (PARAMETERIZED_TESTin test.h,PARAMETERIZED_TEST_CASE_C_WRAPPERin test.hpp) following the existingTEST_C_WRAPPER/TEST_ORDERED_C_WRAPPERbridging pattern.This adapts cpputest/cpputest#666, a CppUTest PR for parametrized mix-in tests. That design added a second global test registry and re-injected a self-looping shell into the registry at run time to iterate cases - fragile and never reached a mergeable state. This implementation instead expands entirely to plain
TEST()calls at compile time: no new registry, no runtime test-list mutation, no new Shell subclasses.Related Issues
N/A - not tied to an existing issue in this repo.
Type of Change
Manual Verification (Optional)
Checklist
docs/for any user-facing changes.mu::tinynamespace,INCLUDED_MU_TINY_guards,mutiny_C-prefix)..hand.c.cpp) is required for parity.CONTRIBUTING.mdfile to ensure compliance with architectural guidelines.