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 7, 2024
1 parent 476d1cd commit 32e82de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions framework/sandstone.cpp
Expand Up @@ -1793,6 +1793,8 @@ static TestResult child_run(/*nonconst*/ struct test *test, int child_number)
debug_init_child();
}

prepare_test(test);

TestResult state = TestResult::Passed;

do {
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 32e82de

Please sign in to comment.