Skip to content

Commit fe19efb

Browse files
committed
test(test-impact): make the conditional-path fixture a valid coverage map
A coverage map must cover every function it lists, and five of the seven variants covered only function 1, so the map failed to parse and the test stopped at its setup ("map is NULL") with the fix applied or not. The changed function (0) is now covered by the setup row of a suite no runner registers, so alpha's own rows stay quiet and each variant still reaches alpha by exactly one path. RED with the selection fix reverted (alpha lacks CONDITIONAL), green with it. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 7ec13ad commit fe19efb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎tests/test_test_impact.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,17 +1720,21 @@ TEST(test_selection_inventory_ambiguity_and_conditionals_use_whole_suite) {
17201720
* runner that lacks it then tolerates its absence. Its cases and registrations
17211721
* are unconditional here, so only the runner registration can say so. */
17221722
TEST(test_selection_conditionally_registered_suite_is_conditional_on_every_path) {
1723+
/* A map covers every function it lists, so the changed one (0) is covered
1724+
* by the setup of a suite no runner registers: alpha's own rows stay
1725+
* quiet and each variant reaches alpha by its one path. */
17231726
static const char *quiet_rows = "alpha:*\tcomplete\t\t1\nalpha:stat\tcomplete\t\t1\n"
17241727
"alpha:cov\tcomplete\t\t1\nalpha:changed\tcomplete\t\t1\n"
1725-
"alpha:quiet\tcomplete\t\t1\n";
1728+
"alpha:quiet\tcomplete\t\t1\nomega:*\tcomplete\t\t0\n";
17261729
struct {
17271730
const char *rows;
17281731
bool admitted;
17291732
bool reached, changed, rule;
17301733
unsigned path;
17311734
} variants[] = {
17321735
{"alpha:*\tincomplete\tlost setup\t1\nalpha:stat\tcomplete\t\t1\n"
1733-
"alpha:cov\tcomplete\t\t1\nalpha:changed\tcomplete\t\t1\nalpha:quiet\tcomplete\t\t1\n",
1736+
"alpha:cov\tcomplete\t\t1\nalpha:changed\tcomplete\t\t1\nalpha:quiet\tcomplete\t\t1\n"
1737+
"omega:*\tcomplete\t\t0\n",
17341738
true, false, false, false, CBM_TEST_SELECT_SETUP_UNKNOWN},
17351739
{"alpha:*\tcomplete\t\t0\nalpha:stat\tcomplete\t\t1\n"
17361740
"alpha:cov\tcomplete\t\t1\nalpha:changed\tcomplete\t\t1\nalpha:quiet\tcomplete\t\t1\n",

0 commit comments

Comments
 (0)