int
testcase_run_one(const struct testgroup_t *group,
- const struct testcase_t *testcase)
+ const struct testcase_t *testcase,
+ const int test_attempts)
{
enum outcome outcome;
if (opt_verbosity>0 && !opt_forked)
puts("SKIPPED");
} else {
- if (!opt_forked)
+ if (!opt_forked && (testcase->flags & TT_RETRIABLE) && !test_attempts)
printf("\n [%s FAILED]\n", testcase->name);
}
struct testgroup_t *group = &groups[i];
for (j = 0; group->cases[j].name; ++j) {
struct testcase_t *testcase = &group->cases[j];
- int attempts = opt_retries;
+ int attempts = (testcase->flags & TT_RETRIABLE) ? opt_retries : 0;
int test_ret_err;
if (!(testcase->flags & TT_ENABLED_))
continue;
for (;;) {
- test_ret_err = testcase_run_one(group, testcase);
+ test_ret_err = testcase_run_one(group, testcase, attempts);
if (test_ret_err == OK)
break;
- if (!(testcase->flags & TT_RETRIABLE))
+ if (!attempts--)
break;
printf("\n [RETRYING %s (attempts left %i, delay %i sec)]\n", testcase->name, attempts, opt_retries_delay);
#ifdef _WIN32
#else
sleep(opt_retries_delay);
#endif
- if (!attempts--)
- break;
}
switch (test_ret_err) {
tinytest_set_flag_(groups, named, 1, TT_SKIP)
/** Run a single testcase in a single group. */
-int testcase_run_one(const struct testgroup_t *,const struct testcase_t *);
+int testcase_run_one(const struct testgroup_t *,const struct testcase_t *, const int test_attempts);
void tinytest_set_aliases(const struct testlist_alias_t *aliases);