allow tests to be skipped

This commit is contained in:
Lephenixnoir 2021-05-21 10:18:59 +02:00
parent fec8637312
commit ec7626d789
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
3 changed files with 10 additions and 2 deletions

View File

@ -54,6 +54,9 @@ int ft_assert(ft_test *test, int expression,
(expression)); \
}
/* ft_skip(): Skip some tests */
void ft_skip(ft_test *test, int amount);
/* ft_log(): Write some data in a test's log */
__attribute__((format(printf, 2, 3)))
void ft_log(ft_test *test, char const *format, ...);

View File

@ -39,6 +39,11 @@ int ft_assert(ft_test *test, int expression, char const *file, int line,
return expression;
}
void ft_skip(ft_test *test, int count)
{
test->skipped += count;
}
void ft_log(ft_test *test, char const *format, ...)
{
va_list args1, args2;

View File

@ -152,9 +152,9 @@ static void fbar_poly_render(void *b0, int x, int y)
guaranteed = (px.done > guaranteeable_min);
if(guaranteed) px.done -= guaranteeable_min;
px.passed = (st.passed * px.done) / assertions;
px.skipped = (st.skipped * px.done) / assertions;
px.failed = px.done - px.passed - px.skipped;
px.failed = (st.failed * px.done) / assertions;
px.passed = px.done - px.skipped - px.failed;
if(guaranteed) {
px.passed += min_passed;
px.skipped += min_skipped;