Skip to content

Commit

Permalink
FW: Test mgmt refactor: Manage lifecycle properly.
Browse files Browse the repository at this point in the history
Instead of taking care of the lifecycle of the test (special inits,
group init) in the catalog, do it where it should be done: as part of
test execution.

Signed-off-by: Arzhan Kinzhalin <arzhan.i.kinzhalin@intel.com>
  • Loading branch information
busykai committed May 6, 2024
1 parent 476d1cd commit 605be56
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions framework/sandstone.cpp
Expand Up @@ -2524,6 +2524,7 @@ static struct test *get_next_test(SandstoneTestSet::TestSetIterator &it)
}

struct test *test = *next_test;
prepare_test(test);
assert(test->id);
assert(test->description);
assert(strlen(test->id));
Expand Down
4 changes: 0 additions & 4 deletions framework/sandstone_tests.cpp
Expand Up @@ -68,8 +68,6 @@ std::vector<struct test *> SandstoneTestSet::lookup(const char *name)
return res;
}

extern void prepare_test(struct test *);

SandstoneTestSet::SandstoneTestSet(struct test_set_cfg cfg, bool all_tests, bool is_selftest) : is_selftest(is_selftest), cfg(cfg) {
load_all_tests(); /* initialize the catalog */
if (!all_tests) return;
Expand All @@ -80,7 +78,6 @@ SandstoneTestSet::SandstoneTestSet(struct test_set_cfg cfg, bool all_tests, bool
ti.test = &test;
test_map[test.id] = ti;
test_set.push_back(&test);
prepare_test(&test);
}
};

Expand All @@ -94,7 +91,6 @@ struct test_cfg_info SandstoneTestSet::enable(struct test *t) {
ti = test_map[t->id];
ti.st = TEST_ENABLED;
}
prepare_test(t);
return ti;
}

Expand Down

0 comments on commit 605be56

Please sign in to comment.