mirror of https://github.com/ARMmbed/mbed-os.git
Harness: Call case setup only once for control flow cases.
parent
06fc81f99d
commit
64f54ed35c
|
@ -61,7 +61,7 @@ void mbed::test::v0::verbose_test_tear_down_handler(const size_t passed, const s
|
|||
|
||||
mbed::test::v0::status_t mbed::test::v0::verbose_case_set_up_handler(const mbed::test::v0::Case *const source, const size_t index_of_case)
|
||||
{
|
||||
printf("\n>>> Running #%u: '%s'...\n", index_of_case, source->get_description());
|
||||
printf("\n>>> Running case #%u: '%s'...\n", index_of_case + 1, source->get_description());
|
||||
return STATUS_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -143,10 +143,12 @@ void Harness::run_next_case()
|
|||
handlers.case_tear_down = defaults.get_handler(case_current->tear_down_handler);
|
||||
handlers.case_failure = defaults.get_handler(case_current->failure_handler);
|
||||
|
||||
if (handlers.case_set_up && (handlers.case_set_up(case_current, test_index_of_case) != STATUS_CONTINUE)) {
|
||||
raise_failure(FAILURE_SETUP);
|
||||
if (!case_failed && !case_passed) {
|
||||
if (handlers.case_set_up && (handlers.case_set_up(case_current, test_index_of_case) != STATUS_CONTINUE)) {
|
||||
raise_failure(FAILURE_SETUP);
|
||||
}
|
||||
test_index_of_case++;
|
||||
}
|
||||
test_index_of_case++;
|
||||
|
||||
case_failed_before = case_failed;
|
||||
|
||||
|
|
Loading…
Reference in New Issue