VirtualBox

忽略:
時間撮記:
2024-2-8 上午12:00:32 (14 月 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
161553
訊息:

IPRT,VMMDev,Bs3Kit: Added support for sub-sub-tests to better deal with bs3-cpu-generated-1 and others with too many sub-tests for the test manager.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestTerm.c

    r103183 r103262  
    4343
    4444
     45static void bs3TestSubCleanupWorker(char const BS3_FAR *pszName, bool fSkipped, uint16_t cErrorsAtStart, uint32_t uDoneCmd,
     46                                    char const BS3_FAR *pszParent)
     47{
     48    uint16_t const cErrors = g_cusBs3TestErrors - cErrorsAtStart;
     49    size_t         cch     = Bs3StrLen(pszName);
     50
     51    /* Tell VMMDev. */
     52    bs3TestSendCmdWithU32(uDoneCmd, cErrors);
     53
     54    /* Print result to the console. */
     55    if (pszParent)
     56    {
     57        Bs3PrintStr(pszParent);
     58        cch += Bs3StrLen(pszParent) + 3;
     59        Bs3PrintStr(" / ");
     60    }
     61    Bs3PrintStr(pszName);
     62    Bs3PrintChr(':');
     63    do
     64        Bs3PrintChr(' ');
     65    while (cch++ < 49);
     66
     67    if (!cErrors)
     68        Bs3PrintStr(!fSkipped ? "PASSED\n" : "SKIPPED\n");
     69    else
     70    {
     71        if (uDoneCmd == VMMDEV_TESTING_CMD_SUB_DONE)
     72            g_cusBs3SubTestsFailed++;
     73        else
     74            g_cusBs3SubSubTestsFailed++;
     75        Bs3Printf("FAILED (%u errors)\n", cErrors);
     76    }
     77}
     78
     79
     80/**
     81 * Cleans up the current sub-sub-test.
     82 */
     83BS3_DECL(void) bs3TestSubSubCleanup(void)
     84{
     85    if (g_szBs3SubSubTest[0] != '\0')
     86    {
     87        if (!g_fbBs3SubSubTestReported)
     88            bs3TestSubCleanupWorker(g_szBs3SubSubTest, g_fbBs3SubSubTestSkipped, g_cusBs3SubSubTestAtErrors,
     89                                    VMMDEV_TESTING_CMD_SUBSUB_DONE, g_szBs3SubTest);
     90
     91        /* Reset the sub-sub-test. */
     92        g_fbBs3SubSubTestReported = true;
     93        g_fbBs3SubSubTestSkipped  = false;
     94        g_szBs3SubSubTest[0]      = '\0';
     95    }
     96}
     97
    4598
    4699/**
     
    49102BS3_DECL(void) bs3TestSubCleanup(void)
    50103{
     104    bs3TestSubSubCleanup();
    51105    if (g_szBs3SubTest[0] != '\0')
    52106    {
    53107        if (!g_fbBs3SubTestReported)
    54         {
    55             size_t   cch;
    56             uint16_t cErrors = g_cusBs3TestErrors - g_cusBs3SubTestAtErrors;
    57 
    58             /* Tell VMMDev. */
    59             bs3TestSendCmdWithU32(VMMDEV_TESTING_CMD_SUB_DONE, cErrors);
    60 
    61             /* Print result to the console. */
    62             Bs3PrintStr(g_szBs3SubTest);
    63             Bs3PrintChr(':');
    64             cch = Bs3StrLen(g_szBs3SubTest);
    65             do
    66                 Bs3PrintChr(' ');
    67             while (cch++ < 49);
    68 
    69             if (!cErrors)
    70                 Bs3PrintStr(!g_fbBs3SubTestSkipped ? "PASSED\n" : "SKIPPED\n");
    71             else
    72             {
    73                 g_cusBs3SubTestsFailed++;
    74                 Bs3Printf("FAILED (%u errors)\n", cErrors);
    75             }
    76         }
     108            bs3TestSubCleanupWorker(g_szBs3SubTest, g_fbBs3SubTestSkipped, g_cusBs3SubTestAtErrors,
     109                                    VMMDEV_TESTING_CMD_SUB_DONE, NULL);
    77110
    78111        /* Reset the sub-test. */
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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