Skip to content

Commit

Permalink
Fix #1130, add test case types similar to NA
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jphickey committed Aug 17, 2021
1 parent 7f4ba96 commit c6f6e6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ut_assert/inc/utassert.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*/
Expand Down
7 changes: 7 additions & 0 deletions ut_assert/src/utbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit c6f6e6b

Please sign in to comment.