[Interest] Unit test with multiple data

Tony Rietwyk tony at rightsoft.com.au
Tue Jan 28 04:15:22 CET 2014


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.au at qt-project.org [mailto:interest-bounces+tony=rightsoft.com.au at 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140128/ed12f9c9/attachment.html>


More information about the Interest mailing list