From c6f6e6baba0ef9022b6ca1e2aad08c17334ab838 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 16 Aug 2021 21:49:36 -0400 Subject: [PATCH] Fix #1130, add test case types similar to NA Add two more test case variants, similar to NA, where failure of the test case does not translate to failure of the overall test. The additional cases have different levels of default visibility, and may be handled differently by the end user. That is, some tests may be skipped because they are truly NA (and nothing for the user to do to change that) and some tests may be skipped because the system was not set up in a way that allowed them to be run (and the user must fix that and re-run). --- ut_assert/inc/utassert.h | 7 +++++++ ut_assert/src/utbsp.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ut_assert/inc/utassert.h b/ut_assert/inc/utassert.h index 061850709..5901e12df 100644 --- a/ut_assert/inc/utassert.h +++ b/ut_assert/inc/utassert.h @@ -59,11 +59,13 @@ typedef enum UTASSERT_CASETYPE_TSF, /**< Test Setup Failure (TSF) status messages */ UTASSERT_CASETYPE_TTF, /**< Test Teardown Failure (TTF) status messages */ UTASSERT_CASETYPE_MIR, /**< Manual Inspection Required (MIR) status messages */ + UTASSERT_CASETYPE_SKIP, /**< Test Skipped (unable to run due to external factor) status messages */ UTASSERT_CASETYPE_NA, /**< Test Not Applicable (NA) status messages */ UTASSERT_CASETYPE_BEGIN, /**< Beginning of test status messages */ UTASSERT_CASETYPE_END, /**< End of test status messages */ UTASSERT_CASETYPE_INFO, /**< All other informational status messages */ UTASSERT_CASETYPE_PASS, /**< Test case passed (normal) status messages */ + UTASSERT_CASETYPE_SOFT, /**< Condition checks/messages that do not consitute test case failures */ UTASSERT_CASETYPE_DEBUG, /**< Debugging messages */ UTASSERT_CASETYPE_MAX /**< Reserved value, No messages should be used with this */ } UtAssert_CaseType_t; @@ -153,6 +155,11 @@ typedef struct */ #define UtAssert_MIR(...) UtAssertEx(false, UTASSERT_CASETYPE_MIR, __FILE__, __LINE__, __VA_ARGS__) +/** + * \brief Skip a test due to improper setup (Manual Intervention Required) + */ +#define UtAssert_SKIP(...) UtAssertEx(false, UTASSERT_CASETYPE_SKIP, __FILE__, __LINE__, __VA_ARGS__) + /** * \brief Compares two integers and determines if they are equal within a specified absolute tolerance. */ diff --git a/ut_assert/src/utbsp.c b/ut_assert/src/utbsp.c index e64a1e8db..290bb85ac 100644 --- a/ut_assert/src/utbsp.c +++ b/ut_assert/src/utbsp.c @@ -148,6 +148,10 @@ void UT_BSP_DoText(uint8 MessageType, const char *OutputMessage) TermModeBits = OS_BSP_CONSOLEMODE_HIGHLIGHT | OS_BSP_CONSOLEMODE_RED | OS_BSP_CONSOLEMODE_BLUE; Prefix = "TTF"; break; + case UTASSERT_CASETYPE_SKIP: + TermModeBits = OS_BSP_CONSOLEMODE_HIGHLIGHT | OS_BSP_CONSOLEMODE_RED | OS_BSP_CONSOLEMODE_GREEN; + Prefix = "SKIP"; + break; case UTASSERT_CASETYPE_NA: Prefix = "N/A"; break; @@ -165,6 +169,9 @@ void UT_BSP_DoText(uint8 MessageType, const char *OutputMessage) case UTASSERT_CASETYPE_INFO: Prefix = "INFO"; break; + case UTASSERT_CASETYPE_SOFT: + Prefix = "SOFT"; + break; case UTASSERT_CASETYPE_DEBUG: Prefix = "DEBUG"; break;