Re: testing with QTestLib
Looks like one has to write main() on his own (instead of using QTEST_MAIN) to be able to use multiple test classes:
Code:
#include <QtTest>
class TestClassOne
: public QObject{
Q_OBJECT
private slots:
void testCase();
};
class TestClassTwo
: public QObject{
Q_OBJECT
private slots:
void testCase();
};
void TestClassOne::testCase()
{
qDebug() << "TestClassOne::testCase()";
}
void TestClassTwo::testCase()
{
qDebug() << "TestClassTwo::testCase()";
}
int main(int argc, char *argv[])
{
TestClassOne tc1;
TestClassTwo tc2;
return QTest::qExec(&tc1, argc, argv) ||
QTest::qExec(&tc2, argc, argv);
}
#include "main.moc"
Re: testing with QTestLib
Quote:
Originally Posted by
jpn
Looks like one has to write main() on his own (instead of using QTEST_MAIN) to be able to use multiple test classes:
That makes sense... Thanks!
Hua-Ying