You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a Qt Unit testing project to add tests to. It has it's own pro file, to use it you can navigate to the test folder inside our project folder, use the .pro file to import the project and run tests from there. From there to make a new test copy this code into your .cpp file, and no header is necessary.
#include <QtTest/QtTest>
class TestClass: public QObject
{
Q_OBJECT
private slots:
void findLetters();
};
void TestClass::findLetters(){
QString yo = "Yo";
QVERIFY(yo.toUpper() == "YO");
}
QTEST_MAIN(TestClass)
#include "testclass.moc"
Notice that TestClass is the name of the .cpp file, and you should replace it with the name of your file. Be careful with the last include to make it all lowercase.
Use QtTest framework.
http://doc.qt.io/qt-5/qttest-index.html
http://doc.qt.io/qt-5/qtest-overview.html
The text was updated successfully, but these errors were encountered: