Details
-
Suggestion
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
4.7.4
-
None
-
All
Description
When using QTest::qExec with command line arguments - calling a specific test, listing test functions - it works only with one test suite (see sample below).
To implement better support for multiple test suites there should be an API function like "int QTest::qExec(QList<QObject*> testObjects, int argc = 0, char** argv = 0)". Furtermore there should also be an API function to get a list of all available test functions like "QStringList QTest::testFunctions(QList<QObject*> testObjects)" .
Sample code, -functions argument will not list "test2" as a test function so there is no possibility to run it individually:
// test suite 1
class Test1 : public QObject
{
Q_OBJECT
private slots:
void test1()
;
};
// test suite 2
class Test2 : public QObject
{
Q_OBJECT
private slots:
void test2()
;
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Test1 t1;
QTest::qExec(&t1, argc, argv);
Test2 t2;
QTest::qExec(&t2, argc, argv);
return 0;
}
Attachments
Issue Links
- relates to
-
QTCREATORBUG-30139 unable to create new test case file for a qt test project
- Closed