Ejemplo n.º 1
0
Archivo: test.c Proyecto: 0xc0170/cox
//*****************************************************************************
//
//! \brief Test execution thread function.
//!
//! \param None
//!
//! \details Test execution thread function.
//!
//! \return The test result xtrue or xfalse.
//
//*****************************************************************************
xtBoolean 
TestMain(void) 
{
    int i, j;

    TestIOInit();

    PrintLine("");
    PrintLine("*** CooCox CoIDE components test suites");
    PrintLine("***");
#ifdef TEST_COMPONENTS_NAME
    Print("*** Components: ");
    PrintLine(TEST_COMPONENTS_NAME);
#endif
#ifdef TEST_COMPONENTS_VERSION
    Print("*** Version:       ");
    PrintLine(TEST_COMPONENTS_VERSION);
#endif
#ifdef TEST_BOARD_NAME
    Print("*** Test Board:   ");
    PrintLine(TEST_BOARD_NAME);
#endif
    PrintLine("");

    g_bGlobalFail = xfalse;
    i = 0;
    while (g_psPatterns[i]) 
    {
        j = 0;
        while (g_psPatterns[i][j]) 
        {
            PrintNewLine();
            Print("--- Test Case ");
            PrintN(i + 1);
            Print(".");
            PrintN(j + 1);
            Print(" (");
            Print((char *)g_psPatterns[i][j]->GetTest());
            PrintLine(")");

            ExecuteTest(g_psPatterns[i][j]);
            if (g_bLocalFail == xtrue)
            {
                Print("--- Result: FAILURE ");
                PrintLine("");
                //
                //printf error information
                //
                Print(g_pcErrorInfoBuffer);
                PrintLine("");
                if (g_pcTokensBuffer < g_pcTok)
                {
                    Print(" The tokens in buffer is: ");
                    PrintTokens();
                    PrintLine("");
                }
            }
            else
            {
                PrintLine("--- Result: SUCCESS ");
            }
            j++;
        }
        i++;
    }

    PrintNewLine();
    PrintLine("");
    Print("Final result: ");

    if (g_bGlobalFail == xtrue)
    PrintLine("FAILURE");
    else
    PrintLine("SUCCESS");

    return g_bGlobalFail;
}
Ejemplo n.º 2
0
int main()
{
PrintN(10000000000000);
return 0;
}