31 resultFileName = QString("c:/data/others/") + QString( #tc ) + QString(".xml");\ |
31 resultFileName = QString("c:/data/others/") + QString( #tc ) + QString(".xml");\ |
32 tc##_args << "-xml" << "-o" << resultFileName;\ |
32 tc##_args << "-xml" << "-o" << resultFileName;\ |
33 QTest::qExec(&tc##_instance, tc##_args);\ |
33 QTest::qExec(&tc##_instance, tc##_args);\ |
34 parser.parseAndPrintResults(resultFileName,true) |
34 parser.parseAndPrintResults(resultFileName,true) |
35 |
35 |
|
36 #define STEST_CLASS_ARG( tc, arg )\ |
|
37 tc tc##_instance( arg );\ |
|
38 QStringList tc##_args( #tc );\ |
|
39 resultFileName = QString("c:/data/others/") + QString( #tc ) + QString(".xml");\ |
|
40 tc##_args << "-xml" << "-o" << resultFileName;\ |
|
41 QTest::qExec(&tc##_instance, tc##_args);\ |
|
42 parser.parseAndPrintResults(resultFileName,true) |
36 |
43 |
37 |
44 |
38 int main(int argc, char *argv[]) |
45 int main(int argc, char *argv[]) |
39 { |
46 { |
40 bool promptOnExit(false); |
47 bool promptOnExit(false); |
41 bool useQApplication(true); |
48 bool useQApplication(true); |
|
49 bool createContacts(true); |
|
50 bool itut(true); |
|
51 bool qwerty(true); |
|
52 bool thai(true); |
|
53 |
42 for (int i=0; i<argc; i++) { |
54 for (int i=0; i<argc; i++) { |
43 if (QString(argv[i]) == "-prompt") |
55 if (QString(argv[i]) == "-prompt") |
44 promptOnExit = true; |
56 promptOnExit = true; |
45 else if (QString(argv[i]) == "-noqapp") |
57 else if (QString(argv[i]) == "-noqapp") |
46 useQApplication = false; |
58 useQApplication = false; |
|
59 else if (QString(argv[i]) == "-nocnts") |
|
60 createContacts = false; |
|
61 else if (QString(argv[i]) == "-noitut") |
|
62 itut = false; |
|
63 else if (QString(argv[i]) == "-noqwerty") |
|
64 qwerty = false; |
|
65 else if (QString(argv[i]) == "-nothai") |
|
66 thai = false; |
47 } |
67 } |
48 printf("Running tests...\n"); |
68 printf("Running tests...\n"); |
49 |
69 |
50 QApplication* app = 0; |
70 QApplication* app = 0; |
51 if ( useQApplication ) |
71 if ( useQApplication ) |
52 app = new QApplication(argc, argv); |
72 app = new QApplication(argc, argv); |
53 |
73 |
54 TestResultXmlParser parser; |
74 TestResultXmlParser parser; |
55 QString resultFileName; |
75 QString resultFileName; |
56 |
76 |
57 STEST_CLASS( ST_LogsCntFinder ); |
77 if ( thai ) { |
58 STEST_CLASS( ST_LogsCntFinderThai ); |
78 STEST_CLASS( ST_LogsCntFinderThai ); |
59 STEST_CLASS( ST_LogsCntFinderQwerty ); |
79 } |
|
80 if ( qwerty ) { |
|
81 STEST_CLASS( ST_LogsCntFinderQwerty ); |
|
82 } |
|
83 if ( itut ) { |
|
84 STEST_CLASS_ARG( ST_LogsCntFinder, createContacts ); |
|
85 } |
60 |
86 |
61 if (promptOnExit) { |
87 if (promptOnExit) { |
62 printf("Press any key...\n"); |
88 printf("Press any key...\n"); |
63 getchar(); |
89 getchar(); |
64 } |
90 } |