Changeset 9b20126 in mainline for uspace/lib/pcut/src/internal.h
- Timestamp:
- 2014-09-19T08:23:01Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c85a57f
- Parents:
- 15d0046
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/internal.h
r15d0046 r9b20126 37 37 #include <stdlib.h> 38 38 39 40 /** @def PCUT_DEBUG(msg, ...) 41 * Debug printing. 42 * 43 * By default, this macro does nothing. Define PCUT_DEBUG_BUILD to 44 * actually print the messages to the console. 45 * 46 * @param msg Printf-like formatting message. 47 * @param ... Extra arguments for printf. 48 */ 49 #ifdef PCUT_DEBUG_BUILD 50 #include <stdio.h> 51 #define PCUT_DEBUG_INTERNAL(msg, ...) \ 52 fprintf(stderr, "[PCUT %s:%d]: " msg "%s", __FILE__, __LINE__, __VA_ARGS__) 53 #define PCUT_DEBUG(...) \ 54 PCUT_DEBUG_INTERNAL( \ 55 PCUT_VARG_GET_FIRST(__VA_ARGS__, this_arg_is_ignored), \ 56 PCUT_VARG_SKIP_FIRST(__VA_ARGS__, "\n") \ 57 ) 58 #else 59 #define PCUT_DEBUG(...) (void)0 60 #endif 61 62 39 63 /** Mark a variable as unused. */ 40 64 #define PCUT_UNUSED(x) ((void)x) … … 63 87 /** Test outcome: test failed unexpectedly. */ 64 88 #define TEST_OUTCOME_ERROR 3 89 90 91 /* 92 * Use sprintf_s in Windows but only with Microsoft compiler. 93 * Namely, let MinGW use snprintf. 94 */ 95 #if (defined(__WIN64) || defined(__WIN32) || defined(_WIN32)) && defined(_MSC_VER) 96 #define snprintf sprintf_s 97 #endif 65 98 66 99 extern int pcut_run_mode; … … 92 125 /** Initialize the reporting, given all tests. */ 93 126 void (*init)(pcut_item_t *); 127 /** Finalize the reporting. */ 128 void (*done)(void); 94 129 /** Test suite just started. */ 95 130 void (*suite_start)(pcut_item_t *); … … 101 136 void (*test_done)(pcut_item_t *, int, const char *, const char *, 102 137 const char *); 103 /** Finalize the reporting. */104 void (*done)(void);105 138 }; 106 139 … … 120 153 /* OS-dependent functions. */ 121 154 155 /** Hook to execute before test starts. 156 * 157 * Useful for OS-specific preparations prior to launching the actual 158 * test code (i. e. sandboxing the process more etc.). 159 * 160 * This function is not run by the launcher process that only 161 * starts other tests in separate processes. 162 * 163 * @param test The test that is about to be executed. 164 */ 165 void pcut_hook_before_test(pcut_item_t *test); 166 122 167 /** Tell whether two strings start with the same prefix. 123 168 *
Note:
See TracChangeset
for help on using the changeset viewer.