Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.0
Description
A Quick Test project supports to run multiple TestCase declared in different QML file begin with tst_ prefix. Unfortunately, this feature was broken in Qt 5.12.0. It could only execute the first TestCase object. The rest are ignored. I have attached an example program to show the problem.
The files in the project
main.cpp qtbug.pro tst_Sample.qml tst_Sample2.qml
Step to reproduce:
qmake qtbug.pro make ./qtbug
Expected output (with Qt 5.11 or below):
PASS : QuickTests::Sample::initTestCase() PASS : QuickTests::Sample::test_pass1() PASS : QuickTests::Sample::test_pass2() PASS : QuickTests::Sample::cleanupTestCase() PASS : QuickTests::Sample2::initTestCase() PASS : QuickTests::Sample2::test_pass() PASS : QuickTests::Sample2::cleanupTestCase() Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 128ms
The Actual Output (with Qt 5.12):
PASS : ::Sample::initTestCase() PASS : ::Sample::test_pass1() PASS : ::Sample::test_pass2() PASS : ::Sample::cleanupTestCase() Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 237ms
A hotfix is to remove the `CONFIG+=qmltestcase` from the .pro file, but the Qt Creator will not be able to scan/execute tests on this project.