Changeset 46298 in vbox for trunk/include/iprt
- Timestamp:
- May 28, 2013 3:29:05 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86046
- Location:
- trunk/include/iprt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/mangling.h
r46250 r46298 1526 1526 # define RTTermRunCallbacks RT_MANGLER(RTTermRunCallbacks) 1527 1527 # define RTTestBanner RT_MANGLER(RTTestBanner) 1528 # define RTTestChangeName RT_MANGLER(RTTestChangeName) 1528 1529 # define RTTestCreate RT_MANGLER(RTTestCreate) 1530 # define RTTestCreateEx RT_MANGLER(RTTestCreateEx) 1529 1531 # define RTTestDestroy RT_MANGLER(RTTestDestroy) 1530 1532 # define RTTestErrorCount RT_MANGLER(RTTestErrorCount) … … 1547 1549 # define RTTestIFailureDetailsV RT_MANGLER(RTTestIFailureDetailsV) 1548 1550 # define RTTestInitAndCreate RT_MANGLER(RTTestInitAndCreate) 1551 # define RTTestInitExAndCreate RT_MANGLER(RTTestInitExAndCreate) 1549 1552 # define RTTestIPassed RT_MANGLER(RTTestIPassed) 1550 1553 # define RTTestIPassedV RT_MANGLER(RTTestIPassedV) … … 1567 1570 # define RTTestSkipAndDestroy RT_MANGLER(RTTestSkipAndDestroy) 1568 1571 # define RTTestSkipAndDestroyV RT_MANGLER(RTTestSkipAndDestroyV) 1572 # define RTTestSkipped RT_MANGLER(RTTestSkipped) 1573 # define RTTestSkippedV RT_MANGLER(RTTestSkippedV) 1569 1574 # define RTTestSub RT_MANGLER(RTTestSub) 1570 1575 # define RTTestSubDone RT_MANGLER(RTTestSubDone) 1576 # define RTTestSubErrorCount RT_MANGLER(RTTestSubErrorCount) 1571 1577 # define RTTestSubF RT_MANGLER(RTTestSubF) 1572 1578 # define RTTestSubV RT_MANGLER(RTTestSubV) -
trunk/include/iprt/test.h
r44529 r46298 40 40 41 41 /** A test handle. */ 42 typedef struct RTTESTINT *RTTEST;42 typedef R3PTRTYPE(struct RTTESTINT *) RTTEST; 43 43 /** A pointer to a test handle. */ 44 44 typedef RTTEST *PRTTEST; … … 80 80 RTR3DECL(int) RTTestCreate(const char *pszTest, PRTTEST phTest); 81 81 82 /** @name RTTEST_C_XXX - Flags for RTTestCreateEx. 83 * @{ */ 84 /** Whether to check the IPRT_TEST_XXX variables when constructing the 85 * instance. The following environment variables get checks: 86 * 87 * - IPRT_TEST_MAX_LEVEL: String value indicating which level. 88 * The env. var. is applied if the program specified the default level 89 * (by passing RTTESTLVL_INVALID). 90 * 91 * - IPRT_TEST_PIPE: The native pipe/fifo handle to write XML 92 * results to. 93 * The env. var. is applied if iNativeTestPipe is -1. 94 * 95 * - IPRT_TEST_FILE: Path to file/named-pipe/fifo/whatever to 96 * write XML results to. 97 * The env. var. is applied if the program specified a NULL path, it is 98 * not applied if the program hands us an empty string. 99 * 100 * - IPRT_TEST_OMIT_TOP_TEST: If present, this makes the XML output omit 101 * the top level test element. 102 * The env. var is applied when present. 103 * 104 */ 105 #define RTTEST_C_USE_ENV RT_BIT(0) 106 /** Whether to omit the top test in the XML. */ 107 #define RTTEST_C_XML_OMIT_TOP_TEST RT_BIT(1) 108 /** Whether to delay the top test XML element until testing commences. */ 109 #define RTTEST_C_XML_DELAY_TOP_TEST RT_BIT(2) 110 /** Whether to try install the test instance in the test TLS slot. Setting 111 * this flag is incompatible with using the RTTestIXxxx variant of the API. */ 112 #define RTTEST_C_NO_TLS RT_BIT(3) 113 /** Mask containing the valid bits. */ 114 #define RTTEST_C_VALID_MASK UINT32_C(0x0000000f) 115 /** @} */ 116 117 118 /** 119 * Creates a test instance. 120 * 121 * @returns IPRT status code. 122 * @param pszTest The test name. 123 * @param pszXmlFile The XML output file/pipe/whatever. 124 * @param fFlags Flags, see RTTEST_C_XXX. 125 * @param enmMaxLevel The max message level. Use RTTESTLVL_INVALID for 126 * the default output level or one from the 127 * environment. If specified, the environment variable 128 * will not be able to override it. 129 * @param iNativeTestPipe Native handle to a test pipe. -1 if not interested. 130 * @param pszXmlFile The XML output file name. If NULL the environment 131 * may be used. To selectively avoid that, pass an 132 * empty string. 133 * @param phTest Where to store the test instance handle. 134 * 135 * @note At the moment, we don't fail if @a pszXmlFile or @a iNativeTestPipe 136 * fails to open. This may change later. 137 */ 138 RTR3DECL(int) RTTestCreateEx(const char *pszTest, uint32_t fFlags, RTTESTLVL enmMaxLevel, 139 RTHCINTPTR iNativeTestPipe, const char *pszXmlFile, PRTTEST phTest); 140 82 141 /** 83 142 * Initializes IPRT and creates a test instance. … … 104 163 105 164 /** 165 * Variant of RTTestInitAndCreate that includes IPRT init flags and argument 166 * vectors. 167 * 168 * @returns RTEXITCODE_SUCCESS on success. On failure an error message is 169 * printed and a suitable exit code is return. 170 * 171 * @param cArgs Pointer to the argument count. 172 * @param ppapszArgs Pointer to the argument vector pointer. 173 * @param fRtInit Flags, see RTR3INIT_XXX. 174 * @param pszTest The test name. 175 * @param phTest Where to store the test instance handle. 176 */ 177 RTR3DECL(RTEXITCODE) RTTestInitExAndCreate(int cArgs, char ***papszArgs, uint32_t fRtInit, const char *pszTest, PRTTEST phTest); 178 179 /** 106 180 * Destroys a test instance previously created by RTTestCreate. 107 181 * … … 120 194 */ 121 195 RTR3DECL(int) RTTestSetDefault(RTTEST hNewDefaultTest, PRTTEST phOldTest); 196 197 /** 198 * Changes the test case name. 199 * 200 * @returns IRPT status code. 201 * @param hTest The test handle. If NIL_RTTEST we'll use the one 202 * associated with the calling thread. 203 * @param pszName The new test case name. Empty string is not accepted, 204 * nor are strings longer than 127 chars. Keep it short 205 * but descriptive. 206 */ 207 RTR3DECL(int) RTTestChangeName(RTTEST hTest, const char *pszName); 122 208 123 209 /** … … 296 382 * Completes a sub-test. 297 383 * 298 * @returns Number of chars printed .384 * @returns Number of chars printed, negative numbers are IPRT error codes. 299 385 * @param hTest The test handle. If NIL_RTTEST we'll use the one 300 386 * associated with the calling thread. … … 308 394 * of a sub-sub-to-the-power-of-N-test. 309 395 * 310 * @returns IPRT status code.396 * @returns Number of chars printed, negative numbers are IPRT error codes. 311 397 * @param hTest The test handle. If NIL_RTTEST we'll use the one 312 398 * associated with the calling thread. … … 322 408 * of a sub-sub-to-the-power-of-N-test. 323 409 * 324 * @returns IPRT status code.410 * @returns Number of chars printed, negative numbers are IPRT error codes. 325 411 * @param hTest The test handle. If NIL_RTTEST we'll use the one 326 412 * associated with the calling thread. … … 329 415 */ 330 416 RTR3DECL(int) RTTestPassed(RTTEST hTest, const char *pszFormat, ...); 417 418 /** 419 * Marks the current test as 'SKIPPED' and optionally displays a message 420 * explaining why. 421 * 422 * @returns Number of chars printed, negative numbers are IPRT error codes. 423 * @param hTest The test handle. If NIL_RTTEST we'll use the one 424 * associated with the calling thread. 425 * @param pszFormat The message. No trailing newline. Can be NULL or empty. 426 * @param ... The arguments. 427 */ 428 RTR3DECL(int) RTTestSkipped(RTTEST hTest, const char *pszFormat, ...); 429 430 /** 431 * Marks the current test as 'SKIPPED' and optionally displays a message 432 * explaining why. 433 * 434 * @returns Number of chars printed, negative numbers are IPRT error codes. 435 * @param hTest The test handle. If NIL_RTTEST we'll use the one 436 * associated with the calling thread. 437 * @param pszFormat The message. No trailing newline. Can be NULL or empty. 438 * @param va The arguments. 439 */ 440 RTR3DECL(int) RTTestSkippedV(RTTEST hTest, const char *pszFormat, va_list va); 441 331 442 332 443 /** … … 451 562 452 563 /** 564 * Get the error count of the current sub test. 565 * 566 * @returns The error counter, UINT32_MAX if no valid test handle. 567 * @param hTest The test handle. If NIL_RTTEST we'll use the one 568 * associated with the calling thread. 569 */ 570 RTR3DECL(uint32_t) RTTestSubErrorCount(RTTEST hTest); 571 572 /** 453 573 * Increments the error counter and prints a failure message. 454 574 *
Note:
See TracChangeset
for help on using the changeset viewer.