File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,3 +128,6 @@ target_link_libraries(test_driver_page PRIVATE
128128)
129129
130130add_test (NAME test_driver_page COMMAND test_driver_page )
131+ set_tests_properties (test_driver_page PROPERTIES
132+ ENVIRONMENT "QT_QPA_PLATFORM=offscreen;QT_QUICK_CONTROLS_STYLE=Basic"
133+ )
Original file line number Diff line number Diff line change 88#include < QStringList>
99#include < QTemporaryDir>
1010#include < QTest>
11+ #include < QtQuickControls2/QQuickStyle>
1112
1213class DetectorMock : public QObject {
1314 Q_OBJECT
@@ -285,10 +286,6 @@ class TestDriverPage : public QObject {
285286 Q_OBJECT
286287
287288private slots:
288- void initTestCase () {
289- qputenv (" QT_QPA_PLATFORM" , QByteArrayLiteral (" offscreen" ));
290- }
291-
292289 void testDriverInstalledLocallyUsesDetectorVersion ();
293290 void testOperationRunningStillTracksBackendBusyAfterManualStateChanges ();
294291
@@ -450,5 +447,14 @@ void TestDriverPage::
450447 QTRY_VERIFY (!page->property (" operationRunning" ).toBool ());
451448}
452449
453- QTEST_MAIN (TestDriverPage)
450+ int main (int argc, char **argv) {
451+ qputenv (" QT_QPA_PLATFORM" , QByteArrayLiteral (" offscreen" ));
452+ qputenv (" QT_QUICK_CONTROLS_STYLE" , QByteArrayLiteral (" Basic" ));
453+
454+ QQuickStyle::setStyle (QStringLiteral (" Basic" ));
455+
456+ QGuiApplication app (argc, argv);
457+ TestDriverPage testCase;
458+ return QTest::qExec (&testCase, argc, argv);
459+ }
454460#include " test_driver_page.moc"
You can’t perform that action at this time.
0 commit comments