FIXTURE_VARIANT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ FIXTURE_VARIANT(9) ✨

okay so bestie, we're in the Kernel API Manual and this little icon is FIXTURE_VARIANT(9) β€” and honestly? she's giving options energy. like, plural. multiple vibes of the same test. obsessed. πŸ’…


🌸 NAME 🌸

FIXTURE_VARIANT β€” optionally called once per fixture to declare fixture variant πŸŽ€

like, optionally. nobody's forcing you. but if you want variants, this is the one who introduces them.


πŸ¦‹ SYNOPSIS πŸ¦‹

FIXTURE_VARIANT (fixture_name );

πŸ’– ARGUMENTS πŸ’–

  • fixture_name β€” the fixture name. that's her. that's the whole argument. one (1) name, no cap. ✨

🌈 DESCRIPTION 🌈

so here's the shape of it, literally:

FIXTURE_VARIANT(fixture_name) {
  type property1;
  ...
};

what she does: she defines the type of constant parameters that get provided to FIXTURE_SETUP, TEST_F and FIXTURE_TEARDOWN as variant. 🫢

and why do we care? because variants allow the same tests to be run with different arguments. same test, different lewk. main character energy, multiple outfits. πŸ’€βœ¨

ngl this is the glue that makes one test file serve a whole rainbow of argument sets β€” you declare the shape here, and the rest of the harness does the passing. 🌈

πŸ‘‘ SEE ALSO πŸ‘‘

like the whole group chat shows up for this one:


okay that's the whole page, you ate that πŸ’… go declare a variant, bestie, iykyk πŸ¦‹

β€” from ./tools/testing/selftests, dated October 2026, with love πŸŽ€πŸ’œ

πŸ“¦ where this page comes from