Closed jbboehr closed 4 years ago
I think a skip should not abort the test, unlike an assertion failure. Otherwise, if you run without fork-mode, an earlier skip will prevent all followup tests from running. With assertion failures that is fine, because you better debug the first failure you encounter. For skip, that seems undesirable.
Compare to glib's g_test_skip()
, which just remembers the verdict of the test, and evaluates the test result at the end.
Yes, it means, usually the user would follow up that with an additional return, like
if (!has_dependency()) {
ck_skip("Lacks dependency");
return;
}
I think this would be a good feature.
ck_skip()
aborts the test and marks it as skippedck_skip_msg(...)
does the same with a custom printf message_ck_skip()
is exposed as a symbolThese are all analogues of
ck_abort()
,ck_abort_msg()
, and_ck_assert_failed()
Since they basically work like
ck_abort()
, I decided to use a flagwasskipped
inFailMsg
instead of adding a new message type.As it is, I'm not including skipped tests in the success percentage, but they are included in total tests run. I considered adding
srunner_ntests_skipped()
andsrunner_skipped()
but decided to hold off since they are included insrunner_results()
In
tr_type_str
, I assigned skip toK
because the default return value wasS
already. I'm not sure if there's a more appropriate value here.I'm personally using check with the autotools tap driver, and it seems to be working alright so far.
Let me know if you have any thoughts and, of course, feel free to request changes.
Closes #178