logsui/logscntfinder/tsrc/ut_logscntfinder/src/main.cpp
changeset 0 4a5361db8937
child 2 7119b73b84d6
equal deleted inserted replaced
-1:000000000000 0:4a5361db8937
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <QtTest/QtTest>
       
    20 
       
    21 #include "ut_logscntfinder.h"
       
    22 #include "ut_logspredictivetranslator.h"
       
    23 #include "ut_logscntentry.h"
       
    24 
       
    25 #include "testresultxmlparser.h"
       
    26 
       
    27 
       
    28 int main(int argc, char *argv[]) 
       
    29 {
       
    30     bool promptOnExit(true);
       
    31     bool useQApplication(true);
       
    32     for (int i=0; i<argc; i++) {
       
    33         if (QString(argv[i]) == "-noprompt")
       
    34             promptOnExit = false;
       
    35         else if (QString(argv[i]) == "-noqapp")
       
    36             useQApplication = false;
       
    37     }
       
    38     printf("Running tests...\n");
       
    39     
       
    40     QApplication* app = 0;
       
    41     if ( useQApplication ) 
       
    42         app = new QApplication(argc, argv);
       
    43     
       
    44     TestResultXmlParser parser;
       
    45     
       
    46     UT_LogsCntFinder ut_logsCntFinder;
       
    47     QString resultFileName = "c:/ut_logs_logsCntFinder.xml";
       
    48     QStringList args_logsCntFinder( "ut_logsCntFinder");
       
    49     args_logsCntFinder << "-xml" << "-o" << resultFileName;
       
    50     QTest::qExec(&ut_logsCntFinder, args_logsCntFinder);
       
    51     parser.parseAndPrintResults(resultFileName,true); 
       
    52     
       
    53     UT_LogsPredictiveTranslator ut_logsPredictiveTranslator;
       
    54     resultFileName = "c:/ut_logs_logsPredictiveTranslator.xml";
       
    55     QStringList args_logsCntFinder1( "ut_LogsPredictiveTranslator" );
       
    56     args_logsCntFinder1 << "-xml" << "-o" << resultFileName;
       
    57     QTest::qExec(&ut_logsPredictiveTranslator, args_logsCntFinder1);
       
    58     parser.parseAndPrintResults(resultFileName,true); 
       
    59 
       
    60     UT_LogsCntEntry ut_logscntentry;
       
    61     resultFileName = "c:/ut_logs_logscntentry.xml";
       
    62     QStringList args_logsCntFinder2( "ut_logscntentry" );
       
    63     args_logsCntFinder2 << "-xml" << "-o" << resultFileName;
       
    64     QTest::qExec(&ut_logscntentry, args_logsCntFinder2);
       
    65     parser.parseAndPrintResults(resultFileName,true); 
       
    66     
       
    67     if (promptOnExit) {
       
    68         printf("Press any key...\n");
       
    69         getchar(); 
       
    70     }
       
    71     delete app;
       
    72     return 0;   
       
    73 }
       
    74 
       
    75 
       
    76 
       
    77