[Qt-interest] QTest Lib: pass a cmd argument to a test function

Sarvesh Saran Sarvesh.Saran at synopsys.com
Mon Jan 25 12:26:51 CET 2010


Hi,

I'm having multiple issues with QTest:Lib..


*         I would like to pass a cmd argument to a test function readFile() ..however I am unable to figure out how to do this.
The class looks something like this:
class MyTest : public QObject
{
    Q_OBJECT

private slots:
    void initTestCase();
    void cleanupTestCase();
void readFile(QString filename);
void ...
void ...

private:
......
}

This is then called from main.cpp as:
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MyTest  test;
    QTest::qExec(&test);
}

But how do I past the cmd argument "filename" to the function readFile ? besides I would like to call only this particular test function with the arg and ignore the other tests.
 Any ideas would be appreciated.


*         How do I click on a menu item (say file->New) using QTest::mouseClick()?


Thanks,
Sarvesh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100125/b2232b38/attachment.html 


More information about the Qt-interest-old mailing list