VirtualBox

Changeset 46298 in vbox for trunk/include/iprt


Ignore:
Timestamp:
May 28, 2013 3:29:05 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
86046
Message:

RTTest: Added some new features/APIs for forwarding bootsector test results.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r46250 r46298  
    15261526# define RTTermRunCallbacks                             RT_MANGLER(RTTermRunCallbacks)
    15271527# define RTTestBanner                                   RT_MANGLER(RTTestBanner)
     1528# define RTTestChangeName                               RT_MANGLER(RTTestChangeName)
    15281529# define RTTestCreate                                   RT_MANGLER(RTTestCreate)
     1530# define RTTestCreateEx                                 RT_MANGLER(RTTestCreateEx)
    15291531# define RTTestDestroy                                  RT_MANGLER(RTTestDestroy)
    15301532# define RTTestErrorCount                               RT_MANGLER(RTTestErrorCount)
     
    15471549# define RTTestIFailureDetailsV                         RT_MANGLER(RTTestIFailureDetailsV)
    15481550# define RTTestInitAndCreate                            RT_MANGLER(RTTestInitAndCreate)
     1551# define RTTestInitExAndCreate                          RT_MANGLER(RTTestInitExAndCreate)
    15491552# define RTTestIPassed                                  RT_MANGLER(RTTestIPassed)
    15501553# define RTTestIPassedV                                 RT_MANGLER(RTTestIPassedV)
     
    15671570# define RTTestSkipAndDestroy                           RT_MANGLER(RTTestSkipAndDestroy)
    15681571# define RTTestSkipAndDestroyV                          RT_MANGLER(RTTestSkipAndDestroyV)
     1572# define RTTestSkipped                                  RT_MANGLER(RTTestSkipped)
     1573# define RTTestSkippedV                                 RT_MANGLER(RTTestSkippedV)
    15691574# define RTTestSub                                      RT_MANGLER(RTTestSub)
    15701575# define RTTestSubDone                                  RT_MANGLER(RTTestSubDone)
     1576# define RTTestSubErrorCount                            RT_MANGLER(RTTestSubErrorCount)
    15711577# define RTTestSubF                                     RT_MANGLER(RTTestSubF)
    15721578# define RTTestSubV                                     RT_MANGLER(RTTestSubV)
  • trunk/include/iprt/test.h

    r44529 r46298  
    4040
    4141/** A test handle. */
    42 typedef struct RTTESTINT *RTTEST;
     42typedef R3PTRTYPE(struct RTTESTINT *) RTTEST;
    4343/** A pointer to a test handle. */
    4444typedef RTTEST *PRTTEST;
     
    8080RTR3DECL(int) RTTestCreate(const char *pszTest, PRTTEST phTest);
    8181
     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 */
     138RTR3DECL(int) RTTestCreateEx(const char *pszTest, uint32_t fFlags, RTTESTLVL enmMaxLevel,
     139                             RTHCINTPTR iNativeTestPipe, const char *pszXmlFile, PRTTEST phTest);
     140
    82141/**
    83142 * Initializes IPRT and creates a test instance.
     
    104163
    105164/**
     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 */
     177RTR3DECL(RTEXITCODE) RTTestInitExAndCreate(int cArgs, char ***papszArgs, uint32_t fRtInit, const char *pszTest, PRTTEST phTest);
     178
     179/**
    106180 * Destroys a test instance previously created by RTTestCreate.
    107181 *
     
    120194 */
    121195RTR3DECL(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 */
     207RTR3DECL(int) RTTestChangeName(RTTEST hTest, const char *pszName);
    122208
    123209/**
     
    296382 * Completes a sub-test.
    297383 *
    298  * @returns Number of chars printed.
     384 * @returns Number of chars printed, negative numbers are IPRT error codes.
    299385 * @param   hTest       The test handle. If NIL_RTTEST we'll use the one
    300386 *                      associated with the calling thread.
     
    308394 * of a sub-sub-to-the-power-of-N-test.
    309395 *
    310  * @returns IPRT status code.
     396 * @returns Number of chars printed, negative numbers are IPRT error codes.
    311397 * @param   hTest       The test handle. If NIL_RTTEST we'll use the one
    312398 *                      associated with the calling thread.
     
    322408 * of a sub-sub-to-the-power-of-N-test.
    323409 *
    324  * @returns IPRT status code.
     410 * @returns Number of chars printed, negative numbers are IPRT error codes.
    325411 * @param   hTest       The test handle. If NIL_RTTEST we'll use the one
    326412 *                      associated with the calling thread.
     
    329415 */
    330416RTR3DECL(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 */
     428RTR3DECL(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 */
     440RTR3DECL(int) RTTestSkippedV(RTTEST hTest, const char *pszFormat, va_list va);
     441
    331442
    332443/**
     
    451562
    452563/**
     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 */
     570RTR3DECL(uint32_t) RTTestSubErrorCount(RTTEST hTest);
     571
     572/**
    453573 * Increments the error counter and prints a failure message.
    454574 *
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette