18 |
18 |
19 #include <QtTest/QtTest> |
19 #include <QtTest/QtTest> |
20 |
20 |
21 #include "ut_logscntfinder.h" |
21 #include "ut_logscntfinder.h" |
22 #include "ut_logspredictivetranslator.h" |
22 #include "ut_logspredictivetranslator.h" |
|
23 #include "ut_logspredictive12keytranslator.h" |
|
24 #include "ut_logspredictivelatin12keytranslator.h" |
|
25 #include "ut_logspredictivethai12keytranslator.h" |
23 #include "ut_logscntentry.h" |
26 #include "ut_logscntentry.h" |
24 |
27 |
25 #include "testresultxmlparser.h" |
28 #include "testresultxmlparser.h" |
|
29 |
|
30 |
|
31 #define UTEST_CLASS( tc )\ |
|
32 tc tc##_instance;\ |
|
33 QStringList tc##_args( #tc );\ |
|
34 resultFileName = QString("c:/") + QString( #tc ) + QString(".xml");\ |
|
35 tc##_args << "-xml" << "-o" << resultFileName;\ |
|
36 QTest::qExec(&tc##_instance, tc##_args);\ |
|
37 parser.parseAndPrintResults(resultFileName,true) |
|
38 |
26 |
39 |
27 |
40 |
28 int main(int argc, char *argv[]) |
41 int main(int argc, char *argv[]) |
29 { |
42 { |
30 bool promptOnExit(true); |
43 bool promptOnExit(true); |
40 QApplication* app = 0; |
53 QApplication* app = 0; |
41 if ( useQApplication ) |
54 if ( useQApplication ) |
42 app = new QApplication(argc, argv); |
55 app = new QApplication(argc, argv); |
43 |
56 |
44 TestResultXmlParser parser; |
57 TestResultXmlParser parser; |
|
58 QString resultFileName; |
45 |
59 |
46 UT_LogsCntFinder ut_logsCntFinder; |
60 UTEST_CLASS( UT_LogsPredictiveTranslator ); |
47 QString resultFileName = "c:/ut_logs_logsCntFinder.xml"; |
61 UTEST_CLASS( UT_LogsPredictive12KeyTranslator ); |
48 QStringList args_logsCntFinder( "ut_logsCntFinder"); |
62 UTEST_CLASS( UT_LogsPredictiveLatin12KeyTranslator ); |
49 args_logsCntFinder << "-xml" << "-o" << resultFileName; |
63 UTEST_CLASS( UT_LogsPredictiveThai12KeyTranslator ); |
50 QTest::qExec(&ut_logsCntFinder, args_logsCntFinder); |
64 UTEST_CLASS( UT_LogsCntEntry ); |
51 parser.parseAndPrintResults(resultFileName,true); |
65 UTEST_CLASS( UT_LogsCntFinder ); |
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 |
66 |
67 if (promptOnExit) { |
67 if (promptOnExit) { |
68 printf("Press any key...\n"); |
68 printf("Press any key...\n"); |
69 getchar(); |
69 getchar(); |
70 } |
70 } |