Hi Soroush, 

 

I hit the same problem, and used this: 

 

// Can't use QTEST_MAIN, since we have our own parameters as well. 

// QTEST_MAIN( TTestPitchXml )

 

int main(int argc, char *argv[])

{

#ifdef QT_GUI_LIB

    QApplication app(argc, argv);

    QTEST_DISABLE_KEYPAD_NAVIGATION

#else

    QCoreApplication app(argc, argv);

#endif

    TTestPitchXml tc;

    QStringList args( app.arguments() );

    tc.checkArgs( args );

    return QTest::qExec(&tc, args);

}

 

Hope that helps, 

 

Tony

 

 

From: interest-bounces+tony=rightsoft.com...@qt-project.org 
[mailto:interest-bounces+tony=rightsoft.com...@qt-project.org] On Behalf Of 
Soroush Rabiei
Sent: Sunday, 26 January 2014 6:22 AM
To: interest
Subject: [Interest] Unit test with multiple data

 

Hi

 

I'm writing a test unit using Qt's QtTest library. My test case requires three 
strings (database host, username and password) that they should be passed in 
command line.


Documentation says data is passed to test unit in the following syntax:

    testname [options] [testfunctions[:testdata]]... 

 

How can I pass more that one `testdata' to a test function? I've tried 
something like:

 

    testname testfunctions:data1:data2:data3

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to