enum test_status {
STATUS_RUNNING, /**< Test not yet completed. */
STATUS_SUCCESS, /**< Test was successful. */
+ STATUS_SKIP, /**< Test cannot be completed. */
STATUS_ERROR, /**< Issue with the test itself. */
STATUS_FAILURE, /**< Issue with the tested matter. */
};
/** Current status of this test. */
static enum test_status status;
-/** Whether a warning has occured. */
+/** Whether a warning has occurred. */
static bool warnings;
static const char *status_to_str[] =
STA(RUNNING),
STA(SUCCESS),
+ STA(SKIP),
STA(ERROR),
STA(FAILURE),
va_end(args);
}
+void xtf_skip(const char *fmt, ...)
+{
+ va_list args;
+
+ set_status(STATUS_SKIP);
+
+ va_start(args, fmt);
+ vprintk(fmt, args);
+ va_end(args);
+}
+
void xtf_error(const char *fmt, ...)
{
va_list args;
*
* A test is expected to report one of:
* - Success
+ * - Skip
* - Error
* - Failure
*
- * 'Success' indicates that everything went well. 'Error' indicates a bug in
- * the test code or environment itself, while 'Failure' indicates a bug in the
- * code under test.
+ * 'Success' indicates that everything went well, while 'Skip' indicates that
+ * the test cannot be completed. 'Error' indicates a bug in the test code or
+ * environment itself, while 'Failure' indicates a bug in the code under test.
*
* If multiple statuses are reported, the most severe is the one which is
* kept.
*/
void xtf_warning(const char *fmt, ...) __printf(1, 2);
+/**
+ * Report a test skip.
+ *
+ * Indicates that the test cannot be completed. This may count as a success
+ * or failure, depending on the opinion of the tester.
+ */
+void xtf_skip(const char *fmt, ...) __printf(1, 2);
+
/**
* Report a test error.
*