logsui/logscntfinder/tsrc/st_logscntfinder/src/main.cpp
changeset 6 41c0a814d878
child 15 76d2cf7a585e
equal deleted inserted replaced
4:e52d42f9500c 6:41c0a814d878
       
     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 "st_logscntfinder.h"
       
    22 #include "st_logscntfinderqwerty.h"
       
    23 #include "st_logscntfinderthai.h"
       
    24 
       
    25 #include "testresultxmlparser.h"
       
    26 
       
    27 
       
    28 #define STEST_CLASS( tc )\
       
    29     tc tc##_instance;\
       
    30     QStringList tc##_args( #tc );\
       
    31     resultFileName = QString("c:/data/others/") + QString( #tc ) + QString(".xml");\
       
    32     tc##_args << "-xml" << "-o" << resultFileName;\
       
    33     QTest::qExec(&tc##_instance, tc##_args);\
       
    34     parser.parseAndPrintResults(resultFileName,true)
       
    35     
       
    36 
       
    37 
       
    38 int main(int argc, char *argv[]) 
       
    39 {
       
    40     bool promptOnExit(false);
       
    41     bool useQApplication(true);
       
    42     for (int i=0; i<argc; i++) {
       
    43         if (QString(argv[i]) == "-prompt")
       
    44             promptOnExit = true;
       
    45         else if (QString(argv[i]) == "-noqapp")
       
    46             useQApplication = false;
       
    47     }
       
    48     printf("Running tests...\n");
       
    49     
       
    50     QApplication* app = 0;
       
    51     if ( useQApplication ) 
       
    52         app = new QApplication(argc, argv);
       
    53     
       
    54     TestResultXmlParser parser;
       
    55     QString resultFileName;
       
    56     
       
    57     STEST_CLASS( ST_LogsCntFinder );
       
    58     STEST_CLASS( ST_LogsCntFinderThai );
       
    59     STEST_CLASS( ST_LogsCntFinderQwerty );
       
    60     
       
    61     if (promptOnExit) {
       
    62         printf("Press any key...\n");
       
    63         getchar(); 
       
    64     }
       
    65     delete app;
       
    66     return 0;   
       
    67 }
       
    68 
       
    69 
       
    70 
       
    71