Harness: Call case setup only once for control flow cases.

Niklas Hauser 2015-11-11 13:49:03 +00:00 committed by Martin Kojtal
parent 06fc81f99d
commit 64f54ed35c
2 changed files with 6 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;