locationsystemui/locationsysui/tsrc/inc/testconsole.h
changeset 35 1a92308afc46
equal deleted inserted replaced
33:834e27cad510 35:1a92308afc46
       
     1 #include <QtTest/QtTest>
       
     2  
       
     3 #ifndef S60UNITTEST_H_
       
     4 #define S60UNITTEST_H_
       
     5  
       
     6 #define QTEST_MAIN_S60(TestObject) \
       
     7 int main(int argc, char *argv[]) \
       
     8 { \
       
     9 char *new_argv[3]; \
       
    10 QApplication app(argc, argv); \
       
    11 \
       
    12 QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
       
    13 QByteArray   bytes  = str.toAscii(); \
       
    14 \
       
    15 char arg1[] = "-o"; \
       
    16 \
       
    17 new_argv[0] = argv[0]; \
       
    18 new_argv[1] = arg1; \
       
    19 new_argv[2] = bytes.data(); \
       
    20 \
       
    21 TestObject tc; \
       
    22 return QTest::qExec(&tc, 3, new_argv); \
       
    23 }
       
    24 #endif /* S60UNITTEST_H_ */