logsui/logscntfinder/tsrc/st_logscntfinder/src/main.cpp
changeset 15 76d2cf7a585e
parent 6 41c0a814d878
--- a/logsui/logscntfinder/tsrc/st_logscntfinder/src/main.cpp	Fri Aug 06 14:57:47 2010 +0300
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/main.cpp	Mon Aug 23 18:14:51 2010 +0300
@@ -33,17 +33,37 @@
     QTest::qExec(&tc##_instance, tc##_args);\
     parser.parseAndPrintResults(resultFileName,true)
     
+#define STEST_CLASS_ARG( tc, arg )\
+    tc tc##_instance( arg );\
+    QStringList tc##_args( #tc );\
+    resultFileName = QString("c:/data/others/") + QString( #tc ) + QString(".xml");\
+    tc##_args << "-xml" << "-o" << resultFileName;\
+    QTest::qExec(&tc##_instance, tc##_args);\
+    parser.parseAndPrintResults(resultFileName,true)
 
 
 int main(int argc, char *argv[]) 
 {
     bool promptOnExit(false);
     bool useQApplication(true);
+    bool createContacts(true);
+    bool itut(true);
+    bool qwerty(true);
+    bool thai(true);
+    
     for (int i=0; i<argc; i++) {
         if (QString(argv[i]) == "-prompt")
             promptOnExit = true;
         else if (QString(argv[i]) == "-noqapp")
             useQApplication = false;
+        else if (QString(argv[i]) == "-nocnts")
+            createContacts = false;
+        else if (QString(argv[i]) == "-noitut")
+            itut = false;
+        else if (QString(argv[i]) == "-noqwerty")
+            qwerty = false;
+        else if (QString(argv[i]) == "-nothai")
+            thai = false;
     }
     printf("Running tests...\n");
     
@@ -54,9 +74,15 @@
     TestResultXmlParser parser;
     QString resultFileName;
     
-    STEST_CLASS( ST_LogsCntFinder );
-    STEST_CLASS( ST_LogsCntFinderThai );
-    STEST_CLASS( ST_LogsCntFinderQwerty );
+    if ( thai ) {
+        STEST_CLASS( ST_LogsCntFinderThai );
+    }
+    if ( qwerty ) {
+       STEST_CLASS( ST_LogsCntFinderQwerty );
+    }
+    if ( itut ) {
+        STEST_CLASS_ARG( ST_LogsCntFinder, createContacts );
+    }
     
     if (promptOnExit) {
         printf("Press any key...\n");