- Timestamp:
- May 23, 2009 9:48:08 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/test.h
r19882 r19944 211 211 * @param hTest The test handle. If NIL_RTTEST we'll use the one 212 212 * associated with the calling thread. 213 * @param pszSubTest The sub-test name 213 * @param pszSubTest The sub-test name. 214 214 */ 215 215 RTR3DECL(int) RTTestSub(RTTEST hTest, const char *pszSubTest); 216 217 /** 218 * Format string version of RTTestSub. 219 * 220 * See RTTestSub for details. 221 * 222 * @returns Number of chars printed. 223 * @param hTest The test handle. If NIL_RTTEST we'll use the one 224 * associated with the calling thread. 225 * @param pszSubTestFmt The sub-test name format string. 226 * @param ... Arguments. 227 */ 228 RTR3DECL(int) RTTestSubF(RTTEST hTest, const char *pszSubTestFmt, ...); 229 230 /** 231 * Format string version of RTTestSub. 232 * 233 * See RTTestSub for details. 234 * 235 * @returns Number of chars printed. 236 * @param hTest The test handle. If NIL_RTTEST we'll use the one 237 * associated with the calling thread. 238 * @param pszSubTestFmt The sub-test name format string. 239 * @param ... Arguments. 240 */ 241 RTR3DECL(int) RTTestSubV(RTTEST hTest, const char *pszSubTestFmt, va_list va); 216 242 217 243 /** … … 473 499 474 500 /** 501 * Starts a sub-test. 502 * 503 * This will perform an implicit RTTestSubDone() call if that has not been done 504 * since the last RTTestSub call. 505 * 506 * @returns Number of chars printed. 507 * @param pszSubTest The sub-test name. 508 */ 509 RTR3DECL(int) RTTestISub(const char *pszSubTest); 510 511 /** 512 * Format string version of RTTestSub. 513 * 514 * See RTTestSub for details. 515 * 516 * @returns Number of chars printed. 517 * @param pszSubTestFmt The sub-test name format string. 518 * @param ... Arguments. 519 */ 520 RTR3DECL(int) RTTestISubF(const char *pszSubTestFmt, ...); 521 522 /** 523 * Format string version of RTTestSub. 524 * 525 * See RTTestSub for details. 526 * 527 * @returns Number of chars printed. 528 * @param pszSubTestFmt The sub-test name format string. 529 * @param ... Arguments. 530 */ 531 RTR3DECL(int) RTTestISubV(const char *pszSubTestFmt, va_list va); 532 533 /** 534 * Completes a sub-test. 535 * 536 * @returns Number of chars printed. 537 */ 538 RTR3DECL(int) RTTestISubDone(void); 539 540 /** 475 541 * Prints an extended PASSED message, optional. 476 542 * -
trunk/src/VBox/Runtime/r3/test.cpp
r19939 r19944 34 34 *******************************************************************************/ 35 35 #include <iprt/test.h> 36 37 #include <iprt/asm.h> 38 #include <iprt/critsect.h> 39 #include <iprt/env.h> 40 #include <iprt/err.h> 36 41 #include <iprt/mem.h> 42 #include <iprt/once.h> 37 43 #include <iprt/param.h> 38 44 #include <iprt/string.h> 39 45 #include <iprt/stream.h> 40 #include <iprt/critsect.h>41 #include <iprt/once.h>42 #include <iprt/err.h>43 #include <iprt/asm.h>44 46 45 47 #include "internal/magics.h" … … 247 249 if (RT_SUCCESS(rc)) 248 250 { 251 /* 252 * Finally, pick up overrides from the environment. 253 */ 254 char szMaxLevel[80]; 255 rc = RTEnvGetEx(RTENV_DEFAULT, "IPRT_TEST_MAX_LEVEL", szMaxLevel, sizeof(szMaxLevel), NULL); 256 if (RT_SUCCESS(rc)) 257 { 258 char *pszMaxLevel = RTStrStrip(szMaxLevel); 259 if (!strcmp(pszMaxLevel, "all")) 260 pTest->enmMaxLevel = RTTESTLVL_DEBUG; 261 if (!strcmp(pszMaxLevel, "quiet")) 262 pTest->enmMaxLevel = RTTESTLVL_FAILURE; 263 else if (!strcmp(pszMaxLevel, "debug")) 264 pTest->enmMaxLevel = RTTESTLVL_DEBUG; 265 else if (!strcmp(pszMaxLevel, "info")) 266 pTest->enmMaxLevel = RTTESTLVL_INFO; 267 else if (!strcmp(pszMaxLevel, "sub_test")) 268 pTest->enmMaxLevel = RTTESTLVL_SUB_TEST; 269 else if (!strcmp(pszMaxLevel, "failure")) 270 pTest->enmMaxLevel = RTTESTLVL_FAILURE; 271 } 272 249 273 *phTest = pTest; 250 274 return VINF_SUCCESS; … … 807 831 808 832 /** 833 * Format string version of RTTestSub. 834 * 835 * See RTTestSub for details. 836 * 837 * @returns Number of chars printed. 838 * @param hTest The test handle. If NIL_RTTEST we'll use the one 839 * associated with the calling thread. 840 * @param pszSubTestFmt The sub-test name format string. 841 * @param ... Arguments. 842 */ 843 RTR3DECL(int) RTTestSubF(RTTEST hTest, const char *pszSubTestFmt, ...) 844 { 845 va_list va; 846 va_start(va, pszSubTestFmt); 847 int cch = RTTestSubV(hTest, pszSubTestFmt, va); 848 va_end(va); 849 return cch; 850 } 851 852 853 /** 854 * Format string version of RTTestSub. 855 * 856 * See RTTestSub for details. 857 * 858 * @returns Number of chars printed. 859 * @param hTest The test handle. If NIL_RTTEST we'll use the one 860 * associated with the calling thread. 861 * @param pszSubTestFmt The sub-test name format string. 862 * @param ... Arguments. 863 */ 864 RTR3DECL(int) RTTestSubV(RTTEST hTest, const char *pszSubTestFmt, va_list va) 865 { 866 char *pszSubTest; 867 RTStrAPrintfV(&pszSubTest, pszSubTestFmt, va); 868 if (pszSubTest) 869 { 870 int cch = RTTestSub(hTest, pszSubTest); 871 RTStrFree(pszSubTest); 872 return cch; 873 } 874 return 0; 875 } 876 877 878 /** 809 879 * Completes a sub-test. 810 880 * -
trunk/src/VBox/Runtime/r3/testi.cpp
r18847 r19944 50 50 va_end(va); 51 51 return cch; 52 } 53 54 55 RTR3DECL(int) RTTestISub(const char *pszSubTest) 56 { 57 return RTTestSub(NIL_RTTEST, pszSubTest); 58 } 59 60 61 RTR3DECL(int) RTTestISubF(const char *pszSubTestFmt, ...) 62 { 63 va_list va; 64 va_start(va, pszSubTestFmt); 65 int cch = RTTestSubV(NIL_RTTEST, pszSubTestFmt, va); 66 va_end(va); 67 return cch; 68 } 69 70 71 RTR3DECL(int) RTTestISubV(const char *pszSubTestFmt, va_list va) 72 { 73 return RTTestSubV(NIL_RTTEST, pszSubTestFmt, va); 74 } 75 76 77 RTR3DECL(int) RTTestISubDone(void) 78 { 79 return RTTestSubDone(NIL_RTTEST); 52 80 } 53 81
Note:
See TracChangeset
for help on using the changeset viewer.