Skip to content

Commit 950a8bb

Browse files
add FOSSIL_TEST_SKIP
1 parent 975d482 commit 950a8bb

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

code/logic/fossil/test/framework.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ extern "C" {
159159
#define FOSSIL_TEST_CASE(name) \
160160
_FOSSIL_TEST_CASE(name)
161161

162+
/**
163+
* Macro to skip a test case.
164+
* This macro is used to skip a test case in the test runner. The test case will
165+
* be marked as skipped, and the specified message will be output to the console.
166+
*/
167+
#define FOSSIL_TEST_SKIP(test_name, message) \
168+
_FOSSIL_TEST_SKIP(test_name, message)
169+
162170
/**
163171
* Macro to assume a condition in a test runner.
164172
* This macro is used to assert that a specific condition is true within a test

code/logic/fossil/test/testing.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,17 @@ void fossil_test_print_stack_trace(stack_frame_t *stack_trace);
217217
#define _FOSSIL_TEST_ASSUME(condition, message) \
218218
fossil_test_assert_internal((condition), (message), __FILE__, __LINE__, __func__)
219219

220+
/**
221+
* @brief Macro to fail a test case.
222+
*
223+
* This macro is used to fail a test case with a specific message. The test case
224+
* will be marked as failed, and the message will be displayed in the test results.
225+
*/
226+
#define _FOSSIL_TEST_SKIP(test_name, message) \
227+
test_name##_test_case.status = TEST_STATUS_SKIP; \
228+
test_name##_test_case.failure_message = message; \
229+
printf(COLOR_SKIP "SKIP: %s - %s\n" COLOR_RESET, #test_name, message); \
230+
220231
/**
221232
* @brief Macro to define a test case.
222233
*

0 commit comments

Comments
 (0)