aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2021-08-06 12:27:35 +0200
committerMitch Curtis <mitch.curtis@qt.io>2021-09-14 12:13:57 +0200
commit5ae7066e84e45721ce58e9d16e3c4da72aa51692 (patch)
treed0d710678c679477b0413744825b3c9ff0060569
parentb89322772234047849c4d44b592e1a555029bc7e (diff)
Consolidate test helpers into private libraries
Previously each test would include and build sources from the shared folder. Now we make those sources a library, build it once, then have each test link to it instead. We also take the opportunity to move some helpers that qtquickcontrols2 had added into the quicktestutils library where it makes sense, and for the helpers that don't make sense to be there, move them into quickcontrolstestutils. We add the libraries to src/ so that they are internal modules built as part of Qt, rather than tests. That way we can use them in a standalone test outside of qtdeclarative. Task-number: QTBUG-95621 Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e310dadef779b28845b41fb091634cd001cda9de)
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/qml/jsapi/qjsvalue_p.h2
-rw-r--r--src/qml/qml/ftw/qhashedstring_p.h4
-rw-r--r--src/quick/items/qquickitemview_p_p.h4
-rw-r--r--src/quick/qtquickglobal_p.h30
-rw-r--r--src/quick/util/qquickanimation_p_p.h2
-rw-r--r--src/quickcontrolstestutils/CMakeLists.txt23
-rw-r--r--src/quickcontrolstestutils/controlstestutils.cpp182
-rw-r--r--src/quickcontrolstestutils/controlstestutils_p.h85
-rw-r--r--src/quickcontrolstestutils/dialogstestutils_p.h (renamed from tests/auto/quickcontrols2/shared/dialogtestutil.h)25
-rw-r--r--src/quickcontrolstestutils/qtest_quickcontrols_p.h (renamed from tests/auto/quickcontrols2/shared/qtest_quickcontrols.h)17
-rw-r--r--src/quicktestutils/CMakeLists.txt39
-rw-r--r--src/quicktestutils/qml/platforminputcontext_p.h (renamed from tests/auto/shared/platforminputcontext.h)22
-rw-r--r--src/quicktestutils/qml/platformquirks_p.h (renamed from tests/auto/shared/platformquirks.h)21
-rw-r--r--src/quicktestutils/qml/qmlutils.cpp (renamed from tests/auto/shared/util.cpp)36
-rw-r--r--src/quicktestutils/qml/qmlutils_p.h (renamed from tests/auto/shared/util.h)30
-rw-r--r--src/quicktestutils/qml/qqmljsastdumper.cpp (renamed from tests/auto/shared/qqmljsastdumper.cpp)7
-rw-r--r--src/quicktestutils/qml/qqmljsastdumper_p.h (renamed from tests/auto/shared/qqmljsastdumper.h)8
-rw-r--r--src/quicktestutils/qml/testhttpserver.cpp (renamed from tests/auto/shared/testhttpserver.cpp)8
-rw-r--r--src/quicktestutils/qml/testhttpserver_p.h (renamed from tests/auto/shared/testhttpserver.h)23
-rw-r--r--src/quicktestutils/quick/geometrytestutils.cpp (renamed from tests/auto/quick/shared/geometrytestutil.cpp)8
-rw-r--r--src/quicktestutils/quick/geometrytestutils_p.h (renamed from tests/auto/quick/shared/geometrytestutil.h)25
-rw-r--r--src/quicktestutils/quick/viewtestutils.cpp (renamed from tests/auto/quick/shared/viewtestutil.cpp)102
-rw-r--r--src/quicktestutils/quick/viewtestutils_p.h (renamed from tests/auto/quick/shared/viewtestutil.h)33
-rw-r--r--src/quicktestutils/quick/visualtestutils.cpp225
-rw-r--r--src/quicktestutils/quick/visualtestutils_p.h (renamed from tests/auto/quick/shared/visualtestutil.h)105
-rw-r--r--sync.profile2
-rw-r--r--tests/auto/cmake/test_import_static_shapes_plugin_resources/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/test_import_static_shapes_plugin_resources/tst_main.cpp2
-rw-r--r--tests/auto/particles/qquickage/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickage/tst_qquickage.cpp5
-rw-r--r--tests/auto/particles/qquickangleddirection/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickangleddirection/tst_qquickangleddirection.cpp5
-rw-r--r--tests/auto/particles/qquickcumulativedirection/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickcumulativedirection/tst_qquickcumulativedirection.cpp5
-rw-r--r--tests/auto/particles/qquickcustomaffector/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp5
-rw-r--r--tests/auto/particles/qquickellipseextruder/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickellipseextruder/tst_qquickellipseextruder.cpp5
-rw-r--r--tests/auto/particles/qquickfriction/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickfriction/tst_qquickfriction.cpp5
-rw-r--r--tests/auto/particles/qquickgravity/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickgravity/tst_qquickgravity.cpp5
-rw-r--r--tests/auto/particles/qquickgroupgoal/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickgroupgoal/tst_qquickgroupgoal.cpp5
-rw-r--r--tests/auto/particles/qquickimageparticle/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickimageparticle/tst_qquickimageparticle.cpp5
-rw-r--r--tests/auto/particles/qquickitemparticle/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp5
-rw-r--r--tests/auto/particles/qquicklineextruder/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquicklineextruder/tst_qquicklineextruder.cpp5
-rw-r--r--tests/auto/particles/qquickmaskextruder/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickmaskextruder/tst_qquickmaskextruder.cpp5
-rw-r--r--tests/auto/particles/qquickparticlegroup/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickparticlegroup/tst_qquickparticlegroup.cpp5
-rw-r--r--tests/auto/particles/qquickparticlesystem/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp5
-rw-r--r--tests/auto/particles/qquickpointattractor/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickpointattractor/tst_qquickpointattractor.cpp5
-rw-r--r--tests/auto/particles/qquickpointdirection/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickpointdirection/tst_qquickpointdirection.cpp5
-rw-r--r--tests/auto/particles/qquickrectangleextruder/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickrectangleextruder/tst_qquickrectangleextruder.cpp5
-rw-r--r--tests/auto/particles/qquickspritegoal/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickspritegoal/tst_qquickspritegoal.cpp5
-rw-r--r--tests/auto/particles/qquicktargetdirection/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquicktargetdirection/tst_qquicktargetdirection.cpp5
-rw-r--r--tests/auto/particles/qquicktrailemitter/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquicktrailemitter/tst_qquicktrailemitter.cpp5
-rw-r--r--tests/auto/particles/qquickturbulence/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickturbulence/tst_qquickturbulence.cpp5
-rw-r--r--tests/auto/particles/qquickwander/CMakeLists.txt4
-rw-r--r--tests/auto/particles/qquickwander/tst_qquickwander.cpp5
-rw-r--r--tests/auto/qml/bindingdependencyapi/CMakeLists.txt4
-rw-r--r--tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp1
-rw-r--r--tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt5
-rw-r--r--tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp10
-rw-r--r--tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp10
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt5
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp10
-rw-r--r--tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp10
-rw-r--r--tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp4
-rw-r--r--tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp1
-rw-r--r--tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp13
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp10
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp8
-rw-r--r--tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp10
-rw-r--r--tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp8
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt3
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp14
-rw-r--r--tests/auto/qml/debugger/shared/debugutil.cpp5
-rw-r--r--tests/auto/qml/debugger/shared/debugutil_p.h5
-rw-r--r--tests/auto/qml/qjsonbinding/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp4
-rw-r--r--tests/auto/qml/qmlcachegen/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp10
-rw-r--r--tests/auto/qml/qmlcompiler_manual/CMakeLists.txt5
-rw-r--r--tests/auto/qml/qmlcompiler_manual/tst_qmlcompiler_manual.cpp10
-rw-r--r--tests/auto/qml/qmlformat/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qmlformat/tst_qmlformat.cpp11
-rw-r--r--tests/auto/qml/qmlimportscanner/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp11
-rw-r--r--tests/auto/qml/qmllint/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp11
-rw-r--r--tests/auto/qml/qmlplugindump/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp4
-rw-r--r--tests/auto/qml/qqmlanybinding/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlanybinding/tst_qqmlanybinding.cpp10
-rw-r--r--tests/auto/qml/qqmlapplicationengine/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp4
-rw-r--r--tests/auto/qml/qqmlbinding/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp3
-rw-r--r--tests/auto/qml/qqmlcomponent/CMakeLists.txt5
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp6
-rw-r--r--tests/auto/qml/qqmlconnections/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp3
-rw-r--r--tests/auto/qml/qqmlconsole/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp4
-rw-r--r--tests/auto/qml/qqmlcontext/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp4
-rw-r--r--tests/auto/qml/qqmldelegatemodel/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp4
-rw-r--r--tests/auto/qml/qqmldirparser/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp4
-rw-r--r--tests/auto/qml/qqmlecmascript/CMakeLists.txt5
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp12
-rw-r--r--tests/auto/qml/qqmlengine/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp4
-rw-r--r--tests/auto/qml/qqmlenginecleanup/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp4
-rw-r--r--tests/auto/qml/qqmlerror/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlerror/tst_qqmlerror.cpp11
-rw-r--r--tests/auto/qml/qqmlexpression/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp4
-rw-r--r--tests/auto/qml/qqmlfileselector/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp4
-rw-r--r--tests/auto/qml/qqmlimport/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlimport/tst_qqmlimport.cpp14
-rw-r--r--tests/auto/qml/qqmlincubator/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp4
-rw-r--r--tests/auto/qml/qqmlinfo/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp4
-rw-r--r--tests/auto/qml/qqmlinstantiator/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp10
-rw-r--r--tests/auto/qml/qqmlitemmodels/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/CMakeLists.txt5
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp13
-rw-r--r--tests/auto/qml/qqmllistmodel/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp3
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp3
-rw-r--r--tests/auto/qml/qqmllistreference/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp4
-rw-r--r--tests/auto/qml/qqmllocale/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmllocale/tst_qqmllocale.cpp4
-rw-r--r--tests/auto/qml/qqmlmetaobject/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp11
-rw-r--r--tests/auto/qml/qqmlmetatype/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp4
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/CMakeLists.txt5
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp10
-rw-r--r--tests/auto/qml/qqmlnotifier/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp4
-rw-r--r--tests/auto/qml/qqmlparser/CMakeLists.txt5
-rw-r--r--tests/auto/qml/qqmlparser/tst_qqmlparser.cpp5
-rw-r--r--tests/auto/qml/qqmlpromise/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp4
-rw-r--r--tests/auto/qml/qqmlproperty/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp4
-rw-r--r--tests/auto/qml/qqmlpropertycache/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp4
-rw-r--r--tests/auto/qml/qqmlpropertymap/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp4
-rw-r--r--tests/auto/qml/qqmlqt/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlqt/tst_qqmlqt.cpp4
-rw-r--r--tests/auto/qml/qqmlsettings/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp10
-rw-r--r--tests/auto/qml/qqmlsqldatabase/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp3
-rw-r--r--tests/auto/qml/qqmltablemodel/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmltablemodel/tst_qqmltablemodel.cpp4
-rw-r--r--tests/auto/qml/qqmltranslation/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp4
-rw-r--r--tests/auto/qml/qqmltypeloader/CMakeLists.txt5
-rw-r--r--tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp12
-rw-r--r--tests/auto/qml/qqmlvaluetypeproviders/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp4
-rw-r--r--tests/auto/qml/qqmlvaluetypes/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp4
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/CMakeLists.txt5
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp6
-rw-r--r--tests/auto/qml/qqmlxmllistmodel/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp4
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp4
-rw-r--r--tests/auto/qml/qquickworkerscript/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp4
-rw-r--r--tests/auto/qml/qtqmlmodules/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp4
-rw-r--r--tests/auto/qml/qv4assembler/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qv4assembler/tst_qv4assembler.cpp11
-rw-r--r--tests/auto/qml/qv4mm/CMakeLists.txt4
-rw-r--r--tests/auto/qml/qv4mm/tst_qv4mm.cpp10
-rw-r--r--tests/auto/quick/drawingmodes/CMakeLists.txt4
-rw-r--r--tests/auto/quick/drawingmodes/tst_drawingmodes.cpp7
-rw-r--r--tests/auto/quick/pointerhandlers/flickableinterop/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp11
-rw-r--r--tests/auto/quick/pointerhandlers/mousearea_interop/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp9
-rw-r--r--tests/auto/quick/pointerhandlers/multipointtoucharea_interop/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp9
-rw-r--r--tests/auto/quick/pointerhandlers/qquickdraghandler/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp11
-rw-r--r--tests/auto/quick/pointerhandlers/qquickhoverhandler/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp9
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpinchhandler/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp33
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpointerhandler/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp11
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpointhandler/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp12
-rw-r--r--tests/auto/quick/pointerhandlers/qquicktaphandler/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp9
-rw-r--r--tests/auto/quick/pointerhandlers/qquickwheelhandler/CMakeLists.txt7
-rw-r--r--tests/auto/quick/pointerhandlers/qquickwheelhandler/tst_qquickwheelhandler.cpp6
-rw-r--r--tests/auto/quick/qquickaccessible/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp7
-rw-r--r--tests/auto/quick/qquickanchors/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickanchors/tst_qquickanchors.cpp8
-rw-r--r--tests/auto/quick/qquickanimatedimage/CMakeLists.txt5
-rw-r--r--tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp6
-rw-r--r--tests/auto/quick/qquickanimatedsprite/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp4
-rw-r--r--tests/auto/quick/qquickanimations/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickanimations/tst_qquickanimations.cpp4
-rw-r--r--tests/auto/quick/qquickanimators/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickanimators/tst_qquickanimators.cpp14
-rw-r--r--tests/auto/quick/qquickapplication/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickapplication/tst_qquickapplication.cpp3
-rw-r--r--tests/auto/quick/qquickbehaviors/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp4
-rw-r--r--tests/auto/quick/qquickborderimage/CMakeLists.txt8
-rw-r--r--tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp9
-rw-r--r--tests/auto/quick/qquickboundaryrule/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickboundaryrule/tst_qquickboundaryrule.cpp6
-rw-r--r--tests/auto/quick/qquickdeliveryagent/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp9
-rw-r--r--tests/auto/quick/qquickdesignersupport/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp8
-rw-r--r--tests/auto/quick/qquickdroparea/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp13
-rw-r--r--tests/auto/quick/qquickdynamicpropertyanimation/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp4
-rw-r--r--tests/auto/quick/qquickflickable/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp109
-rw-r--r--tests/auto/quick/qquickflipable/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickflipable/tst_qquickflipable.cpp8
-rw-r--r--tests/auto/quick/qquickfocusscope/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp8
-rw-r--r--tests/auto/quick/qquickfontloader/CMakeLists.txt5
-rw-r--r--tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp5
-rw-r--r--tests/auto/quick/qquickfontloader_static/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp4
-rw-r--r--tests/auto/quick/qquickframebufferobject/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp9
-rw-r--r--tests/auto/quick/qquickgraphicsinfo/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp10
-rw-r--r--tests/auto/quick/qquickgridview/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp20
-rw-r--r--tests/auto/quick/qquickimage/CMakeLists.txt8
-rw-r--r--tests/auto/quick/qquickimage/tst_qquickimage.cpp9
-rw-r--r--tests/auto/quick/qquickitem/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp10
-rw-r--r--tests/auto/quick/qquickitem2/CMakeLists.txt5
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp11
-rw-r--r--tests/auto/quick/qquickitemlayer/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp4
-rw-r--r--tests/auto/quick/qquicklistview/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp34
-rw-r--r--tests/auto/quick/qquicklistview2/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp11
-rw-r--r--tests/auto/quick/qquickloader/CMakeLists.txt8
-rw-r--r--tests/auto/quick/qquickloader/tst_qquickloader.cpp7
-rw-r--r--tests/auto/quick/qquickmousearea/CMakeLists.txt8
-rw-r--r--tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp5
-rw-r--r--tests/auto/quick/qquickmultipointtoucharea/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp6
-rw-r--r--tests/auto/quick/qquickpalette/CMakeLists.txt3
-rw-r--r--tests/auto/quick/qquickpalette/tst_qquickpalette.cpp10
-rw-r--r--tests/auto/quick/qquickpath/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickpath/tst_qquickpath.cpp4
-rw-r--r--tests/auto/quick/qquickpathview/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp33
-rw-r--r--tests/auto/quick/qquickpincharea/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickpincharea/tst_qquickpincharea.cpp6
-rw-r--r--tests/auto/quick/qquickpixmapcache/CMakeLists.txt5
-rw-r--r--tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp6
-rw-r--r--tests/auto/quick/qquickpositioners/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp17
-rw-r--r--tests/auto/quick/qquickrectangle/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp3
-rw-r--r--tests/auto/quick/qquickrendercontrol/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickrendercontrol/tst_qquickrendercontrol.cpp10
-rw-r--r--tests/auto/quick/qquickrepeater/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp11
-rw-r--r--tests/auto/quick/qquickscreen/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickscreen/tst_qquickscreen.cpp10
-rw-r--r--tests/auto/quick/qquickshadereffect/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp3
-rw-r--r--tests/auto/quick/qquickshape/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickshape/tst_qquickshape.cpp29
-rw-r--r--tests/auto/quick/qquickshortcut/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp10
-rw-r--r--tests/auto/quick/qquicksmoothedanimation/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp3
-rw-r--r--tests/auto/quick/qquickspringanimation/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickspringanimation/tst_qquickspringanimation.cpp3
-rw-r--r--tests/auto/quick/qquickspritesequence/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp4
-rw-r--r--tests/auto/quick/qquickstates/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquickstates/tst_qquickstates.cpp4
-rw-r--r--tests/auto/quick/qquicktableview/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquicktableview/tst_qquicktableview.cpp11
-rw-r--r--tests/auto/quick/qquicktext/CMakeLists.txt5
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp5
-rw-r--r--tests/auto/quick/qquicktextdocument/CMakeLists.txt4
-rw-r--r--tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp10
-rw-r--r--tests/auto/quick/qquicktextedit/CMakeLists.txt8
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp20
-rw-r--r--tests/auto/quick/qquicktextinput/CMakeLists.txt5
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp9
-rw-r--r--tests/auto/quick/qquickview/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickview/tst_qquickview.cpp5
-rw-r--r--tests/auto/quick/qquickview_extra/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp4
-rw-r--r--tests/auto/quick/qquickvisualdatamodel/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp11
-rw-r--r--tests/auto/quick/qquickwindow/CMakeLists.txt7
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp15
-rw-r--r--tests/auto/quick/rendernode/CMakeLists.txt4
-rw-r--r--tests/auto/quick/rendernode/tst_rendernode.cpp3
-rw-r--r--tests/auto/quick/scenegraph/CMakeLists.txt7
-rw-r--r--tests/auto/quick/scenegraph/tst_scenegraph.cpp14
-rw-r--r--tests/auto/quick/shared/visualtestutil.cpp104
-rw-r--r--tests/auto/quick/touchmouse/CMakeLists.txt7
-rw-r--r--tests/auto/quick/touchmouse/tst_touchmouse.cpp7
-rw-r--r--tests/auto/quickcontrols2/accessibility/CMakeLists.txt4
-rw-r--r--tests/auto/quickcontrols2/accessibility/tst_accessibility.cpp10
-rw-r--r--tests/auto/quickcontrols2/cursor/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/cursor/tst_cursor.cpp7
-rw-r--r--tests/auto/quickcontrols2/customization/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/customization/tst_customization.cpp13
-rw-r--r--tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp20
-rw-r--r--tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/tst_qquickfontdialogimpl.cpp20
-rw-r--r--tests/auto/quickcontrols2/focus/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/focus/tst_focus.cpp24
-rw-r--r--tests/auto/quickcontrols2/font/CMakeLists.txt4
-rw-r--r--tests/auto/quickcontrols2/font/tst_font.cpp6
-rw-r--r--tests/auto/quickcontrols2/palette/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/palette/tst_palette.cpp14
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp8
-rw-r--r--tests/auto/quickcontrols2/qquickcontrol/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickcontrol/tst_qquickcontrol.cpp15
-rw-r--r--tests/auto/quickcontrols2/qquickdrawer/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickdrawer/tst_qquickdrawer.cpp55
-rw-r--r--tests/auto/quickcontrols2/qquickheaderview/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickheaderview/tst_qquickheaderview.cpp10
-rw-r--r--tests/auto/quickcontrols2/qquickiconimage/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickiconimage/tst_qquickiconimage.cpp9
-rw-r--r--tests/auto/quickcontrols2/qquickiconlabel/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickiconlabel/tst_qquickiconlabel.cpp8
-rw-r--r--tests/auto/quickcontrols2/qquickmaterialstyleconf/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp17
-rw-r--r--tests/auto/quickcontrols2/qquickmenu/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp72
-rw-r--r--tests/auto/quickcontrols2/qquickmenubar/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickmenubar/tst_qquickmenubar.cpp15
-rw-r--r--tests/auto/quickcontrols2/qquickninepatchimage/CMakeLists.txt9
-rw-r--r--tests/auto/quickcontrols2/qquickninepatchimage/tst_qquickninepatchimage.cpp16
-rw-r--r--tests/auto/quickcontrols2/qquickpopup/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp71
-rw-r--r--tests/auto/quickcontrols2/qquickstyle/CMakeLists.txt9
-rw-r--r--tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp11
-rw-r--r--tests/auto/quickcontrols2/qquickuniversalstyleconf/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp16
-rw-r--r--tests/auto/quickcontrols2/sanity/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/sanity/tst_sanity.cpp8
-rw-r--r--tests/auto/quickcontrols2/shared/util.cpp144
-rw-r--r--tests/auto/quickcontrols2/shared/util.h108
-rw-r--r--tests/auto/quickcontrols2/shared/util.pri14
-rw-r--r--tests/auto/quickcontrols2/shared/visualtestutil.cpp272
-rw-r--r--tests/auto/quickcontrols2/shared/visualtestutil.h252
-rw-r--r--tests/auto/quickcontrols2/styleimports/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/styleimports/tst_styleimports.cpp11
-rw-r--r--tests/auto/quickcontrols2/styleimportscompiletimematerial/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/styleimportscompiletimematerial/tst_styleimportscompiletimematerial.cpp19
-rw-r--r--tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/tst_styleimportscompiletimeqmlonly.cpp17
-rw-r--r--tests/auto/quickcontrols2/translation/CMakeLists.txt5
-rw-r--r--tests/auto/quickcontrols2/translation/tst_translation.cpp7
-rw-r--r--tests/auto/quicktest/polish-qml/CMakeLists.txt4
-rw-r--r--tests/auto/quicktest/polish-qml/tst_polish-qml.cpp2
-rw-r--r--tests/auto/quicktest/polish/CMakeLists.txt4
-rw-r--r--tests/auto/quicktest/polish/tst_polish.cpp3
-rw-r--r--tests/auto/quicktest/quicktestmainwithsetup/CMakeLists.txt4
-rw-r--r--tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp2
-rw-r--r--tests/auto/quicktest/signalspy/CMakeLists.txt4
-rw-r--r--tests/auto/quicktest/signalspy/tst_signalspy.cpp3
-rw-r--r--tests/auto/quickwidgets/qquickwidget/CMakeLists.txt4
-rw-r--r--tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp3
-rw-r--r--tests/benchmarks/quick/events/CMakeLists.txt7
-rw-r--r--tests/benchmarks/quick/events/tst_events.cpp13
-rw-r--r--tests/benchmarks/quickcontrols2/creationtime/CMakeLists.txt5
-rw-r--r--tests/benchmarks/quickcontrols2/creationtime/tst_creationtime.cpp24
-rw-r--r--tests/benchmarks/quickcontrols2/objectcount/CMakeLists.txt5
-rw-r--r--tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp20
432 files changed, 2395 insertions, 2458 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4dc274afa9..ab9b064390 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -31,6 +31,7 @@ if(TARGET Qt::Gui AND TARGET Qt::qsb AND QT_FEATURE_qml_animation)
find_package(Qt6 ${PROJECT_VERSION} CONFIG COMPONENTS Test) # special case
if(QT_FEATURE_testlib AND TARGET Qt::Test) # special case
add_subdirectory(qmltest)
+ add_subdirectory(quicktestutils)
endif()
if(QT_FEATURE_quick_particles)
@@ -46,6 +47,10 @@ if(TARGET Qt::Gui AND TARGET Qt::qsb AND QT_FEATURE_qml_animation)
add_subdirectory(quickcontrols2)
add_subdirectory(quickdialogs2)
add_subdirectory(quicknativestyle)
+
+ if(TARGET Qt::QuickControls2)
+ add_subdirectory(quickcontrolstestutils)
+ endif()
else()
qt_configure_add_summary_section(NAME "Qt Quick")
qt_configure_add_summary_entry(TYPE "message" ARGS "Qt Quick support" MESSAGE "no")
diff --git a/src/qml/jsapi/qjsvalue_p.h b/src/qml/jsapi/qjsvalue_p.h
index cea48fd9e2..69837d6575 100644
--- a/src/qml/jsapi/qjsvalue_p.h
+++ b/src/qml/jsapi/qjsvalue_p.h
@@ -75,7 +75,7 @@ enum PointerMask: quintptr {
IsString = 0x1
};
-class Q_AUTOTEST_EXPORT QJSValuePrivate
+class QJSValuePrivate
{
static const QV4::Value *managedValue(const QV4::Value &v)
{
diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h
index 03955e0563..6bef117646 100644
--- a/src/qml/qml/ftw/qhashedstring_p.h
+++ b/src/qml/qml/ftw/qhashedstring_p.h
@@ -144,7 +144,7 @@ private:
mutable quint32 m_hash = 0;
};
-class Q_AUTOTEST_EXPORT QHashedCStringRef
+class QHashedCStringRef
{
public:
inline QHashedCStringRef();
@@ -157,7 +157,7 @@ public:
inline const char *constData() const;
inline int length() const;
- QString toUtf16() const;
+ Q_AUTOTEST_EXPORT QString toUtf16() const;
inline int utf16length() const;
inline void writeUtf16(QChar *) const;
inline void writeUtf16(quint16 *) const;
diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h
index 0bc2a6b768..b9b129a073 100644
--- a/src/quick/items/qquickitemview_p_p.h
+++ b/src/quick/items/qquickitemview_p_p.h
@@ -76,7 +76,7 @@ public:
};
-class QQuickItemViewChangeSet
+class Q_AUTOTEST_EXPORT QQuickItemViewChangeSet
{
public:
QQuickItemViewChangeSet();
@@ -100,7 +100,7 @@ public:
};
-class Q_AUTOTEST_EXPORT QQuickItemViewPrivate : public QQuickFlickablePrivate, public QQuickItemViewTransitionChangeListener, public QAnimationJobChangeListener
+class Q_QUICK_AUTOTEST_EXPORT QQuickItemViewPrivate : public QQuickFlickablePrivate, public QQuickItemViewTransitionChangeListener, public QAnimationJobChangeListener
{
Q_DECLARE_PUBLIC(QQuickItemView)
public:
diff --git a/src/quick/qtquickglobal_p.h b/src/quick/qtquickglobal_p.h
index 797d9f169a..0ef394e739 100644
--- a/src/quick/qtquickglobal_p.h
+++ b/src/quick/qtquickglobal_p.h
@@ -72,6 +72,36 @@ Q_DECLARE_LOGGING_CATEGORY(lcMouse)
Q_DECLARE_LOGGING_CATEGORY(lcFocus)
Q_DECLARE_LOGGING_CATEGORY(lcDirty)
+/*
+ This is needed for QuickTestUtils. Q_AUTOTEST_EXPORT checks QT_BUILDING_QT
+ (amongst others) to see if it should export symbols. Until QuickTestUtils
+ was introduced, this was enough, as there weren't any intermediate test
+ helper libraries that used a Qt library and were in turn used by tests.
+
+ Taking QQuickItemViewPrivate as an example: previously it was using
+ Q_AUTOTEST_EXPORT. Since QuickTestUtils is a Qt library (albeit a private
+ one), QT_BUILDING_QT was true and so Q_AUTOTEST_EXPORT evaluated to an
+ export. However, QQuickItemViewPrivate was already exported by the Quick
+ library, so we would get errors like this:
+
+ Qt6Quickd.lib(Qt6Quickd.dll) : error LNK2005: "public: static class
+ QQuickItemViewPrivate * __cdecl QQuickItemViewPrivate::get(class QQuickItemView *)"
+ (?get@QQuickItemViewPrivate@@SAPEAV1@PEAVQQuickItemView@@@Z) already defined
+ in Qt6QuickTestUtilsd.lib(viewtestutils.cpp.obj)
+
+ So, to account for the special case of QuickTestUtils, we need to be more
+ specific about which part of Qt we're building; instead of checking if we're
+ building any Qt library at all, check if we're building the Quick library,
+ and only then export.
+*/
+#if defined(QT_BUILD_INTERNAL) && defined(QT_BUILD_QUICK_LIB) && defined(QT_SHARED)
+# define Q_QUICK_AUTOTEST_EXPORT Q_DECL_EXPORT
+#elif defined(QT_BUILD_INTERNAL) && defined(QT_SHARED)
+# define Q_QUICK_AUTOTEST_EXPORT Q_DECL_IMPORT
+#else
+# define Q_QUICK_AUTOTEST_EXPORT
+#endif
+
QT_END_NAMESPACE
#endif // QTQUICKGLOBAL_P_H
diff --git a/src/quick/util/qquickanimation_p_p.h b/src/quick/util/qquickanimation_p_p.h
index b37680e92a..56121221bf 100644
--- a/src/quick/util/qquickanimation_p_p.h
+++ b/src/quick/util/qquickanimation_p_p.h
@@ -125,7 +125,7 @@ public:
};
//animates QQuickBulkValueUpdater (assumes start and end values will be reals or compatible)
-class Q_AUTOTEST_EXPORT QQuickBulkValueAnimator : public QAbstractAnimationJob
+class Q_QUICK_AUTOTEST_EXPORT QQuickBulkValueAnimator : public QAbstractAnimationJob
{
Q_DISABLE_COPY(QQuickBulkValueAnimator)
public:
diff --git a/src/quickcontrolstestutils/CMakeLists.txt b/src/quickcontrolstestutils/CMakeLists.txt
new file mode 100644
index 0000000000..db7baa409f
--- /dev/null
+++ b/src/quickcontrolstestutils/CMakeLists.txt
@@ -0,0 +1,23 @@
+qt_internal_add_module(QuickControlsTestUtilsPrivate
+ CONFIG_MODULE_NAME quickcontrolstestutilsprivate
+ STATIC
+ INTERNAL_MODULE
+ SOURCES
+ controlstestutils.cpp
+ controlstestutils_p.h
+ dialogstestutils_p.h
+ qtest_quickcontrols_p.h
+ DEFINES
+ QT_BUILD_SHARED_QUICK_CONTROLS_TEST_UTILS_LIB
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Test
+ Qt::Qml
+ Qt::QmlPrivate
+ Qt::Quick
+ Qt::QuickControls2
+ Qt::QuickPrivate
+ Qt::QuickTemplates2
+ Qt::QuickTemplates2Private
+ Qt::QuickTestUtilsPrivate
+)
diff --git a/src/quickcontrolstestutils/controlstestutils.cpp b/src/quickcontrolstestutils/controlstestutils.cpp
new file mode 100644
index 0000000000..a1e64784c4
--- /dev/null
+++ b/src/quickcontrolstestutils/controlstestutils.cpp
@@ -0,0 +1,182 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "controlstestutils_p.h"
+
+#include <QtTest/qsignalspy.h>
+#include <QtQuickControls2/qquickstyle.h>
+#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
+#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
+
+QQuickControlsTestUtils::QQuickControlsApplicationHelper::QQuickControlsApplicationHelper(QQmlDataTest *testCase,
+ const QString &testFilePath, const QStringList &qmlImportPaths, const QVariantMap &initialProperties)
+ : QQuickApplicationHelper(testCase, testFilePath, qmlImportPaths, initialProperties)
+{
+ if (ready)
+ appWindow = qobject_cast<QQuickApplicationWindow*>(cleanup.data());
+}
+
+bool QQuickControlsTestUtils::QQuickStyleHelper::updateStyle(const QString &style)
+{
+ // If it's not the first time a style has been set and the new style is not different, do nothing.
+ if (!currentStyle.isEmpty() && style == currentStyle)
+ return false;
+
+ engine.reset();
+ currentStyle = style;
+ qmlClearTypeRegistrations();
+ engine.reset(new QQmlEngine);
+ QQuickStyle::setStyle(style);
+
+ QQmlComponent component(engine.data());
+ component.setData(QString::fromUtf8("import QtQuick\nimport QtQuick.Controls\n Control { }").toUtf8(), QUrl());
+
+ return true;
+}
+
+void QQuickControlsTestUtils::forEachControl(QQmlEngine *engine, const QString &qqc2ImportPath,
+ const QString &sourcePath, const QString &targetPath, const QStringList &skipList,
+ QQuickControlsTestUtils::ForEachCallback callback)
+{
+ // We cannot use QQmlComponent to load QML files directly from the source tree.
+ // For styles that use internal QML types (eg. material/Ripple.qml), the source
+ // dir would be added as an "implicit" import path overriding the actual import
+ // path (qtbase/qml/QtQuick/Controls.2/Material). => The QML engine fails to load
+ // the style C++ plugin from the implicit import path (the source dir).
+ //
+ // Therefore we only use the source tree for finding out the set of QML files that
+ // a particular style implements, and then we locate the respective QML files in
+ // the engine's import path. This way we can use QQmlComponent to load each QML file
+ // for benchmarking.
+
+ const QFileInfoList entries = QDir(qqc2ImportPath + QLatin1Char('/') + sourcePath).entryInfoList(
+ QStringList(QStringLiteral("*.qml")), QDir::Files);
+ for (const QFileInfo &entry : entries) {
+ QString name = entry.baseName();
+ if (!skipList.contains(name)) {
+ const auto importPathList = engine->importPathList();
+ for (const QString &importPath : importPathList) {
+ QString name = entry.dir().dirName() + QLatin1Char('/') + entry.fileName();
+ QString filePath = importPath + QLatin1Char('/') + targetPath + QLatin1Char('/') + entry.fileName();
+ if (filePath.startsWith(QLatin1Char(':')))
+ filePath.prepend(QStringLiteral("qrc"));
+ if (QFile::exists(filePath)) {
+ callback(name, QUrl::fromLocalFile(filePath));
+ break;
+ } else {
+ QUrl url(filePath);
+ filePath = QQmlFile::urlToLocalFileOrQrc(filePath);
+ if (!filePath.isEmpty() && QFile::exists(filePath)) {
+ callback(name, url);
+ break;
+ }
+ }
+ }
+ }
+ }
+}
+
+void QQuickControlsTestUtils::addTestRowForEachControl(QQmlEngine *engine, const QString &qqc2ImportPath,
+ const QString &sourcePath, const QString &targetPath, const QStringList &skipList)
+{
+ forEachControl(engine, qqc2ImportPath, sourcePath, targetPath, skipList, [&](const QString &relativePath, const QUrl &absoluteUrl) {
+ QTest::newRow(qPrintable(relativePath)) << absoluteUrl;
+ });
+}
+
+bool QQuickControlsTestUtils::verifyButtonClickable(QQuickAbstractButton *button)
+{
+ if (!button->window()) {
+ qWarning() << "button" << button << "doesn't have an associated window";
+ return false;
+ }
+
+ if (!button->isEnabled()) {
+ qWarning() << "button" << button << "is not enabled";
+ return false;
+ }
+
+ if (!button->isVisible()) {
+ qWarning() << "button" << button << "is not visible";
+ return false;
+ }
+
+ if (button->width() <= 0.0) {
+ qWarning() << "button" << button << "must have a width greater than 0";
+ return false;
+ }
+
+ if (button->height() <= 0.0) {
+ qWarning() << "button" << button << "must have a height greater than 0";
+ return false;
+ }
+
+ return true;
+}
+
+bool QQuickControlsTestUtils::clickButton(QQuickAbstractButton *button)
+{
+ if (!verifyButtonClickable(button))
+ return false;
+
+ QSignalSpy spy(button, &QQuickAbstractButton::clicked);
+ if (!spy.isValid()) {
+ qWarning() << "button" << button << "must have a valid clicked signal";
+ return false;
+ }
+
+ const QPoint buttonCenter = button->mapToScene(QPointF(button->width() / 2, button->height() / 2)).toPoint();
+ QTest::mouseClick(button->window(), Qt::LeftButton, Qt::NoModifier, buttonCenter);
+ if (spy.count() != 1) {
+ qWarning() << "clicked signal of button" << button << "was not emitted after clicking";
+ return false;
+ }
+
+ return true;
+}
+
+bool QQuickControlsTestUtils::doubleClickButton(QQuickAbstractButton *button)
+{
+ if (!verifyButtonClickable(button))
+ return false;
+
+ QSignalSpy spy(button, &QQuickAbstractButton::clicked);
+ if (!spy.isValid()) {
+ qWarning() << "button" << button << "must have a valid doubleClicked signal";
+ return false;
+ }
+
+ const QPoint buttonCenter = button->mapToScene(QPointF(button->width() / 2, button->height() / 2)).toPoint();
+ QTest::mouseDClick(button->window(), Qt::LeftButton, Qt::NoModifier, buttonCenter);
+ if (spy.count() != 1) {
+ qWarning() << "doubleClicked signal of button" << button << "was not emitted after double-clicking";
+ return false;
+ }
+
+ return true;
+}
diff --git a/src/quickcontrolstestutils/controlstestutils_p.h b/src/quickcontrolstestutils/controlstestutils_p.h
new file mode 100644
index 0000000000..35e61aabda
--- /dev/null
+++ b/src/quickcontrolstestutils/controlstestutils_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONTROLSTESTUTILS_P_H
+#define CONTROLSTESTUTILS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlEngine;
+class QQuickApplicationWindow;
+class QQuickAbstractButton;
+
+namespace QQuickControlsTestUtils
+{
+ class QQuickControlsApplicationHelper : public QQuickVisualTestUtils::QQuickApplicationHelper
+ {
+ public:
+ QQuickControlsApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath,
+ const QStringList &qmlImportPaths = {},
+ const QVariantMap &initialProperties = {});
+
+ QQuickApplicationWindow *appWindow = nullptr;
+ };
+
+ struct QQuickStyleHelper
+ {
+ bool updateStyle(const QString &style);
+
+ QString currentStyle;
+ QScopedPointer<QQmlEngine> engine;
+ };
+
+ typedef std::function<void(const QString &/*relativePath*/, const QUrl &/*absoluteUrl*/)> ForEachCallback;
+
+ void forEachControl(QQmlEngine *engine, const QString &qqc2ImportPath, const QString &sourcePath,
+ const QString &targetPath, const QStringList &skipList, ForEachCallback callback);
+ void addTestRowForEachControl(QQmlEngine *engine, const QString &qqc2ImportPath, const QString &sourcePath,
+ const QString &targetPath, const QStringList &skipList = QStringList());
+
+ [[nodiscard]] bool verifyButtonClickable(QQuickAbstractButton *button);
+ [[nodiscard]] bool clickButton(QQuickAbstractButton *button);
+ [[nodiscard]] bool doubleClickButton(QQuickAbstractButton *button);
+}
+
+QT_END_NAMESPACE
+
+#endif // CONTROLSTESTUTILS_P_H
diff --git a/tests/auto/quickcontrols2/shared/dialogtestutil.h b/src/quickcontrolstestutils/dialogstestutils_p.h
index c10c4001d5..0aa0da6c01 100644
--- a/tests/auto/quickcontrols2/shared/dialogtestutil.h
+++ b/src/quickcontrolstestutils/dialogstestutils_p.h
@@ -34,13 +34,24 @@
**
****************************************************************************/
-#ifndef QQUICKDIALOGTESTUTIL_H
-#define QQUICKDIALOGTESTUTIL_H
+#ifndef DIALOGSTESTUTILS_H
+#define DIALOGSTESTUTILS_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
-#include "util.h"
-#include "visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
// We need these for Windows, because FolderListModel returns a lowercase drive letter; e.g.:
// "file:///c:/blah.txt", whereas other API returns "file:///C:/blah.txt".
@@ -63,7 +74,7 @@
QCOMPARE(actualPaths, expectedPaths); \
}
-namespace QQuickDialogTestUtil
+namespace QQuickDialogTestUtils
{
// Saves duplicating a bunch of code in every test.
@@ -134,11 +145,11 @@ public:
return appHelper.errorMessage.constData();
}
- QQuickVisualTestUtil::QQuickApplicationHelper appHelper;
+ QQuickVisualTestUtils::QQuickApplicationHelper appHelper;
DialogType *dialog = nullptr;
QuickDialogType *quickDialog = nullptr;
};
}
-#endif // QQUICKDIALOGTESTUTIL_H
+#endif // DIALOGSTESTUTILS_H
diff --git a/tests/auto/quickcontrols2/shared/qtest_quickcontrols.h b/src/quickcontrolstestutils/qtest_quickcontrols_p.h
index 8eadd979c3..ca04ee03f4 100644
--- a/tests/auto/quickcontrols2/shared/qtest_quickcontrols.h
+++ b/src/quickcontrolstestutils/qtest_quickcontrols_p.h
@@ -34,8 +34,19 @@
**
****************************************************************************/
-#ifndef QTEST_QUICKCONTROLS_H
-#define QTEST_QUICKCONTROLS_H
+#ifndef QTEST_QUICKCONTROLS_P_H
+#define QTEST_QUICKCONTROLS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QtTest/qtest.h>
#include <QtTest/private/qtestresult_p.h>
@@ -87,4 +98,4 @@ int main(int argc, char *argv[]) \
return runTests(&tc, argc, argv); \
}
-#endif // QTEST_QUICKCONTROLS_H
+#endif // QTEST_QUICKCONTROLS_P_H
diff --git a/src/quicktestutils/CMakeLists.txt b/src/quicktestutils/CMakeLists.txt
new file mode 100644
index 0000000000..a316de8606
--- /dev/null
+++ b/src/quicktestutils/CMakeLists.txt
@@ -0,0 +1,39 @@
+if(TARGET Qt::Quick)
+ set (quick_sources
+ quick/geometrytestutils.cpp
+ quick/geometrytestutils_p.h
+ quick/viewtestutils.cpp
+ quick/viewtestutils_p.h
+ quick/visualtestutils.cpp
+ quick/visualtestutils_p.h
+ )
+endif()
+
+qt_internal_add_module(QuickTestUtilsPrivate
+ CONFIG_MODULE_NAME quicktestutilsprivate
+ STATIC
+ INTERNAL_MODULE
+ SOURCES
+ qml/platforminputcontext_p.h
+ qml/platformquirks_p.h
+ qml/qmlutils.cpp
+ qml/qmlutils_p.h
+ qml/qqmljsastdumper.cpp
+ qml/qqmljsastdumper_p.h
+ qml/testhttpserver.cpp
+ qml/testhttpserver_p.h
+ ${quick_sources}
+ DEFINES
+ QT_BUILD_SHARED_QML_TEST_UTILS_LIB
+ INCLUDE_DIRECTORIES
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Test
+ Qt::Qml
+ Qt::QmlPrivate
+)
+
+if(TARGET Qt::Quick)
+ target_link_libraries(QuickTestUtilsPrivate PRIVATE Qt::Quick Qt::QuickPrivate Qt::QuickTest)
+endif()
diff --git a/tests/auto/shared/platforminputcontext.h b/src/quicktestutils/qml/platforminputcontext_p.h
index bcb6f52c15..2f75767409 100644
--- a/tests/auto/shared/platforminputcontext.h
+++ b/src/quicktestutils/qml/platforminputcontext_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,9 +26,25 @@
**
****************************************************************************/
+#ifndef PLATFORMINPUTCONTEXT_P_H
+#define PLATFORMINPUTCONTEXT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatforminputcontext.h>
#include <QtGui/QInputMethod>
+QT_BEGIN_NAMESPACE
+
class PlatformInputContext : public QPlatformInputContext
{
public:
@@ -101,3 +117,7 @@ public:
int m_updateCallCount;
Qt::LayoutDirection m_direction;
};
+
+QT_END_NAMESPACE
+
+#endif // PLATFORMINPUTCONTEXT_P_H
diff --git a/tests/auto/shared/platformquirks.h b/src/quicktestutils/qml/platformquirks_p.h
index 5252e8cfe2..16aa160d7c 100644
--- a/tests/auto/shared/platformquirks.h
+++ b/src/quicktestutils/qml/platformquirks_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,8 +26,19 @@
**
****************************************************************************/
-#ifndef PLATFORMQUIRKS_H
-#define PLATFORMQUIRKS_H
+#ifndef PLATFORMQUIRKS_P_H
+#define PLATFORMQUIRKS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <qglobal.h>
@@ -35,6 +46,8 @@
#include <Carbon/Carbon.h>
#endif
+QT_BEGIN_NAMESPACE
+
struct PlatformQuirks
{
static inline bool isClipboardAvailable()
@@ -53,4 +66,6 @@ struct PlatformQuirks
}
};
+QT_END_NAMESPACE
+
#endif
diff --git a/tests/auto/shared/util.cpp b/src/quicktestutils/qml/qmlutils.cpp
index 96876428f6..130dd4e0cb 100644
--- a/tests/auto/shared/util.cpp
+++ b/src/quicktestutils/qml/qmlutils.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,18 +26,23 @@
**
****************************************************************************/
-#include "util.h"
+#include "qmlutils_p.h"
#include <QtCore/QDebug>
#include <QtCore/QMutexLocker>
+#include <QtQml/QQmlComponent>
+#include <QtQml/QQmlEngine>
+
+QT_BEGIN_NAMESPACE
QQmlDataTest *QQmlDataTest::m_instance = 0;
-QQmlDataTest::QQmlDataTest() :
+QQmlDataTest::QQmlDataTest(const char *qmlTestDataDir) :
+ m_qmlTestDataDir(qmlTestDataDir),
#ifdef QT_TESTCASE_BUILDDIR
- m_dataDirectory(QTest::qFindTestData("data", QT_QMLTEST_DATADIR, 0, QT_TESTCASE_BUILDDIR)),
+ m_dataDirectory(QTest::qFindTestData("data", m_qmlTestDataDir, 0, QT_TESTCASE_BUILDDIR)),
#else
- m_dataDirectory(QTest::qFindTestData("data", QT_QMLTEST_DATADIR, 0)),
+ m_dataDirectory(QTest::qFindTestData("data", m_qmlTestDataDir, 0)),
#endif
m_dataDirectoryUrl(m_dataDirectory.startsWith(QLatin1Char(':'))
@@ -54,7 +59,8 @@ QQmlDataTest::~QQmlDataTest()
void QQmlDataTest::initTestCase()
{
- QVERIFY2(!m_dataDirectory.isEmpty(), "'data' directory not found");
+ QVERIFY2(!m_dataDirectory.isEmpty(), qPrintable(QLatin1String(
+ "'data' directory not found in ") + QFileInfo(QString::fromUtf8(m_qmlTestDataDir)).absolutePath()));
m_directory = QFileInfo(m_dataDirectory).absolutePath();
if (m_dataDirectoryUrl.scheme() != QLatin1String("qrc"))
QVERIFY2(QDir::setCurrent(m_directory), qPrintable(QLatin1String("Could not chdir to ") + m_directory));
@@ -70,6 +76,14 @@ QString QQmlDataTest::testFile(const QString &fileName) const
return result;
}
+bool QQmlDataTest::canImportModule(const QString &importTestQmlSource) const
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.setData(importTestQmlSource.toLatin1(), QUrl());
+ return !component.isError();
+}
+
Q_GLOBAL_STATIC(QMutex, qQmlTestMessageHandlerMutex)
QQmlTestMessageHandler *QQmlTestMessageHandler::m_instance = 0;
@@ -78,10 +92,12 @@ void QQmlTestMessageHandler::messageHandler(QtMsgType, const QMessageLogContext
{
QMutexLocker locker(qQmlTestMessageHandlerMutex());
if (QQmlTestMessageHandler::m_instance) {
- if (QQmlTestMessageHandler::m_instance->m_includeCategories)
- QQmlTestMessageHandler::m_instance->m_messages.push_back(QString("%1: %2").arg(context.category, message));
- else
+ if (QQmlTestMessageHandler::m_instance->m_includeCategories) {
+ QQmlTestMessageHandler::m_instance->m_messages.push_back(
+ QString::fromLatin1("%1: %2").arg(QString::fromUtf8(context.category), message));
+ } else {
QQmlTestMessageHandler::m_instance->m_messages.push_back(message);
+ }
}
}
@@ -101,3 +117,5 @@ QQmlTestMessageHandler::~QQmlTestMessageHandler()
qInstallMessageHandler(m_oldHandler);
QQmlTestMessageHandler::m_instance = 0;
}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/shared/util.h b/src/quicktestutils/qml/qmlutils_p.h
index 2088258378..9df1ac2f1b 100644
--- a/tests/auto/shared/util.h
+++ b/src/quicktestutils/qml/qmlutils_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,8 +26,19 @@
**
****************************************************************************/
-#ifndef QQMLTESTUTILS_H
-#define QQMLTESTUTILS_H
+#ifndef QQMLTESTUTILS_P_H
+#define QQMLTESTUTILS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QtCore/QDir>
#include <QtCore/QUrl>
@@ -35,13 +46,15 @@
#include <QtCore/QStringList>
#include <QtTest/QTest>
+QT_BEGIN_NAMESPACE
+
/* Base class for tests with data that are located in a "data" subfolder. */
class QQmlDataTest : public QObject
{
Q_OBJECT
public:
- QQmlDataTest();
+ QQmlDataTest(const char *qmlTestDataDir);
virtual ~QQmlDataTest();
QString testFile(const QString &fileName) const;
@@ -63,12 +76,17 @@ public:
static inline QQmlDataTest *instance() { return m_instance; }
+ bool canImportModule(const QString &importTestQmlSource) const;
+
public slots:
virtual void initTestCase();
private:
static QQmlDataTest *m_instance;
+ // The directory in which to search for the "data" directory.
+ const char *m_qmlTestDataDir = nullptr;
+ // The path to the "data" directory, if found.
const QString m_dataDirectory;
const QUrl m_dataDirectoryUrl;
QString m_directory;
@@ -97,4 +115,6 @@ private:
bool m_includeCategories;
};
-#endif // QQMLTESTUTILS_H
+QT_END_NAMESPACE
+
+#endif // QQMLTESTUTILS_P_H
diff --git a/tests/auto/shared/qqmljsastdumper.cpp b/src/quicktestutils/qml/qqmljsastdumper.cpp
index 9d4d186655..4882d6c1ff 100644
--- a/tests/auto/shared/qqmljsastdumper.cpp
+++ b/src/quicktestutils/qml/qqmljsastdumper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
@@ -35,7 +35,7 @@
**
** $QT_END_LICENSE$
**/
-#include "qqmljsastdumper.h"
+#include "qqmljsastdumper_p.h"
#include <private/qqmljsast_p.h>
#include <QtCore/QDebug>
#include <QtCore/QString>
@@ -248,14 +248,13 @@ bool AstDumper::visit(UiImport *el)
}
bool AstDumper::visit(UiPublicMember *el) {
- auto boolToStr = [](bool b) { return b ? "true" : "false"; };
QString typeStr = ((el->type == UiPublicMember::Signal) ? QLatin1String("Signal") :
(el->type == UiPublicMember::Property) ? QLatin1String("Property") : QStringLiteral("Unexpected(%1)").arg(el->type));
start(QLatin1String("UiPublicMember type=%1 typeModifier=%2 name=%3 isDefaultMember=%4 isReadonlyMember=%5 isRequired=%6 "
"defaultToken=%7 readonlyToken=%8 propertyToken=%9 requiredToken=%10 typeModifierToken=%11 typeToken=%12 "
"identifierToken=%13 colonToken=%14 semicolonToken=%15")
.arg(qs(typeStr), qs(el->typeModifier), qs(el->name),
- boolToStr(el->isDefaultMember), boolToStr(el->isReadonlyMember), boolToStr(el->isRequired),
+ boolStr(el->isDefaultMember), boolStr(el->isReadonlyMember), boolStr(el->isRequired),
loc(el->defaultToken), loc(el->readonlyToken), loc(el->propertyToken),
loc(el->requiredToken), loc(el->typeModifierToken), loc(el->typeToken),
loc(el->identifierToken), loc(el->colonToken), loc(el->semicolonToken)
diff --git a/tests/auto/shared/qqmljsastdumper.h b/src/quicktestutils/qml/qqmljsastdumper_p.h
index 839dd99942..055303ae59 100644
--- a/tests/auto/shared/qqmljsastdumper.h
+++ b/src/quicktestutils/qml/qqmljsastdumper_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
@@ -35,8 +35,8 @@
**
** $QT_END_LICENSE$
**/
-#ifndef ASTDUMPER_H
-#define ASTDUMPER_H
+#ifndef ASTDUMPER_P_H
+#define ASTDUMPER_P_H
//
@@ -446,4 +446,4 @@ std::ostream &operator<<(std::ostream &stream, AST::Node *n);
QT_END_NAMESPACE
-#endif // ASTDUMPER_H
+#endif // ASTDUMPER_P_H
diff --git a/tests/auto/shared/testhttpserver.cpp b/src/quicktestutils/qml/testhttpserver.cpp
index f4347f183f..ca574e421c 100644
--- a/tests/auto/shared/testhttpserver.cpp
+++ b/src/quicktestutils/qml/testhttpserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,7 +26,7 @@
**
****************************************************************************/
-#include "testhttpserver.h"
+#include "testhttpserver_p.h"
#include <QTcpSocket>
#include <QDebug>
#include <QFile>
@@ -34,6 +34,8 @@
#include <QTest>
#include <QQmlFile>
+QT_BEGIN_NAMESPACE
+
/*!
\internal
\class TestHTTPServer
@@ -449,3 +451,5 @@ void ThreadedTestHTTPServer::start()
QThread::start();
m_condition.wait(&m_mutex);
}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/shared/testhttpserver.h b/src/quicktestutils/qml/testhttpserver_p.h
index 42cc50e028..db99b348ca 100644
--- a/tests/auto/shared/testhttpserver.h
+++ b/src/quicktestutils/qml/testhttpserver_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,8 +26,19 @@
**
****************************************************************************/
-#ifndef TESTHTTPSERVER_H
-#define TESTHTTPSERVER_H
+#ifndef TESTHTTPSERVER_P_H
+#define TESTHTTPSERVER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QTcpServer>
#include <QUrl>
@@ -36,6 +47,8 @@
#include <QMutex>
#include <QWaitCondition>
+QT_BEGIN_NAMESPACE
+
class TestHTTPServer : public QObject
{
Q_OBJECT
@@ -124,5 +137,7 @@ private:
QWaitCondition m_condition;
};
-#endif // TESTHTTPSERVER_H
+QT_END_NAMESPACE
+
+#endif // TESTHTTPSERVER_P_H
diff --git a/tests/auto/quick/shared/geometrytestutil.cpp b/src/quicktestutils/quick/geometrytestutils.cpp
index 07a755e9a5..2234e81528 100644
--- a/tests/auto/quick/shared/geometrytestutil.cpp
+++ b/src/quicktestutils/quick/geometrytestutils.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,10 +26,12 @@
**
****************************************************************************/
-#include "geometrytestutil.h"
+#include "geometrytestutils_p.h"
#include <QQuickItem>
+QT_BEGIN_NAMESPACE
+
QSizeChangeListener::QSizeChangeListener(QQuickItem *item) :
item(item)
{
@@ -41,3 +43,5 @@ void QSizeChangeListener::onSizeChanged()
{
append(QSize(item->width(), item->height()));
}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/quick/shared/geometrytestutil.h b/src/quicktestutils/quick/geometrytestutils_p.h
index 2cf19ed7ff..867dddeda3 100644
--- a/tests/auto/quick/shared/geometrytestutil.h
+++ b/src/quicktestutils/quick/geometrytestutils_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,14 +26,27 @@
**
****************************************************************************/
-#ifndef QQUICKGEOMETRYTESTUTIL_H
-#define QQUICKGEOMETRYTESTUTIL_H
+#ifndef QQUICKGEOMETRYTESTUTIL_P_H
+#define QQUICKGEOMETRYTESTUTIL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QObject>
#include <QVector>
#include <QSize>
-QT_FORWARD_DECLARE_CLASS(QQuickItem)
+QT_BEGIN_NAMESPACE
+
+class QQuickItem;
class QSizeChangeListener : public QObject, public QVector<QSize>
{
@@ -46,4 +59,6 @@ private:
QQuickItem *item;
};
-#endif // QQUICKGEOMETRYTESTUTIL_H
+QT_END_NAMESPACE
+
+#endif // QQUICKGEOMETRYTESTUTIL_P_H
diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/src/quicktestutils/quick/viewtestutils.cpp
index 5d9e6ba8dc..2a0cc94638 100644
--- a/tests/auto/quick/shared/viewtestutil.cpp
+++ b/src/quicktestutils/quick/viewtestutils.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,7 +26,7 @@
**
****************************************************************************/
-#include "viewtestutil.h"
+#include "viewtestutils_p.h"
#include <QtCore/QRandomGenerator>
#include <QtQuick/QQuickView>
@@ -39,30 +39,32 @@
#include <QtQuick/private/qquickitemview_p_p.h>
#include <QtQuick/private/qquickwindow_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+
QT_BEGIN_NAMESPACE
-QQuickView *QQuickViewTestUtil::createView()
+QQuickView *QQuickViewTestUtils::createView()
{
QQuickView *window = new QQuickView(0);
const QSize size(240, 320);
window->resize(size);
- QQuickViewTestUtil::centerOnScreen(window, size);
+ QQuickViewTestUtils::centerOnScreen(window, size);
return window;
}
-void QQuickViewTestUtil::centerOnScreen(QQuickView *window, const QSize &size)
+void QQuickViewTestUtils::centerOnScreen(QQuickView *window, const QSize &size)
{
const QRect screenGeometry = window->screen()->availableGeometry();
const QPoint offset = QPoint(size.width() / 2, size.height() / 2);
window->setFramePosition(screenGeometry.center() - offset);
}
-void QQuickViewTestUtil::centerOnScreen(QQuickView *window)
+void QQuickViewTestUtils::centerOnScreen(QQuickView *window)
{
- QQuickViewTestUtil::centerOnScreen(window, window->size());
+ QQuickViewTestUtils::centerOnScreen(window, window->size());
}
-void QQuickViewTestUtil::moveMouseAway(QQuickView *window)
+void QQuickViewTestUtils::moveMouseAway(QQuickView *window)
{
#if QT_CONFIG(cursor) // Get the cursor out of the way.
QCursor::setPos(window->geometry().topRight() + QPoint(100, 100));
@@ -71,19 +73,19 @@ void QQuickViewTestUtil::moveMouseAway(QQuickView *window)
#endif
}
-void QQuickViewTestUtil::moveAndRelease(QQuickView *window, const QPoint &position)
+void QQuickViewTestUtils::moveAndRelease(QQuickView *window, const QPoint &position)
{
QTest::mouseMove(window, position);
QTest::mouseRelease(window, Qt::LeftButton, {}, position);
}
-void QQuickViewTestUtil::moveAndPress(QQuickView *window, const QPoint &position)
+void QQuickViewTestUtils::moveAndPress(QQuickView *window, const QPoint &position)
{
QTest::mouseMove(window, position);
QTest::mousePress(window, Qt::LeftButton, {}, position);
}
-void QQuickViewTestUtil::flick(QQuickView *window, const QPoint &from, const QPoint &to, int duration)
+void QQuickViewTestUtils::flick(QQuickView *window, const QPoint &from, const QPoint &to, int duration)
{
const int pointCount = 5;
QPoint diff = to - from;
@@ -98,7 +100,7 @@ void QQuickViewTestUtil::flick(QQuickView *window, const QPoint &from, const QPo
QTest::qWait(50);
}
-QList<int> QQuickViewTestUtil::adjustIndexesForAddDisplaced(const QList<int> &indexes, int index, int count)
+QList<int> QQuickViewTestUtils::adjustIndexesForAddDisplaced(const QList<int> &indexes, int index, int count)
{
QList<int> result;
for (int i=0; i<indexes.count(); i++) {
@@ -111,7 +113,7 @@ QList<int> QQuickViewTestUtil::adjustIndexesForAddDisplaced(const QList<int> &in
return result;
}
-QList<int> QQuickViewTestUtil::adjustIndexesForMove(const QList<int> &indexes, int from, int to, int count)
+QList<int> QQuickViewTestUtils::adjustIndexesForMove(const QList<int> &indexes, int from, int to, int count)
{
QList<int> result;
for (int i=0; i<indexes.count(); i++) {
@@ -132,7 +134,7 @@ QList<int> QQuickViewTestUtil::adjustIndexesForMove(const QList<int> &indexes, i
return result;
}
-QList<int> QQuickViewTestUtil::adjustIndexesForRemoveDisplaced(const QList<int> &indexes, int index, int count)
+QList<int> QQuickViewTestUtils::adjustIndexesForRemoveDisplaced(const QList<int> &indexes, int index, int count)
{
QList<int> result;
for (int i=0; i<indexes.count(); i++) {
@@ -144,24 +146,24 @@ QList<int> QQuickViewTestUtil::adjustIndexesForRemoveDisplaced(const QList<int>
return result;
}
-QQuickViewTestUtil::QaimModel::QaimModel(QObject *parent)
+QQuickViewTestUtils::QaimModel::QaimModel(QObject *parent)
: QAbstractListModel(parent)
{
}
-int QQuickViewTestUtil::QaimModel::rowCount(const QModelIndex &parent) const
+int QQuickViewTestUtils::QaimModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return list.count();
}
-int QQuickViewTestUtil::QaimModel::columnCount(const QModelIndex &parent) const
+int QQuickViewTestUtils::QaimModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return columns;
}
-QHash<int,QByteArray> QQuickViewTestUtil::QaimModel::roleNames() const
+QHash<int,QByteArray> QQuickViewTestUtils::QaimModel::roleNames() const
{
QHash<int,QByteArray> roles = QAbstractListModel::roleNames();
roles.insert(Name, "name");
@@ -169,7 +171,7 @@ QHash<int,QByteArray> QQuickViewTestUtil::QaimModel::roleNames() const
return roles;
}
-QVariant QQuickViewTestUtil::QaimModel::data(const QModelIndex &index, int role) const
+QVariant QQuickViewTestUtils::QaimModel::data(const QModelIndex &index, int role) const
{
QVariant rv;
if (role == Name)
@@ -180,29 +182,29 @@ QVariant QQuickViewTestUtil::QaimModel::data(const QModelIndex &index, int role)
return rv;
}
-int QQuickViewTestUtil::QaimModel::count() const
+int QQuickViewTestUtils::QaimModel::count() const
{
return rowCount() * columnCount();
}
-QString QQuickViewTestUtil::QaimModel::name(int index) const
+QString QQuickViewTestUtils::QaimModel::name(int index) const
{
return list.at(index).first;
}
-QString QQuickViewTestUtil::QaimModel::number(int index) const
+QString QQuickViewTestUtils::QaimModel::number(int index) const
{
return list.at(index).second;
}
-void QQuickViewTestUtil::QaimModel::addItem(const QString &name, const QString &number)
+void QQuickViewTestUtils::QaimModel::addItem(const QString &name, const QString &number)
{
emit beginInsertRows(QModelIndex(), list.count(), list.count());
list.append(QPair<QString,QString>(name, number));
emit endInsertRows();
}
-void QQuickViewTestUtil::QaimModel::addItems(const QList<QPair<QString, QString> > &items)
+void QQuickViewTestUtils::QaimModel::addItems(const QList<QPair<QString, QString> > &items)
{
emit beginInsertRows(QModelIndex(), list.count(), list.count()+items.count()-1);
for (int i=0; i<items.count(); i++)
@@ -210,14 +212,14 @@ void QQuickViewTestUtil::QaimModel::addItems(const QList<QPair<QString, QString>
emit endInsertRows();
}
-void QQuickViewTestUtil::QaimModel::insertItem(int index, const QString &name, const QString &number)
+void QQuickViewTestUtils::QaimModel::insertItem(int index, const QString &name, const QString &number)
{
emit beginInsertRows(QModelIndex(), index, index);
list.insert(index, QPair<QString,QString>(name, number));
emit endInsertRows();
}
-void QQuickViewTestUtil::QaimModel::insertItems(int index, const QList<QPair<QString, QString> > &items)
+void QQuickViewTestUtils::QaimModel::insertItems(int index, const QList<QPair<QString, QString> > &items)
{
emit beginInsertRows(QModelIndex(), index, index+items.count()-1);
for (int i=0; i<items.count(); i++)
@@ -225,14 +227,14 @@ void QQuickViewTestUtil::QaimModel::insertItems(int index, const QList<QPair<QSt
emit endInsertRows();
}
-void QQuickViewTestUtil::QaimModel::removeItem(int index)
+void QQuickViewTestUtils::QaimModel::removeItem(int index)
{
emit beginRemoveRows(QModelIndex(), index, index);
list.removeAt(index);
emit endRemoveRows();
}
-void QQuickViewTestUtil::QaimModel::removeItems(int index, int count)
+void QQuickViewTestUtils::QaimModel::removeItems(int index, int count)
{
emit beginRemoveRows(QModelIndex(), index, index+count-1);
while (count--)
@@ -240,27 +242,27 @@ void QQuickViewTestUtil::QaimModel::removeItems(int index, int count)
emit endRemoveRows();
}
-void QQuickViewTestUtil::QaimModel::moveItem(int from, int to)
+void QQuickViewTestUtils::QaimModel::moveItem(int from, int to)
{
emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to);
list.move(from, to);
emit endMoveRows();
}
-void QQuickViewTestUtil::QaimModel::moveItems(int from, int to, int count)
+void QQuickViewTestUtils::QaimModel::moveItems(int from, int to, int count)
{
emit beginMoveRows(QModelIndex(), from, from+count-1, QModelIndex(), to > from ? to+count : to);
qquickmodelviewstestutil_move(from, to, count, &list);
emit endMoveRows();
}
-void QQuickViewTestUtil::QaimModel::modifyItem(int idx, const QString &name, const QString &number)
+void QQuickViewTestUtils::QaimModel::modifyItem(int idx, const QString &name, const QString &number)
{
list[idx] = QPair<QString,QString>(name, number);
emit dataChanged(index(idx,0), index(idx,0));
}
-void QQuickViewTestUtil::QaimModel::clear()
+void QQuickViewTestUtils::QaimModel::clear()
{
int count = list.count();
if (count > 0) {
@@ -270,13 +272,13 @@ void QQuickViewTestUtil::QaimModel::clear()
}
}
-void QQuickViewTestUtil::QaimModel::reset()
+void QQuickViewTestUtils::QaimModel::reset()
{
emit beginResetModel();
emit endResetModel();
}
-void QQuickViewTestUtil::QaimModel::resetItems(const QList<QPair<QString, QString> > &items)
+void QQuickViewTestUtils::QaimModel::resetItems(const QList<QPair<QString, QString> > &items)
{
beginResetModel();
list = items;
@@ -297,7 +299,7 @@ private:
const char *data;
};
-void QQuickViewTestUtil::QaimModel::matchAgainst(const QList<QPair<QString, QString> > &other, const QString &error1, const QString &error2) {
+void QQuickViewTestUtils::QaimModel::matchAgainst(const QList<QPair<QString, QString> > &other, const QString &error1, const QString &error2) {
for (int i=0; i<other.count(); i++) {
QVERIFY2(list.contains(other[i]),
ScopedPrintable(other[i].first + QLatin1Char(' ') + other[i].second + QLatin1Char(' ') + error1));
@@ -310,29 +312,29 @@ void QQuickViewTestUtil::QaimModel::matchAgainst(const QList<QPair<QString, QStr
-QQuickViewTestUtil::ListRange::ListRange()
+QQuickViewTestUtils::ListRange::ListRange()
: valid(false)
{
}
-QQuickViewTestUtil::ListRange::ListRange(const ListRange &other)
+QQuickViewTestUtils::ListRange::ListRange(const ListRange &other)
: valid(other.valid)
{
indexes = other.indexes;
}
-QQuickViewTestUtil::ListRange::ListRange(int start, int end)
+QQuickViewTestUtils::ListRange::ListRange(int start, int end)
: valid(true)
{
for (int i=start; i<=end; i++)
indexes << i;
}
-QQuickViewTestUtil::ListRange::~ListRange()
+QQuickViewTestUtils::ListRange::~ListRange()
{
}
-QQuickViewTestUtil::ListRange QQuickViewTestUtil::ListRange::operator+(const ListRange &other) const
+QQuickViewTestUtils::ListRange QQuickViewTestUtils::ListRange::operator+(const ListRange &other) const
{
if (other == *this)
return *this;
@@ -341,28 +343,28 @@ QQuickViewTestUtil::ListRange QQuickViewTestUtil::ListRange::operator+(const Lis
return a;
}
-bool QQuickViewTestUtil::ListRange::operator==(const ListRange &other) const
+bool QQuickViewTestUtils::ListRange::operator==(const ListRange &other) const
{
return QSet<int>(indexes.cbegin(), indexes.cend())
== QSet<int>(other.indexes.cbegin(), other.indexes.cend());
}
-bool QQuickViewTestUtil::ListRange::operator!=(const ListRange &other) const
+bool QQuickViewTestUtils::ListRange::operator!=(const ListRange &other) const
{
return !(*this == other);
}
-bool QQuickViewTestUtil::ListRange::isValid() const
+bool QQuickViewTestUtils::ListRange::isValid() const
{
return valid;
}
-int QQuickViewTestUtil::ListRange::count() const
+int QQuickViewTestUtils::ListRange::count() const
{
return indexes.count();
}
-QList<QPair<QString,QString> > QQuickViewTestUtil::ListRange::getModelDataValues(const QaimModel &model)
+QList<QPair<QString,QString> > QQuickViewTestUtils::ListRange::getModelDataValues(const QaimModel &model)
{
QList<QPair<QString,QString> > data;
if (!valid)
@@ -372,7 +374,7 @@ QList<QPair<QString,QString> > QQuickViewTestUtil::ListRange::getModelDataValues
return data;
}
-QQuickViewTestUtil::StressTestModel::StressTestModel()
+QQuickViewTestUtils::StressTestModel::StressTestModel()
: QAbstractListModel()
, m_rowCount(20)
{
@@ -383,17 +385,17 @@ QQuickViewTestUtil::StressTestModel::StressTestModel()
connect(t, &QTimer::timeout, this, &StressTestModel::updateModel);
}
-int QQuickViewTestUtil::StressTestModel::rowCount(const QModelIndex &) const
+int QQuickViewTestUtils::StressTestModel::rowCount(const QModelIndex &) const
{
return m_rowCount;
}
-QVariant QQuickViewTestUtil::StressTestModel::data(const QModelIndex &, int) const
+QVariant QQuickViewTestUtils::StressTestModel::data(const QModelIndex &, int) const
{
return QVariant();
}
-void QQuickViewTestUtil::StressTestModel::updateModel()
+void QQuickViewTestUtils::StressTestModel::updateModel()
{
if (m_rowCount > 10) {
for (int i = 0; i < 10; ++i) {
@@ -413,7 +415,7 @@ void QQuickViewTestUtil::StressTestModel::updateModel()
}
}
-bool QQuickViewTestUtil::testVisibleItems(const QQuickItemViewPrivate *priv, bool *nonUnique, FxViewItem **failItem, int *expectedIdx)
+bool QQuickViewTestUtils::testVisibleItems(const QQuickItemViewPrivate *priv, bool *nonUnique, FxViewItem **failItem, int *expectedIdx)
{
QHash<QQuickItem*, int> uniqueItems;
diff --git a/tests/auto/quick/shared/viewtestutil.h b/src/quicktestutils/quick/viewtestutils_p.h
index 377296b095..47026c86c0 100644
--- a/tests/auto/quick/shared/viewtestutil.h
+++ b/src/quicktestutils/quick/viewtestutils_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,12 +26,23 @@
**
****************************************************************************/
-#ifndef QQUICKVIEWTESTUTIL_H
-#define QQUICKVIEWTESTUTIL_H
+#ifndef QQUICKVIEWTESTUTILS_P_H
+#define QQUICKVIEWTESTUTILS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
-#include <QtQuick/QQuickItem>
-#include <QtQml/QQmlExpression>
#include <QtCore/QAbstractListModel>
+#include <QtQml/QQmlExpression>
+#include <QtQuick/QQuickItem>
QT_FORWARD_DECLARE_CLASS(QQuickView)
QT_FORWARD_DECLARE_CLASS(QQuickItemViewPrivate)
@@ -39,7 +50,7 @@ QT_FORWARD_DECLARE_CLASS(FxViewItem)
QT_BEGIN_NAMESPACE
-namespace QQuickViewTestUtil
+namespace QQuickViewTestUtils
{
QQuickView *createView();
@@ -194,10 +205,10 @@ namespace QQuickTest {
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QQuickViewTestUtil::QaimModel*)
-Q_DECLARE_METATYPE(QQuickViewTestUtil::ListChange)
-Q_DECLARE_METATYPE(QList<QQuickViewTestUtil::ListChange>)
-Q_DECLARE_METATYPE(QQuickViewTestUtil::ListRange)
+Q_DECLARE_METATYPE(QQuickViewTestUtils::QaimModel*)
+Q_DECLARE_METATYPE(QQuickViewTestUtils::ListChange)
+Q_DECLARE_METATYPE(QList<QQuickViewTestUtils::ListChange>)
+Q_DECLARE_METATYPE(QQuickViewTestUtils::ListRange)
-#endif // QQUICKVIEWTESTUTIL_H
+#endif // QQUICKVIEWTESTUTILS_P_H
diff --git a/src/quicktestutils/quick/visualtestutils.cpp b/src/quicktestutils/quick/visualtestutils.cpp
new file mode 100644
index 0000000000..c94484d189
--- /dev/null
+++ b/src/quicktestutils/quick/visualtestutils.cpp
@@ -0,0 +1,225 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "visualtestutils_p.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+#include <QtQuick/QQuickItem>
+#include <QtQuick/private/qquickitemview_p.h>
+#include <QtQuickTest/QtQuickTest>
+
+QT_BEGIN_NAMESPACE
+
+QQuickItem *QQuickVisualTestUtils::findVisibleChild(QQuickItem *parent, const QString &objectName)
+{
+ QQuickItem *item = 0;
+ QList<QQuickItem*> items = parent->findChildren<QQuickItem*>(objectName);
+ for (int i = 0; i < items.count(); ++i) {
+ if (items.at(i)->isVisible() && !QQuickItemPrivate::get(items.at(i))->culled) {
+ item = items.at(i);
+ break;
+ }
+ }
+ return item;
+}
+
+void QQuickVisualTestUtils::dumpTree(QQuickItem *parent, int depth)
+{
+ static QString padding = QStringLiteral(" ");
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i));
+ if (!item)
+ continue;
+ qDebug() << padding.left(depth*2) << item;
+ dumpTree(item, depth+1);
+ }
+}
+
+void QQuickVisualTestUtils::moveMouseAway(QQuickWindow *window)
+{
+#if QT_CONFIG(cursor) // Get the cursor out of the way.
+ // Using "bottomRight() + QPoint(100, 100)" was causing issues on Ubuntu,
+ // where the window was positioned at the bottom right corner of the window
+ // (even after centering the window on the screen), so we use another position.
+ QCursor::setPos(window->frameGeometry().bottomLeft() + QPoint(-10, 10));
+#endif
+
+ // make sure hover events from QQuickWindowPrivate::flushFrameSynchronousEvents()
+ // do not interfere with the tests
+ QEvent leave(QEvent::Leave);
+ QCoreApplication::sendEvent(window, &leave);
+}
+
+void QQuickVisualTestUtils::centerOnScreen(QQuickWindow *window)
+{
+ const QRect screenGeometry = window->screen()->availableGeometry();
+ const QPoint offset = QPoint(window->width() / 2, window->height() / 2);
+ window->setFramePosition(screenGeometry.center() - offset);
+}
+
+bool QQuickVisualTestUtils::delegateVisible(QQuickItem *item)
+{
+ return item->isVisible() && !QQuickItemPrivate::get(item)->culled;
+}
+
+/*!
+ \internal
+
+ Compares \a ia with \a ib, returning \c true if the images are equal.
+ If they are not equal, \c false is returned and \a errorMessage is set.
+
+ A custom compare function to avoid issues such as:
+ When running on native Nvidia graphics cards on linux, the
+ distance field glyph pixels have a measurable, but not visible
+ pixel error. This was GT-216 with the ubuntu "nvidia-319" driver package.
+ llvmpipe does not show the same issue.
+*/
+bool QQuickVisualTestUtils::compareImages(const QImage &ia, const QImage &ib, QString *errorMessage)
+{
+ if (ia.size() != ib.size()) {
+ QDebug(errorMessage) << "Images are of different size:" << ia.size() << ib.size()
+ << "DPR:" << ia.devicePixelRatio() << ib.devicePixelRatio();
+ return false;
+ }
+ if (ia.format() != ib.format()) {
+ QDebug(errorMessage) << "Images are of different formats:" << ia.format() << ib.format();
+ return false;
+ }
+
+ int w = ia.width();
+ int h = ia.height();
+ const int tolerance = 5;
+ for (int y=0; y<h; ++y) {
+ const uint *as= (const uint *) ia.constScanLine(y);
+ const uint *bs= (const uint *) ib.constScanLine(y);
+ for (int x=0; x<w; ++x) {
+ uint a = as[x];
+ uint b = bs[x];
+
+ // No tolerance for error in the alpha.
+ if ((a & 0xff000000) != (b & 0xff000000)
+ || qAbs(qRed(a) - qRed(b)) > tolerance
+ || qAbs(qRed(a) - qRed(b)) > tolerance
+ || qAbs(qRed(a) - qRed(b)) > tolerance) {
+ QDebug(errorMessage) << "Mismatch at:" << x << y << ':'
+ << Qt::hex << Qt::showbase << a << b;
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+/*!
+ \internal
+
+ Finds the delegate at \c index belonging to \c itemView, using the given \c flags.
+
+ If the view needs to be polished, the function will wait for it to be done before continuing,
+ and returns \c nullptr if the polish didn't happen.
+*/
+QQuickItem *QQuickVisualTestUtils::findViewDelegateItem(QQuickItemView *itemView, int index, FindViewDelegateItemFlags flags)
+{
+ if (QQuickTest::qIsPolishScheduled(itemView)) {
+ if (!QQuickTest::qWaitForItemPolished(itemView)) {
+ qWarning() << "failed to polish" << itemView;
+ return nullptr;
+ }
+ }
+
+ // Do this after the polish, just in case the count changes after a polish...
+ if (index <= -1 || index >= itemView->count()) {
+ qWarning() << "index" << index << "is out of bounds for" << itemView;
+ return nullptr;
+ }
+
+ if (flags.testFlag(FindViewDelegateItemFlag::PositionViewAtIndex))
+ itemView->positionViewAtIndex(index, QQuickItemView::Center);
+
+ return itemView->itemAtIndex(index);
+}
+
+QQuickVisualTestUtils::QQuickApplicationHelper::QQuickApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath, const QStringList &qmlImportPaths, const QVariantMap &initialProperties)
+{
+ for (const auto &path : qmlImportPaths)
+ engine.addImportPath(path);
+
+ QQmlComponent component(&engine);
+
+ component.loadUrl(testCase->testFileUrl(testFilePath));
+ QVERIFY2(component.isReady(), qPrintable(component.errorString()));
+ QObject *rootObject = component.createWithInitialProperties(initialProperties);
+ cleanup.reset(rootObject);
+ if (component.isError() || !rootObject) {
+ errorMessage = QString::fromUtf8("Failed to create window: %1").arg(component.errorString()).toUtf8();
+ return;
+ }
+
+ window = qobject_cast<QQuickWindow*>(rootObject);
+ if (!window) {
+ errorMessage = QString::fromUtf8("Root object %1 must be a QQuickWindow subclass").arg(QDebug::toString(window)).toUtf8();
+ return;
+ }
+
+ if (window->isVisible()) {
+ errorMessage = QString::fromUtf8("Expected window not to be visible, but it is").toUtf8();
+ return;
+ }
+
+ ready = true;
+}
+
+QQuickVisualTestUtils::MnemonicKeySimulator::MnemonicKeySimulator(QWindow *window)
+ : m_window(window), m_modifiers(Qt::NoModifier)
+{
+}
+
+void QQuickVisualTestUtils::MnemonicKeySimulator::press(Qt::Key key)
+{
+ // QTest::keyPress() but not generating the press event for the modifier key.
+ if (key == Qt::Key_Alt)
+ m_modifiers |= Qt::AltModifier;
+ QTest::simulateEvent(m_window, true, key, m_modifiers, QString(), false);
+}
+
+void QQuickVisualTestUtils::MnemonicKeySimulator::release(Qt::Key key)
+{
+ // QTest::keyRelease() but not generating the release event for the modifier key.
+ if (key == Qt::Key_Alt)
+ m_modifiers &= ~Qt::AltModifier;
+ QTest::simulateEvent(m_window, false, key, m_modifiers, QString(), false);
+}
+
+void QQuickVisualTestUtils::MnemonicKeySimulator::click(Qt::Key key)
+{
+ press(key);
+ release(key);
+}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/quick/shared/visualtestutil.h b/src/quicktestutils/quick/visualtestutils_p.h
index c07cecfa47..873e9dc97c 100644
--- a/tests/auto/quick/shared/visualtestutil.h
+++ b/src/quicktestutils/quick/visualtestutils_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,15 +26,31 @@
**
****************************************************************************/
-#ifndef QQUICKVISUALTESTUTIL_H
-#define QQUICKVISUALTESTUTIL_H
+#ifndef QQUICKVISUALTESTUTILS_P_H
+#define QQUICKVISUALTESTUTILS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqmlexpression.h>
+#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/QQuickItem>
-#include <QtQml/QQmlExpression>
+#include <private/qmlutils_p.h>
-#include <QtQuick/private/qquickitem_p.h>
+QT_BEGIN_NAMESPACE
-namespace QQuickVisualTestUtil
+class QQuickItemView;
+class QQuickWindow;
+
+namespace QQuickVisualTestUtils
{
QQuickItem *findVisibleChild(QQuickItem *parent, const QString &objectName);
@@ -42,6 +58,11 @@ namespace QQuickVisualTestUtil
bool delegateVisible(QQuickItem *item);
+ void moveMouseAway(QQuickWindow *window);
+ void centerOnScreen(QQuickWindow *window);
+
+ bool delegateVisible(QQuickItem *item);
+
/*
Find an item with the specified objectName. If index is supplied then the
item must also evaluate the {index} expression equal to index
@@ -125,6 +146,74 @@ namespace QQuickVisualTestUtil
signalNames << m.name();
}
};
+
+ enum class FindViewDelegateItemFlag {
+ None = 0x0,
+ PositionViewAtIndex = 0x01
+ };
+ Q_DECLARE_FLAGS(FindViewDelegateItemFlags, FindViewDelegateItemFlag)
+
+ QQuickItem* findViewDelegateItem(QQuickItemView *itemView, int index,
+ FindViewDelegateItemFlags flags = FindViewDelegateItemFlag::PositionViewAtIndex);
+
+ /*!
+ \internal
+
+ Same as above except allows use in QTRY_* functions without having to call it again
+ afterwards to assign the delegate.
+ */
+ template<typename T>
+ bool findViewDelegateItem(QQuickItemView *itemView, int index, T &delegateItem,
+ FindViewDelegateItemFlags flags = FindViewDelegateItemFlag::PositionViewAtIndex)
+ {
+ delegateItem = qobject_cast<T>(findViewDelegateItem(itemView, index, flags));
+ return delegateItem != nullptr;
+ }
+
+ class QQuickApplicationHelper
+ {
+ public:
+ QQuickApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath,
+ const QStringList &qmlImportPaths = {},
+ const QVariantMap &initialProperties = {});
+
+ // Return a C-style string instead of QString because that's what QTest uses for error messages,
+ // so it saves code at the calling site.
+ inline const char *failureMessage() const
+ {
+ return errorMessage.constData();
+ }
+
+ QQmlEngine engine;
+ QScopedPointer<QObject> cleanup;
+ QQuickWindow *window = nullptr;
+
+ bool ready = false;
+ // Store as a byte array so that we can return its raw data safely;
+ // using qPrintable() in failureMessage() will construct a throwaway QByteArray
+ // that is destroyed before the function returns.
+ QByteArray errorMessage;
+ };
+
+ class MnemonicKeySimulator
+ {
+ Q_DISABLE_COPY(MnemonicKeySimulator)
+ public:
+ explicit MnemonicKeySimulator(QWindow *window);
+
+ void press(Qt::Key key);
+ void release(Qt::Key key);
+ void click(Qt::Key key);
+
+ private:
+ QPointer<QWindow> m_window;
+ Qt::KeyboardModifiers m_modifiers;
+ };
}
-#endif // QQUICKVISUALTESTUTIL_H
+#define QQUICK_VERIFY_POLISH(item) \
+ QTRY_COMPARE(QQuickItemPrivate::get(item)->polishScheduled, false)
+
+QT_END_NAMESPACE
+
+#endif // QQUICKVISUALTESTUTILS_P_H
diff --git a/sync.profile b/sync.profile
index 0d34014e21..362332c63d 100644
--- a/sync.profile
+++ b/sync.profile
@@ -6,6 +6,7 @@
"QtQuickWidgets" => "$basedir/src/quickwidgets",
"QtQuickParticles" => "$basedir/src/particles",
"QtQuickTest" => "$basedir/src/qmltest",
+ "QtQuickTestUtils" => "$basedir/src/quicktestutils",
"QtPacketProtocol" => "$basedir/src/plugins/qmltooling/packetprotocol",
"QtQmlDebug" => "$basedir/src/qmldebug",
"QtQmlModels" => "$basedir/src/qmlmodels",
@@ -23,6 +24,7 @@
"QtQmlXmlListModel" => "$basedir/src/qmlxmllistmodel",
"QtQuickControls2" => "$basedir/src/quickcontrols2",
"QtQuickControls2Impl" => "$basedir/src/quickcontrols2impl",
+ "QtQuickControlsTestUtils" => "$basedir/src/quickcontrolstestutils",
"QtQuickDialogs2" => "$basedir/src/quickdialogs2/quickdialogs2",
"QtQuickDialogs2Utils" => "$basedir/src/quickdialogs2/quickdialogs2utils",
"QtQuickDialogs2QuickImpl" => "$basedir/src/quickdialogs2/quickdialogs2quickimpl",
diff --git a/tests/auto/cmake/test_import_static_shapes_plugin_resources/CMakeLists.txt b/tests/auto/cmake/test_import_static_shapes_plugin_resources/CMakeLists.txt
index ae32ff6dbb..052c4f1eec 100644
--- a/tests/auto/cmake/test_import_static_shapes_plugin_resources/CMakeLists.txt
+++ b/tests/auto/cmake/test_import_static_shapes_plugin_resources/CMakeLists.txt
@@ -6,18 +6,18 @@ enable_testing()
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-find_package(Qt6 COMPONENTS REQUIRED Quick Test)
+find_package(Qt6 COMPONENTS REQUIRED Quick Test QuickTestUtilsPrivate)
function(create_test_executable target)
qt_add_executable(${target}
MANUAL_FINALIZATION
tst_main.cpp
- ../../quick/shared/viewtestutil.cpp ../../quick/shared/viewtestutil.h
)
target_link_libraries(${target} PRIVATE
Qt::Qml
Qt::Quick
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
Qt::Test
)
diff --git a/tests/auto/cmake/test_import_static_shapes_plugin_resources/tst_main.cpp b/tests/auto/cmake/test_import_static_shapes_plugin_resources/tst_main.cpp
index bc740a5e65..ab05da961f 100644
--- a/tests/auto/cmake/test_import_static_shapes_plugin_resources/tst_main.cpp
+++ b/tests/auto/cmake/test_import_static_shapes_plugin_resources/tst_main.cpp
@@ -56,7 +56,7 @@
#include <QtQuick/QQuickView>
#include <QtTest/QTest>
-#include "../../quick/shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
static bool gotShaderErrorMessage = false;
QtMessageHandler oldHandler = nullptr;
diff --git a/tests/auto/particles/qquickage/CMakeLists.txt b/tests/auto/particles/qquickage/CMakeLists.txt
index ef1cb8fe45..82e5481a28 100644
--- a/tests/auto/particles/qquickage/CMakeLists.txt
+++ b/tests/auto/particles/qquickage/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickage
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickage.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickage
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickage/tst_qquickage.cpp b/tests/auto/particles/qquickage/tst_qquickage.cpp
index 3a2d4e3927..2b9916d46c 100644
--- a/tests/auto/particles/qquickage/tst_qquickage.cpp
+++ b/tests/auto/particles/qquickage/tst_qquickage.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickage : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickage() {}
+ tst_qquickage() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickangleddirection/CMakeLists.txt b/tests/auto/particles/qquickangleddirection/CMakeLists.txt
index a60dfa8d6b..6e6a5b42e9 100644
--- a/tests/auto/particles/qquickangleddirection/CMakeLists.txt
+++ b/tests/auto/particles/qquickangleddirection/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickangleddirection
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickangleddirection.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickangleddirection
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickangleddirection/tst_qquickangleddirection.cpp b/tests/auto/particles/qquickangleddirection/tst_qquickangleddirection.cpp
index 6186dc97de..66a39c1357 100644
--- a/tests/auto/particles/qquickangleddirection/tst_qquickangleddirection.cpp
+++ b/tests/auto/particles/qquickangleddirection/tst_qquickangleddirection.cpp
@@ -31,14 +31,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickangleddirection : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickangleddirection() {}
+ tst_qquickangleddirection() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickcumulativedirection/CMakeLists.txt b/tests/auto/particles/qquickcumulativedirection/CMakeLists.txt
index 0eecede9a5..4a81fb010c 100644
--- a/tests/auto/particles/qquickcumulativedirection/CMakeLists.txt
+++ b/tests/auto/particles/qquickcumulativedirection/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickcumulativedirection
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickcumulativedirection.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickcumulativedirection
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickcumulativedirection/tst_qquickcumulativedirection.cpp b/tests/auto/particles/qquickcumulativedirection/tst_qquickcumulativedirection.cpp
index c5c4bbb897..011ccf1ae7 100644
--- a/tests/auto/particles/qquickcumulativedirection/tst_qquickcumulativedirection.cpp
+++ b/tests/auto/particles/qquickcumulativedirection/tst_qquickcumulativedirection.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickcumulativedirection : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickcumulativedirection() {}
+ tst_qquickcumulativedirection() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickcustomaffector/CMakeLists.txt b/tests/auto/particles/qquickcustomaffector/CMakeLists.txt
index 7b09402ea4..f89bce3be0 100644
--- a/tests/auto/particles/qquickcustomaffector/CMakeLists.txt
+++ b/tests/auto/particles/qquickcustomaffector/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickcustomaffector
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickcustomaffector.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickcustomaffector
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp b/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp
index 213768bbb6..c912c82650 100644
--- a/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp
+++ b/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickcustomaffector : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickcustomaffector() {}
+ tst_qquickcustomaffector() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickellipseextruder/CMakeLists.txt b/tests/auto/particles/qquickellipseextruder/CMakeLists.txt
index 4d432f78d0..33126d1541 100644
--- a/tests/auto/particles/qquickellipseextruder/CMakeLists.txt
+++ b/tests/auto/particles/qquickellipseextruder/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickellipseextruder
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickellipseextruder.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickellipseextruder
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickellipseextruder/tst_qquickellipseextruder.cpp b/tests/auto/particles/qquickellipseextruder/tst_qquickellipseextruder.cpp
index ec1659d486..56e3c457af 100644
--- a/tests/auto/particles/qquickellipseextruder/tst_qquickellipseextruder.cpp
+++ b/tests/auto/particles/qquickellipseextruder/tst_qquickellipseextruder.cpp
@@ -31,14 +31,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickellipseextruder : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickellipseextruder() {}
+ tst_qquickellipseextruder() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickfriction/CMakeLists.txt b/tests/auto/particles/qquickfriction/CMakeLists.txt
index 5e7e270d69..3883a1dba3 100644
--- a/tests/auto/particles/qquickfriction/CMakeLists.txt
+++ b/tests/auto/particles/qquickfriction/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickfriction
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickfriction.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickfriction
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickfriction/tst_qquickfriction.cpp b/tests/auto/particles/qquickfriction/tst_qquickfriction.cpp
index de535118f4..b840828fcd 100644
--- a/tests/auto/particles/qquickfriction/tst_qquickfriction.cpp
+++ b/tests/auto/particles/qquickfriction/tst_qquickfriction.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickfriction : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickfriction() {}
+ tst_qquickfriction() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickgravity/CMakeLists.txt b/tests/auto/particles/qquickgravity/CMakeLists.txt
index e555dd9f80..315c2b2129 100644
--- a/tests/auto/particles/qquickgravity/CMakeLists.txt
+++ b/tests/auto/particles/qquickgravity/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickgravity
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickgravity.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickgravity
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickgravity/tst_qquickgravity.cpp b/tests/auto/particles/qquickgravity/tst_qquickgravity.cpp
index dcc0c017e8..27e30e68df 100644
--- a/tests/auto/particles/qquickgravity/tst_qquickgravity.cpp
+++ b/tests/auto/particles/qquickgravity/tst_qquickgravity.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickgravity : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickgravity() {}
+ tst_qquickgravity() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickgroupgoal/CMakeLists.txt b/tests/auto/particles/qquickgroupgoal/CMakeLists.txt
index dbacb28d29..410189917b 100644
--- a/tests/auto/particles/qquickgroupgoal/CMakeLists.txt
+++ b/tests/auto/particles/qquickgroupgoal/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickgroupgoal
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickgroupgoal.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickgroupgoal
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickgroupgoal/tst_qquickgroupgoal.cpp b/tests/auto/particles/qquickgroupgoal/tst_qquickgroupgoal.cpp
index 6ede0eb968..86a63b1cfb 100644
--- a/tests/auto/particles/qquickgroupgoal/tst_qquickgroupgoal.cpp
+++ b/tests/auto/particles/qquickgroupgoal/tst_qquickgroupgoal.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickgroupgoal : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickgroupgoal() {}
+ tst_qquickgroupgoal() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickimageparticle/CMakeLists.txt b/tests/auto/particles/qquickimageparticle/CMakeLists.txt
index 03f6ea0ef8..e9e129e5c4 100644
--- a/tests/auto/particles/qquickimageparticle/CMakeLists.txt
+++ b/tests/auto/particles/qquickimageparticle/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickimageparticle
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickimageparticle.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickimageparticle
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickimageparticle/tst_qquickimageparticle.cpp b/tests/auto/particles/qquickimageparticle/tst_qquickimageparticle.cpp
index 32a8a9435c..6f48cb85bd 100644
--- a/tests/auto/particles/qquickimageparticle/tst_qquickimageparticle.cpp
+++ b/tests/auto/particles/qquickimageparticle/tst_qquickimageparticle.cpp
@@ -30,8 +30,7 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
const double CONV_FACTOR = 0.017453292519943295;//Degrees to radians
@@ -39,7 +38,7 @@ class tst_qquickimageparticle : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickimageparticle() {}
+ tst_qquickimageparticle() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
~tst_qquickimageparticle();
private slots:
diff --git a/tests/auto/particles/qquickitemparticle/CMakeLists.txt b/tests/auto/particles/qquickitemparticle/CMakeLists.txt
index ff695eb8af..c76cc1cd67 100644
--- a/tests/auto/particles/qquickitemparticle/CMakeLists.txt
+++ b/tests/auto/particles/qquickitemparticle/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickitemparticle
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickitemparticle.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickitemparticle
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp b/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
index 32fe1a63c4..57e2e324c4 100644
--- a/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
+++ b/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
@@ -32,14 +32,13 @@
#include <private/qquickparticleemitter_p.h>
#include <private/qquickimage_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickitemparticle : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickitemparticle() {}
+ tst_qquickitemparticle() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquicklineextruder/CMakeLists.txt b/tests/auto/particles/qquicklineextruder/CMakeLists.txt
index d7791103be..2de4abfa87 100644
--- a/tests/auto/particles/qquicklineextruder/CMakeLists.txt
+++ b/tests/auto/particles/qquicklineextruder/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicklineextruder
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquicklineextruder.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquicklineextruder
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquicklineextruder/tst_qquicklineextruder.cpp b/tests/auto/particles/qquicklineextruder/tst_qquicklineextruder.cpp
index cfab3f8aee..f1e21ec98c 100644
--- a/tests/auto/particles/qquicklineextruder/tst_qquicklineextruder.cpp
+++ b/tests/auto/particles/qquicklineextruder/tst_qquicklineextruder.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquicklineextruder : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquicklineextruder() {}
+ tst_qquicklineextruder() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickmaskextruder/CMakeLists.txt b/tests/auto/particles/qquickmaskextruder/CMakeLists.txt
index 0ea7f18f6d..35926389c4 100644
--- a/tests/auto/particles/qquickmaskextruder/CMakeLists.txt
+++ b/tests/auto/particles/qquickmaskextruder/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickmaskextruder
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickmaskextruder.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickmaskextruder
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickmaskextruder/tst_qquickmaskextruder.cpp b/tests/auto/particles/qquickmaskextruder/tst_qquickmaskextruder.cpp
index 8a80a93e3e..ec138809cf 100644
--- a/tests/auto/particles/qquickmaskextruder/tst_qquickmaskextruder.cpp
+++ b/tests/auto/particles/qquickmaskextruder/tst_qquickmaskextruder.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickmaskextruder : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickmaskextruder() {}
+ tst_qquickmaskextruder() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickparticlegroup/CMakeLists.txt b/tests/auto/particles/qquickparticlegroup/CMakeLists.txt
index 4d335b18d0..2f8d5e87de 100644
--- a/tests/auto/particles/qquickparticlegroup/CMakeLists.txt
+++ b/tests/auto/particles/qquickparticlegroup/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickparticlegroup
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickparticlegroup.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickparticlegroup
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickparticlegroup/tst_qquickparticlegroup.cpp b/tests/auto/particles/qquickparticlegroup/tst_qquickparticlegroup.cpp
index 8dcce6a73c..2e688fc625 100644
--- a/tests/auto/particles/qquickparticlegroup/tst_qquickparticlegroup.cpp
+++ b/tests/auto/particles/qquickparticlegroup/tst_qquickparticlegroup.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickparticlegroup : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickparticlegroup() {}
+ tst_qquickparticlegroup() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickparticlesystem/CMakeLists.txt b/tests/auto/particles/qquickparticlesystem/CMakeLists.txt
index 984a7350f0..1cc7dede47 100644
--- a/tests/auto/particles/qquickparticlesystem/CMakeLists.txt
+++ b/tests/auto/particles/qquickparticlesystem/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickparticlesystem
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickparticlesystem.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickparticlesystem
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp b/tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp
index 705e47230c..00ab7bd044 100644
--- a/tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp
+++ b/tests/auto/particles/qquickparticlesystem/tst_qquickparticlesystem.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickparticlesystem : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickparticlesystem() {}
+ tst_qquickparticlesystem() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickpointattractor/CMakeLists.txt b/tests/auto/particles/qquickpointattractor/CMakeLists.txt
index 6dfdc085af..e43159edb7 100644
--- a/tests/auto/particles/qquickpointattractor/CMakeLists.txt
+++ b/tests/auto/particles/qquickpointattractor/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpointattractor
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickpointattractor.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickpointattractor
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickpointattractor/tst_qquickpointattractor.cpp b/tests/auto/particles/qquickpointattractor/tst_qquickpointattractor.cpp
index 8e63c1802b..3630371de5 100644
--- a/tests/auto/particles/qquickpointattractor/tst_qquickpointattractor.cpp
+++ b/tests/auto/particles/qquickpointattractor/tst_qquickpointattractor.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickpointattractor : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickpointattractor() {}
+ tst_qquickpointattractor() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickpointdirection/CMakeLists.txt b/tests/auto/particles/qquickpointdirection/CMakeLists.txt
index 73867c74bb..ccc31b2c1d 100644
--- a/tests/auto/particles/qquickpointdirection/CMakeLists.txt
+++ b/tests/auto/particles/qquickpointdirection/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpointdirection
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickpointdirection.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickpointdirection
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickpointdirection/tst_qquickpointdirection.cpp b/tests/auto/particles/qquickpointdirection/tst_qquickpointdirection.cpp
index ae5bfe406a..ae8860fcf7 100644
--- a/tests/auto/particles/qquickpointdirection/tst_qquickpointdirection.cpp
+++ b/tests/auto/particles/qquickpointdirection/tst_qquickpointdirection.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickpointdirection : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickpointdirection() {}
+ tst_qquickpointdirection() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickrectangleextruder/CMakeLists.txt b/tests/auto/particles/qquickrectangleextruder/CMakeLists.txt
index 9e48fd6d93..52c87db86d 100644
--- a/tests/auto/particles/qquickrectangleextruder/CMakeLists.txt
+++ b/tests/auto/particles/qquickrectangleextruder/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickrectangleextruder
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickrectangleextruder.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickrectangleextruder
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickrectangleextruder/tst_qquickrectangleextruder.cpp b/tests/auto/particles/qquickrectangleextruder/tst_qquickrectangleextruder.cpp
index 6447523cd1..d95c4bc464 100644
--- a/tests/auto/particles/qquickrectangleextruder/tst_qquickrectangleextruder.cpp
+++ b/tests/auto/particles/qquickrectangleextruder/tst_qquickrectangleextruder.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickrectangleextruder : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickrectangleextruder() {}
+ tst_qquickrectangleextruder() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickspritegoal/CMakeLists.txt b/tests/auto/particles/qquickspritegoal/CMakeLists.txt
index 0f87615bb0..6735817e35 100644
--- a/tests/auto/particles/qquickspritegoal/CMakeLists.txt
+++ b/tests/auto/particles/qquickspritegoal/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickspritegoal
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickspritegoal.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickspritegoal
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickspritegoal/tst_qquickspritegoal.cpp b/tests/auto/particles/qquickspritegoal/tst_qquickspritegoal.cpp
index 4f803b9b64..43fb3bafe7 100644
--- a/tests/auto/particles/qquickspritegoal/tst_qquickspritegoal.cpp
+++ b/tests/auto/particles/qquickspritegoal/tst_qquickspritegoal.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickspritegoal : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickspritegoal() {}
+ tst_qquickspritegoal() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquicktargetdirection/CMakeLists.txt b/tests/auto/particles/qquicktargetdirection/CMakeLists.txt
index 1bb462af66..bd6526c83b 100644
--- a/tests/auto/particles/qquicktargetdirection/CMakeLists.txt
+++ b/tests/auto/particles/qquicktargetdirection/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktargetdirection
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquicktargetdirection.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquicktargetdirection
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquicktargetdirection/tst_qquicktargetdirection.cpp b/tests/auto/particles/qquicktargetdirection/tst_qquicktargetdirection.cpp
index a96c6e15ef..7f9bc0815a 100644
--- a/tests/auto/particles/qquicktargetdirection/tst_qquicktargetdirection.cpp
+++ b/tests/auto/particles/qquicktargetdirection/tst_qquicktargetdirection.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquicktargetdirection : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquicktargetdirection() {}
+ tst_qquicktargetdirection() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquicktrailemitter/CMakeLists.txt b/tests/auto/particles/qquicktrailemitter/CMakeLists.txt
index e7eb6ab607..97065a258e 100644
--- a/tests/auto/particles/qquicktrailemitter/CMakeLists.txt
+++ b/tests/auto/particles/qquicktrailemitter/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktrailemitter
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquicktrailemitter.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquicktrailemitter
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquicktrailemitter/tst_qquicktrailemitter.cpp b/tests/auto/particles/qquicktrailemitter/tst_qquicktrailemitter.cpp
index a6b73e4f1d..9fce9a5b29 100644
--- a/tests/auto/particles/qquicktrailemitter/tst_qquicktrailemitter.cpp
+++ b/tests/auto/particles/qquicktrailemitter/tst_qquicktrailemitter.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquicktrailemitter : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquicktrailemitter() {}
+ tst_qquicktrailemitter() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickturbulence/CMakeLists.txt b/tests/auto/particles/qquickturbulence/CMakeLists.txt
index 166649214c..f538c04829 100644
--- a/tests/auto/particles/qquickturbulence/CMakeLists.txt
+++ b/tests/auto/particles/qquickturbulence/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickturbulence
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickturbulence.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickturbulence
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickturbulence/tst_qquickturbulence.cpp b/tests/auto/particles/qquickturbulence/tst_qquickturbulence.cpp
index 69d47ffa1f..597b0dddaa 100644
--- a/tests/auto/particles/qquickturbulence/tst_qquickturbulence.cpp
+++ b/tests/auto/particles/qquickturbulence/tst_qquickturbulence.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickturbulence : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickturbulence() {}
+ tst_qquickturbulence() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/particles/qquickwander/CMakeLists.txt b/tests/auto/particles/qquickwander/CMakeLists.txt
index 8ce66a2318..f634b8bff2 100644
--- a/tests/auto/particles/qquickwander/CMakeLists.txt
+++ b/tests/auto/particles/qquickwander/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickwander
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickwander.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickwander
Qt::QmlPrivate
Qt::QuickParticlesPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/particles/qquickwander/tst_qquickwander.cpp b/tests/auto/particles/qquickwander/tst_qquickwander.cpp
index 8df00184b4..ec45461501 100644
--- a/tests/auto/particles/qquickwander/tst_qquickwander.cpp
+++ b/tests/auto/particles/qquickwander/tst_qquickwander.cpp
@@ -30,14 +30,13 @@
#include "../shared/particlestestsshared.h"
#include <private/qquickparticlesystem_p.h>
#include <private/qabstractanimation_p.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickwander : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickwander() {}
+ tst_qquickwander() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/bindingdependencyapi/CMakeLists.txt b/tests/auto/qml/bindingdependencyapi/CMakeLists.txt
index 775160e4c5..12ca578d93 100644
--- a/tests/auto/qml/bindingdependencyapi/CMakeLists.txt
+++ b/tests/auto/qml/bindingdependencyapi/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_bindingdependencyapi
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_bindingdependencyapi.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp b/tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp
index 82c997a5b8..dfb595ffb0 100644
--- a/tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp
+++ b/tests/auto/qml/bindingdependencyapi/tst_bindingdependencyapi.cpp
@@ -32,7 +32,6 @@
#include <private/qqmlbinding_p.h>
#include <QtQuick/private/qquicktext_p.h>
#include <QtQuick/private/qquickrectangle_p.h>
-#include "../../shared/util.h"
#include <qqmlcontext.h>
class tst_bindingdependencyapi : public QObject
diff --git a/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt b/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt
index 3ad886b0ad..f6c4af80d1 100644
--- a/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt
@@ -12,19 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qdebugmessageservice
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qdebugmessageservice.cpp
- INCLUDE_DIRECTORIES
- ../../../shared
- ../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::Network
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
index ecee0db428..d0aeefdacc 100644
--- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
+++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
@@ -27,7 +27,7 @@
****************************************************************************/
//QQmlDebugTest
-#include "debugutil_p.h"
+#include "../shared/debugutil_p.h"
#include <private/qqmldebugclient_p.h>
#include <private/qqmldebugconnection_p.h>
@@ -44,6 +44,9 @@ class tst_QDebugMessageService : public QQmlDebugTest
{
Q_OBJECT
+public:
+ tst_QDebugMessageService();
+
private slots:
void retrieveDebugOutput();
@@ -133,6 +136,11 @@ QList<QQmlDebugClient *> tst_QDebugMessageService::createClients()
return QList<QQmlDebugClient *>({m_client});
}
+tst_QDebugMessageService::tst_QDebugMessageService()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QDebugMessageService::retrieveDebugOutput()
{
QCOMPARE(QQmlDebugTest::connectTo(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qml",
diff --git a/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt b/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt
index 3ab44c2670..28708ff48b 100644
--- a/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt
@@ -6,12 +6,10 @@
qt_internal_add_test(tst_qpacketprotocol
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qpacketprotocol.cpp
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
@@ -19,6 +17,7 @@ qt_internal_add_test(tst_qpacketprotocol
Qt::GuiPrivate
Qt::Network
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
)
## Scopes:
diff --git a/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt
index 86009707a9..50089a4d57 100644
--- a/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt
@@ -6,7 +6,6 @@
qt_internal_add_test(tst_qqmldebugclient
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
../shared/qqmldebugtestservice.cpp ../shared/qqmldebugtestservice.h
@@ -15,7 +14,6 @@ qt_internal_add_test(tst_qqmldebugclient
QT_QML_DEBUG
QT_QML_DEBUG_NO_WARNING
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
@@ -23,6 +21,7 @@ qt_internal_add_test(tst_qqmldebugclient
Qt::GuiPrivate
Qt::QmlDebugPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
)
## Scopes:
diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt
index 8b3f0b6d5c..ae0f5f5b40 100644
--- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt
@@ -6,12 +6,10 @@
qt_internal_add_test(tst_qqmldebuggingenabler
SOURCES
- ../../../../shared/util.cpp ../../../../shared/util.h
../../shared/debugutil.cpp ../../shared/debugutil_p.h
../../shared/qqmldebugprocess.cpp ../../shared/qqmldebugprocess_p.h
tst_qqmldebuggingenabler.cpp
INCLUDE_DIRECTORIES
- ../../../../shared
../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
@@ -19,6 +17,7 @@ qt_internal_add_test(tst_qqmldebuggingenabler
Qt::GuiPrivate
Qt::Qml
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
)
#### Keys ignored in scope 1:.:.:qqmldebuggingenabler.pro:<TRUE>:
diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
index a22ae6e7a0..163a9e2e7e 100644
--- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
+++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
@@ -28,7 +28,7 @@
#include "debugutil_p.h"
#include "qqmldebugprocess_p.h"
-#include "../../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmldebugclient_p.h>
#include <private/qqmldebugconnection_p.h>
@@ -47,6 +47,9 @@ class tst_QQmlDebuggingEnabler : public QQmlDebugTest
{
Q_OBJECT
+public:
+ tst_QQmlDebuggingEnabler();
+
private slots:
void qmlscene_data();
void qmlscene();
@@ -91,6 +94,11 @@ void tst_QQmlDebuggingEnabler::data()
}
}
+tst_QQmlDebuggingEnabler::tst_QQmlDebuggingEnabler()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQmlDebuggingEnabler::qmlscene_data()
{
data();
diff --git a/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt
index 99a885589e..8741902c8e 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt
@@ -12,18 +12,17 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmldebugjs
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmldebugjs.cpp
INCLUDE_DIRECTORIES
- ../../../shared
- ../shared ../shared
+ ../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
index 41c0c5ec00..82f76ca30d 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
+++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
@@ -28,7 +28,7 @@
#include "debugutil_p.h"
#include "qqmldebugprocess_p.h"
-#include "../../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmlenginedebugclient_p.h>
#include <private/qv4debugclient_p.h>
@@ -82,6 +82,9 @@ class tst_QQmlDebugJS : public QQmlDebugTest
{
Q_OBJECT
+public:
+ tst_QQmlDebugJS();
+
private slots:
void initTestCase() override;
@@ -175,6 +178,11 @@ private:
};
+tst_QQmlDebugJS::tst_QQmlDebugJS()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQmlDebugJS::initTestCase()
{
QQmlDebugTest::initTestCase();
diff --git a/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt
index 80836f5f6a..0458b076dc 100644
--- a/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt
@@ -6,7 +6,6 @@
qt_internal_add_test(tst_qqmldebuglocal
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
../shared/qqmldebugtestservice.cpp ../shared/qqmldebugtestservice.h
@@ -14,7 +13,6 @@ qt_internal_add_test(tst_qqmldebuglocal
DEFINES
QT_QML_DEBUG_NO_WARNING
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
@@ -22,6 +20,7 @@ qt_internal_add_test(tst_qqmldebuglocal
Qt::GuiPrivate
Qt::QmlDebugPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
)
## Scopes:
diff --git a/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt
index 7434dc4286..1642c71d93 100644
--- a/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt
@@ -12,7 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmldebugservice
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
../shared/qqmldebugtestservice.cpp ../shared/qqmldebugtestservice.h
@@ -20,7 +19,6 @@ qt_internal_add_test(tst_qqmldebugservice
DEFINES
QT_QML_DEBUG_NO_WARNING
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
@@ -28,6 +26,7 @@ qt_internal_add_test(tst_qqmldebugservice
Qt::GuiPrivate
Qt::QmlDebugPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
index b90844bd10..d36ae80aa5 100644
--- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
@@ -30,7 +30,7 @@
#include "qqmldebugtestservice.h"
#include "debugutil_p.h"
#include "qqmldebugprocess_p.h"
-#include "../../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmldebugclient_p.h>
#include <private/qqmldebugconnection_p.h>
@@ -51,6 +51,9 @@
class tst_QQmlDebugService : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQmlDebugService();
+
private:
QQmlDebugConnection *m_conn;
QQmlDebugTestService *m_service;
@@ -69,6 +72,11 @@ private slots:
void checkSupportForOldDataStreamVersion();
};
+tst_QQmlDebugService::tst_QQmlDebugService()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQmlDebugService::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt
index 8d7a9b38c2..699a6adc7e 100644
--- a/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt
@@ -10,13 +10,11 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmldebugtranslationclient
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmldebugtranslationclient.cpp
INCLUDE_DIRECTORIES
../../../../../src/plugins/qmltooling/qmldbg_preview
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::QuickPrivate
@@ -25,6 +23,7 @@ qt_internal_add_test(tst_qqmldebugtranslationclient
Qt::GuiPrivate
Qt::Network
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp b/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp
index 7bdf4a02f1..21c6b622f2 100644
--- a/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp
+++ b/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp
@@ -54,6 +54,10 @@ class tst_QQmlDebugTranslationClient : public QQmlDebugTest
{
Q_OBJECT
public:
+ tst_QQmlDebugTranslationClient()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+ {
+ }
private slots:
void init()
diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt
index 6c6ddcfb62..ae112c7c94 100644
--- a/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt
@@ -10,7 +10,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmldebugtranslationservice
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmldebugtranslationservice.cpp
@@ -18,7 +17,6 @@ qt_internal_add_test(tst_qqmldebugtranslationservice
QT_QML_DEBUG
INCLUDE_DIRECTORIES
../../../../../src/plugins/qmltooling/qmldbg_preview
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::Quick
@@ -29,6 +27,7 @@ qt_internal_add_test(tst_qqmldebugtranslationservice
Qt::Network
Qt::Qml
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp b/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp
index 78036f37d3..4226a3468e 100644
--- a/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp
+++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp
@@ -61,6 +61,7 @@ class tst_QQmlDebugTranslationService : public QQmlDebugTest
Q_OBJECT
public:
tst_QQmlDebugTranslationService()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt
index 63eda146ea..faa80f16e4 100644
--- a/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt
@@ -12,18 +12,17 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlenginecontrol
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmlenginecontrol.cpp
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
index 05abab737e..b209a9e059 100644
--- a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
+++ b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
@@ -27,7 +27,7 @@
****************************************************************************/
#include "debugutil_p.h"
-#include "../../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmldebugclient_p.h>
#include <private/qqmldebugconnection_p.h>
@@ -47,7 +47,8 @@ public slots:
void blockEngine(int engineId, const QString &name);
};
-QQmlEngineBlocker::QQmlEngineBlocker(QQmlEngineControlClient *parent): QObject(parent)
+QQmlEngineBlocker::QQmlEngineBlocker(QQmlEngineControlClient *parent)
+ : QObject(parent)
{
connect(parent, &QQmlEngineControlClient::engineAboutToBeAdded,
this, &QQmlEngineBlocker::blockEngine);
@@ -65,6 +66,9 @@ class tst_QQmlEngineControl : public QQmlDebugTest
{
Q_OBJECT
+public:
+ tst_QQmlEngineControl();
+
private:
ConnectResult connectTo(const QString &testFile, bool restrictServices);
QList<QQmlDebugClient *> createClients() override;
@@ -79,6 +83,11 @@ private slots:
void stopEngine();
};
+tst_QQmlEngineControl::tst_QQmlEngineControl()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+{
+}
+
QQmlDebugTest::ConnectResult tst_QQmlEngineControl::connectTo(const QString &file,
bool restrictServices)
{
diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt
index e2553e1abc..f48c9a942b 100644
--- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt
@@ -12,18 +12,17 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlenginedebuginspectorintegration
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmlenginedebuginspectorintegration.cpp
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
index 34c6faf4ae..094d3daeb4 100644
--- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
@@ -27,7 +27,7 @@
****************************************************************************/
#include "../shared/debugutil_p.h"
-#include "../../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmldebugconnection_p.h>
#include <private/qqmlenginedebugclient_p.h>
@@ -45,6 +45,9 @@ class tst_QQmlEngineDebugInspectorIntegration : public QQmlDebugTest
{
Q_OBJECT
+public:
+ tst_QQmlEngineDebugInspectorIntegration();
+
private:
ConnectResult init(bool restrictServices);
QList<QQmlDebugClient *> createClients() override;
@@ -85,6 +88,11 @@ QQmlEngineDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRoot
return m_engineDebugClient->object();
}
+tst_QQmlEngineDebugInspectorIntegration::tst_QQmlEngineDebugInspectorIntegration()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+{
+}
+
QQmlDebugTest::ConnectResult tst_QQmlEngineDebugInspectorIntegration::init(bool restrictServices)
{
return QQmlDebugTest::connectTo(
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt
index 4c3b449cb4..9afe16c4ad 100644
--- a/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt
@@ -6,20 +6,19 @@
qt_internal_add_test(tst_qqmlenginedebugservice
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmlenginedebugservice.cpp
DEFINES
QT_QML_DEBUG_NO_WARNING
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::QmlDebugPrivate
Qt::QmlPrivate
Qt::Quick
+ Qt::QuickTestUtilsPrivate
)
## Scopes:
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
index a87a77180f..461c49c7cc 100644
--- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
@@ -27,7 +27,7 @@
****************************************************************************/
#include "debugutil_p.h"
-#include "../../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmlbinding_p.h>
#include <private/qqmlboundsignal_p.h>
@@ -123,7 +123,11 @@ class tst_QQmlEngineDebugService : public QObject
{
Q_OBJECT
public:
- tst_QQmlEngineDebugService() : m_conn(nullptr), m_dbg(nullptr), m_engine(nullptr), m_rootItem(nullptr) {}
+ tst_QQmlEngineDebugService()
+ : m_conn(nullptr)
+ , m_dbg(nullptr)
+ , m_engine(nullptr)
+ , m_rootItem(nullptr) {}
private:
QQmlEngineDebugObjectReference findRootObject(int context = 0,
diff --git a/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt b/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt
index 3303c7d110..4c5ae11084 100644
--- a/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt
@@ -12,18 +12,17 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlinspector
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmlinspector.cpp
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
index 1c72242703..90a10f6dcd 100644
--- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
+++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
@@ -28,7 +28,7 @@
#include "../shared/debugutil_p.h"
#include "../shared/qqmldebugprocess_p.h"
-#include "../../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmldebugconnection_p.h>
#include <private/qqmlinspectorclient_p.h>
@@ -45,6 +45,9 @@ class tst_QQmlInspector : public QQmlDebugTest
{
Q_OBJECT
+public:
+ tst_QQmlInspector();
+
private:
ConnectResult startQmlProcess(const QString &qmlFile, bool restrictMode = true);
void checkAnimationSpeed(int targetMillisPerDegree);
@@ -61,6 +64,11 @@ private slots:
void showAppOnTop();
};
+tst_QQmlInspector::tst_QQmlInspector()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+{
+}
+
QQmlDebugTest::ConnectResult tst_QQmlInspector::startQmlProcess(const QString &qmlFile,
bool restrictServices)
{
diff --git a/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt b/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt
index aef78fe28e..2672d0d008 100644
--- a/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt
@@ -15,18 +15,17 @@ list(APPEND test_data "data/zoom.qml")
qt_internal_add_test(tst_qqmlpreview
SOURCES
../../../../../src/plugins/qmltooling/qmldbg_preview/qqmlpreviewblacklist.cpp ../../../../../src/plugins/qmltooling/qmldbg_preview/qqmlpreviewblacklist.h
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmlpreview.cpp
INCLUDE_DIRECTORIES
../../../../../src/plugins/qmltooling/qmldbg_preview
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp
index 8d24c9fc52..cc48e43c08 100644
--- a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp
+++ b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp
@@ -45,6 +45,9 @@ class tst_QQmlPreview : public QQmlDebugTest
{
Q_OBJECT
+public:
+ tst_QQmlPreview();
+
private:
ConnectResult startQmlProcess(const QString &qmlFile);
void serveRequest(const QString &path);
@@ -71,6 +74,11 @@ private slots:
void fps();
};
+tst_QQmlPreview::tst_QQmlPreview()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+{
+}
+
QQmlDebugTest::ConnectResult tst_QQmlPreview::startQmlProcess(const QString &qmlFile)
{
return QQmlDebugTest::connectTo(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qml",
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt
index 394e4aa08d..3d57619bbb 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt
@@ -12,17 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlprofilerservice
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
../shared/debugutil.cpp ../shared/debugutil_p.h
../shared/qqmldebugprocess.cpp ../shared/qqmldebugprocess_p.h
tst_qqmlprofilerservice.cpp
INCLUDE_DIRECTORIES
- ../../../shared
../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::QmlDebugPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index 2b564e48ad..54ba3f2a27 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -28,7 +28,7 @@
#include "debugutil_p.h"
#include "qqmldebugprocess_p.h"
-#include "../../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmlprofilerclient_p.h>
#include <private/qqmldebugconnection_p.h>
@@ -45,8 +45,8 @@ class QQmlProfilerTestClient : public QQmlProfilerEventReceiver
Q_OBJECT
public:
- QQmlProfilerTestClient(QQmlDebugConnection *connection) :
- client(new QQmlProfilerClient(connection, this))
+ QQmlProfilerTestClient(QQmlDebugConnection *connection)
+ : client(new QQmlProfilerClient(connection, this))
{
connect(client.data(), &QQmlProfilerClient::traceStarted,
this, &QQmlProfilerTestClient::startTrace);
@@ -180,6 +180,9 @@ class tst_QQmlProfilerService : public QQmlDebugTest
{
Q_OBJECT
+public:
+ tst_QQmlProfilerService();
+
private:
enum MessageListType {
MessageListQML,
@@ -246,6 +249,11 @@ private:
#define VERIFY(type, position, expected, checks, numbers) \
QVERIFY(verify(type, position, expected, checks, numbers))
+tst_QQmlProfilerService::tst_QQmlProfilerService()
+ : QQmlDebugTest(QT_QMLTEST_DATADIR)
+{
+}
+
QQmlDebugTest::ConnectResult tst_QQmlProfilerService::connectTo(
bool block, const QString &file, bool recordFromStart, uint flushInterval,
bool restrictServices, const QString &executable)
diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp
index 3787f34bc2..4598e288c7 100644
--- a/tests/auto/qml/debugger/shared/debugutil.cpp
+++ b/tests/auto/qml/debugger/shared/debugutil.cpp
@@ -34,6 +34,11 @@
#include <QtCore/qeventloop.h>
#include <QtCore/qtimer.h>
+QQmlDebugTest::QQmlDebugTest(const char *qmlTestDataDir)
+ : QQmlDataTest(qmlTestDataDir)
+{
+}
+
bool QQmlDebugTest::waitForSignal(QObject *receiver, const char *member, int timeout) {
QEventLoop loop;
QTimer timer;
diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h
index ad24eaa7f8..e19f59d3f2 100644
--- a/tests/auto/qml/debugger/shared/debugutil_p.h
+++ b/tests/auto/qml/debugger/shared/debugutil_p.h
@@ -40,7 +40,7 @@
// We mean it.
//
-#include <../../../shared/util.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qqmldebugclient_p.h>
class QQmlDebugProcess;
@@ -48,6 +48,9 @@ class QQmlDebugTest : public QQmlDataTest
{
Q_OBJECT
public:
+ QQmlDebugTest(const char *qmlTestDataDir);
+
+public:
static bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000);
static QList<QQmlDebugClient *> createOtherClients(QQmlDebugConnection *connection);
static QString clientStateString(const QQmlDebugClient *client);
diff --git a/tests/auto/qml/qjsonbinding/CMakeLists.txt b/tests/auto/qml/qjsonbinding/CMakeLists.txt
index 1704e4e790..b85fd7b99c 100644
--- a/tests/auto/qml/qjsonbinding/CMakeLists.txt
+++ b/tests/auto/qml/qjsonbinding/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qjsonbinding
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qjsonbinding.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Qml
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp b/tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp
index 05e1ce8b6b..b0e2c288b8 100644
--- a/tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp
+++ b/tests/auto/qml/qjsonbinding/tst_qjsonbinding.cpp
@@ -27,7 +27,7 @@
****************************************************************************/
#include <QtTest/QtTest>
#include <QtQml/QtQml>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
Q_DECLARE_METATYPE(QJsonValue::Type)
@@ -55,7 +55,7 @@ class tst_qjsonbinding : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qjsonbinding() {}
+ tst_qjsonbinding() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void cppJsConversion_data();
diff --git a/tests/auto/qml/qmlcachegen/CMakeLists.txt b/tests/auto/qml/qmlcachegen/CMakeLists.txt
index 53cd86404d..9eaa2ea642 100644
--- a/tests/auto/qml/qmlcachegen/CMakeLists.txt
+++ b/tests/auto/qml/qmlcachegen/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qmlcachegen
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qmlcachegen.cpp
scriptstringprops.h
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
index 51faab982c..a0ac891733 100644
--- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
+++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
@@ -41,13 +41,16 @@
#include <qqmlscriptstring.h>
#include <QString>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "scriptstringprops.h"
class tst_qmlcachegen: public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qmlcachegen();
+
private slots:
void initTestCase() override;
@@ -127,6 +130,11 @@ static bool generateCache(const QString &qmlFileName, QByteArray *capturedStderr
return proc.exitCode() == 0;
}
+tst_qmlcachegen::tst_qmlcachegen()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qmlcachegen::initTestCase()
{
qputenv("QML_FORCE_DISK_CACHE", "1");
diff --git a/tests/auto/qml/qmlcompiler_manual/CMakeLists.txt b/tests/auto/qml/qmlcompiler_manual/CMakeLists.txt
index ebd207e94b..f4e8197718 100644
--- a/tests/auto/qml/qmlcompiler_manual/CMakeLists.txt
+++ b/tests/auto/qml/qmlcompiler_manual/CMakeLists.txt
@@ -6,20 +6,17 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qmlcompiler_manual
SOURCES
- ../../shared/util.cpp ../../shared/util.h
testclasses.h
tst_qmlcompiler_manual.cpp
- INCLUDE_DIRECTORIES
- ../../shared
LIBRARIES
Qt::CorePrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
)
qt6_add_qml_module(tst_qmlcompiler_manual
VERSION 1.0
URI "QmltcManualTests"
- NO_CREATE_PLUGIN_TARGET
QML_FILES
${test_data}
)
diff --git a/tests/auto/qml/qmlcompiler_manual/tst_qmlcompiler_manual.cpp b/tests/auto/qml/qmlcompiler_manual/tst_qmlcompiler_manual.cpp
index ae90aaa34d..a42dc52556 100644
--- a/tests/auto/qml/qmlcompiler_manual/tst_qmlcompiler_manual.cpp
+++ b/tests/auto/qml/qmlcompiler_manual/tst_qmlcompiler_manual.cpp
@@ -38,7 +38,7 @@
#include <private/qqmlengine_p.h>
#include <private/qqmltypedata_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <array>
#include <memory>
@@ -47,6 +47,9 @@ class tst_qmlcompiler_manual : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qmlcompiler_manual();
+
private slots:
void cppBinding();
void signalHandlers();
@@ -163,6 +166,11 @@ HelloWorld::HelloWorld(QQmlEngine *e, QObject *parent)
QUrl HelloWorld::url = QUrl(); // workaround
+tst_qmlcompiler_manual::tst_qmlcompiler_manual()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qmlcompiler_manual::cppBinding()
{
QQmlEngine e;
diff --git a/tests/auto/qml/qmlformat/CMakeLists.txt b/tests/auto/qml/qmlformat/CMakeLists.txt
index 8d5133ccf7..6716a509e1 100644
--- a/tests/auto/qml/qmlformat/CMakeLists.txt
+++ b/tests/auto/qml/qmlformat/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qmlformat
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qmlformat.cpp
DEFINES
SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::TestPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp
index f9cf4deafb..65b423b919 100644
--- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp
+++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp
@@ -33,13 +33,15 @@
#include <QString>
#include <QTemporaryDir>
#include <QtTest/private/qemulationdetector_p.h>
-
-#include <util.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class TestQmlformat: public QQmlDataTest
{
Q_OBJECT
+public:
+ TestQmlformat();
+
private Q_SLOTS:
void initTestCase() override;
@@ -64,6 +66,11 @@ private:
bool isInvalidFile(const QFileInfo &fileName) const;
};
+TestQmlformat::TestQmlformat()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void TestQmlformat::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/qmlimportscanner/CMakeLists.txt b/tests/auto/qml/qmlimportscanner/CMakeLists.txt
index 28a48e2f21..7439910294 100644
--- a/tests/auto/qml/qmlimportscanner/CMakeLists.txt
+++ b/tests/auto/qml/qmlimportscanner/CMakeLists.txt
@@ -12,12 +12,10 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qmlimportscanner
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qmlimportscanner.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp
index 267a213eca..88a8163961 100644
--- a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp
+++ b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp
@@ -29,13 +29,15 @@
#include <QtTest/QtTest>
#include <QProcess>
#include <QString>
-
-#include <util.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class TestQmlimportscanner: public QQmlDataTest
{
Q_OBJECT
+public:
+ TestQmlimportscanner();
+
private Q_SLOTS:
void initTestCase() override;
@@ -52,6 +54,11 @@ private:
QString m_qmlimportscannerPath;
};
+TestQmlimportscanner::TestQmlimportscanner()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void TestQmlimportscanner::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/qmllint/CMakeLists.txt b/tests/auto/qml/qmllint/CMakeLists.txt
index c69748cc60..15549a93b7 100644
--- a/tests/auto/qml/qmllint/CMakeLists.txt
+++ b/tests/auto/qml/qmllint/CMakeLists.txt
@@ -12,12 +12,10 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qmllint
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qmllint.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index de98bbeb36..6c5c116e6f 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -30,13 +30,15 @@
#include <QtTest/QtTest>
#include <QProcess>
#include <QString>
-
-#include <util.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class TestQmllint: public QQmlDataTest
{
Q_OBJECT
+public:
+ TestQmllint();
+
private Q_SLOTS:
void initTestCase() override;
@@ -79,6 +81,11 @@ private:
QString m_qmltyperegistrarPath;
};
+TestQmllint::TestQmllint()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void TestQmllint::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/qmlplugindump/CMakeLists.txt b/tests/auto/qml/qmlplugindump/CMakeLists.txt
index 1bf13a2c02..96eea00938 100644
--- a/tests/auto/qml/qmlplugindump/CMakeLists.txt
+++ b/tests/auto/qml/qmlplugindump/CMakeLists.txt
@@ -6,15 +6,13 @@
qt_internal_add_test(tst_qmlplugindump
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qmlplugindump.cpp
DEFINES
QT_QMLTEST_DIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::GuiPrivate
Qt::Qml
+ Qt::QuickTestUtilsPrivate
)
## Scopes:
diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
index 17e67269f3..542c1974c5 100644
--- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
+++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
@@ -26,14 +26,13 @@
**
****************************************************************************/
-#include "util.h"
-
#include <qtest.h>
#include <QLibraryInfo>
#include <QDir>
#include <QProcess>
#include <QDebug>
#include <cstdlib>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qmlplugindump : public QQmlDataTest
{
@@ -56,6 +55,7 @@ private:
};
tst_qmlplugindump::tst_qmlplugindump()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/qml/qqmlanybinding/CMakeLists.txt b/tests/auto/qml/qqmlanybinding/CMakeLists.txt
index 926a230bb3..32efa891ea 100644
--- a/tests/auto/qml/qqmlanybinding/CMakeLists.txt
+++ b/tests/auto/qml/qqmlanybinding/CMakeLists.txt
@@ -10,17 +10,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlanybinding
SOURCES
- ../../shared/util.cpp ../../shared/util.h
withbindable.h
tst_qqmlanybinding.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::Network
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlanybinding/tst_qqmlanybinding.cpp b/tests/auto/qml/qqmlanybinding/tst_qqmlanybinding.cpp
index b7ea29ddd3..76f8f9e89e 100644
--- a/tests/auto/qml/qqmlanybinding/tst_qqmlanybinding.cpp
+++ b/tests/auto/qml/qqmlanybinding/tst_qqmlanybinding.cpp
@@ -25,23 +25,31 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../../shared/util.h"
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
#include <QtCore/QScopedPointer>
#include <QtQml/private/qqmlanybinding_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "withbindable.h"
class tst_qqmlanybinding : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qqmlanybinding();
+
private slots:
void basicActions_data();
void basicActions();
void unboundQQmlPropertyBindingDoesNotCrash();
};
+tst_qqmlanybinding::tst_qqmlanybinding()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qqmlanybinding::basicActions_data()
{
QTest::addColumn<QString>("fileName");
diff --git a/tests/auto/qml/qqmlapplicationengine/CMakeLists.txt b/tests/auto/qml/qqmlapplicationengine/CMakeLists.txt
index ea88b6c8e3..7f05a759b6 100644
--- a/tests/auto/qml/qqmlapplicationengine/CMakeLists.txt
+++ b/tests/auto/qml/qqmlapplicationengine/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlapplicationengine
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlapplicationengine.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
Qt::Network
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
index a35375d6f3..ed6340fd10 100644
--- a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
+++ b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
@@ -26,7 +26,6 @@
**
****************************************************************************/
-#include "../../shared/util.h"
#include <QQmlApplicationEngine>
#include <QScopedPointer>
#include <QSignalSpy>
@@ -35,12 +34,13 @@
#include <QProcess>
#endif
#include <QDebug>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlapplicationengine : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlapplicationengine() {}
+ tst_qqmlapplicationengine() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
diff --git a/tests/auto/qml/qqmlbinding/CMakeLists.txt b/tests/auto/qml/qqmlbinding/CMakeLists.txt
index eeb9f391e3..78445283e4 100644
--- a/tests/auto/qml/qqmlbinding/CMakeLists.txt
+++ b/tests/auto/qml/qqmlbinding/CMakeLists.txt
@@ -12,17 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlbinding
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlbinding.cpp
WithBindableProperties.h
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp b/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
index c0c96ca6e5..13c403f7a1 100644
--- a/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
+++ b/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
@@ -30,7 +30,7 @@
#include <QtQml/qqmlcomponent.h>
#include <private/qqmlbind_p.h>
#include <QtQuick/private/qquickrectangle_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "WithBindableProperties.h"
class tst_qqmlbinding : public QQmlDataTest
@@ -66,6 +66,7 @@ private:
};
tst_qqmlbinding::tst_qqmlbinding()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/qml/qqmlcomponent/CMakeLists.txt b/tests/auto/qml/qqmlcomponent/CMakeLists.txt
index c7dd50e8d6..7ef68135c9 100644
--- a/tests/auto/qml/qqmlcomponent/CMakeLists.txt
+++ b/tests/auto/qml/qqmlcomponent/CMakeLists.txt
@@ -12,11 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlcomponent
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlcomponent.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -24,6 +20,7 @@ qt_internal_add_test(tst_qqmlcomponent
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index a1ee52554b..fc3f384e0e 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -35,13 +35,13 @@
#include <QtQuick>
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuick/private/qquickmousearea_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#include <private/qqmlguardedcontextdata_p.h>
#include <private/qv4qmlcontext_p.h>
#include <private/qv4scopedvalue_p.h>
#include <private/qv4qmlcontext_p.h>
#include <qcolor.h>
-#include "../../shared/util.h"
-#include "testhttpserver.h"
#include <algorithm>
@@ -98,7 +98,7 @@ class tst_qqmlcomponent : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlcomponent() { engine.setIncubationController(&ic); }
+ tst_qqmlcomponent() : QQmlDataTest(QT_QMLTEST_DATADIR) { engine.setIncubationController(&ic); }
private slots:
void null();
diff --git a/tests/auto/qml/qqmlconnections/CMakeLists.txt b/tests/auto/qml/qqmlconnections/CMakeLists.txt
index fef16f58f8..3761017b60 100644
--- a/tests/auto/qml/qqmlconnections/CMakeLists.txt
+++ b/tests/auto/qml/qqmlconnections/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlconnections
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlconnections.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
index 31f000fab6..1cdf458c0d 100644
--- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
+++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
@@ -30,8 +30,8 @@
#include <QtQml/qqmlcomponent.h>
#include <private/qqmlconnections_p.h>
#include <private/qquickitem_p.h>
-#include "../../shared/util.h"
#include <QtQml/qqmlscriptstring.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlconnections : public QQmlDataTest
{
@@ -85,6 +85,7 @@ private:
};
tst_qqmlconnections::tst_qqmlconnections()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/qml/qqmlconsole/CMakeLists.txt b/tests/auto/qml/qqmlconsole/CMakeLists.txt
index 5e98ed2f31..171d1ad578 100644
--- a/tests/auto/qml/qqmlconsole/CMakeLists.txt
+++ b/tests/auto/qml/qqmlconsole/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlconsole
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlconsole.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Qml
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
index 666c97a07f..469d2fca98 100644
--- a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
+++ b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
@@ -31,13 +31,13 @@
#include <QQmlComponent>
#include <QQmlContext>
#include <QLoggingCategory>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlconsole : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlconsole() {}
+ tst_qqmlconsole() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void logging();
diff --git a/tests/auto/qml/qqmlcontext/CMakeLists.txt b/tests/auto/qml/qqmlcontext/CMakeLists.txt
index ce07e8c785..5b2c4e7a5b 100644
--- a/tests/auto/qml/qqmlcontext/CMakeLists.txt
+++ b/tests/auto/qml/qqmlcontext/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlcontext
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlcontext.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 4a850541a6..e586604862 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -37,13 +37,13 @@
#include <private/qqmlguardedcontextdata_p.h>
#include <private/qv4qmlcontext_p.h>
#include <private/qv4object_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlcontext : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlcontext() {}
+ tst_qqmlcontext() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void baseUrl();
diff --git a/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt b/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
index 9020d9e892..3cbb4540e0 100644
--- a/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
+++ b/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmldelegatemodel
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmldelegatemodel.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qqmldelegatemodel
Qt::QmlModelsPrivate
Qt::QmlPrivate
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
index 2571dadc79..01fb479e99 100644
--- a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
+++ b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
@@ -31,8 +31,7 @@
#include <QtQmlModels/private/qqmldelegatemodel_p.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/qquickitem.h>
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QQmlDelegateModel : public QQmlDataTest
{
@@ -101,6 +100,7 @@ private:
};
tst_QQmlDelegateModel::tst_QQmlDelegateModel()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qmlRegisterType<AbstractItemModel>("Test", 1, 0, "AbstractItemModel");
}
diff --git a/tests/auto/qml/qqmldirparser/CMakeLists.txt b/tests/auto/qml/qqmldirparser/CMakeLists.txt
index 255cc75c6a..f8e3e36ef7 100644
--- a/tests/auto/qml/qqmldirparser/CMakeLists.txt
+++ b/tests/auto/qml/qqmldirparser/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmldirparser
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmldirparser.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp
index 8f0c58653b..64658e8546 100644
--- a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp
+++ b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp
@@ -26,8 +26,6 @@
**
****************************************************************************/
-#include "../../shared/util.h"
-
#include <qtest.h>
#include <QObject>
#include <QQmlEngine>
@@ -35,6 +33,7 @@
#include <private/qqmljsdiagnosticmessage_p.h>
#include <private/qqmldirparser_p.h>
#include <QDebug>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <algorithm>
@@ -52,6 +51,7 @@ private slots:
};
tst_qqmldirparser::tst_qqmldirparser()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/qml/qqmlecmascript/CMakeLists.txt b/tests/auto/qml/qqmlecmascript/CMakeLists.txt
index 5c5bd528ed..70f010c082 100644
--- a/tests/auto/qml/qqmlecmascript/CMakeLists.txt
+++ b/tests/auto/qml/qqmlecmascript/CMakeLists.txt
@@ -12,18 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlecmascript
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
testtypes.cpp testtypes.h
tst_qqmlecmascript.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::Network
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index b108e9a3dc..d93e51b4f3 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -39,8 +39,6 @@
#include <private/qqmlvmemetaobject_p.h>
#include <private/qv4qmlcontext_p.h>
#include "testtypes.h"
-#include "testhttpserver.h"
-#include "../../shared/util.h"
#include <private/qv4functionobject_p.h>
#include <private/qv4scopedvalue_p.h>
#include <private/qv4jscall_p.h>
@@ -54,6 +52,8 @@
#include <private/qqmlabstractbinding_p.h>
#include <private/qqmlvaluetypeproxybinding_p.h>
#include <QtCore/private/qproperty_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#ifdef Q_CC_MSVC
#define NO_INLINE __declspec(noinline)
@@ -72,6 +72,9 @@ class tst_qqmlecmascript : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qqmlecmascript();
+
private slots:
void initTestCase() override;
void arrayIncludesValueType();
@@ -442,6 +445,11 @@ static void gc(QQmlEngine &engine)
}
+tst_qqmlecmascript::tst_qqmlecmascript()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qqmlecmascript::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/qqmlengine/CMakeLists.txt b/tests/auto/qml/qqmlengine/CMakeLists.txt
index f143dddb25..01e9999f79 100644
--- a/tests/auto/qml/qqmlengine/CMakeLists.txt
+++ b/tests/auto/qml/qqmlengine/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlengine
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlengine.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::Network
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index e74be6929c..d2ec48ffb4 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -26,7 +26,6 @@
**
****************************************************************************/
-#include "../../shared/util.h"
#include <QQmlEngine>
#include <QQmlContext>
#include <QNetworkAccessManager>
@@ -46,12 +45,13 @@
#include <private/qqmltypedata_p.h>
#include <private/qqmlcomponentattached_p.h>
#include <QQmlAbstractUrlInterceptor>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlengine : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlengine() {}
+ tst_qqmlengine() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlenginecleanup/CMakeLists.txt b/tests/auto/qml/qqmlenginecleanup/CMakeLists.txt
index f8637755b7..466f91068d 100644
--- a/tests/auto/qml/qqmlenginecleanup/CMakeLists.txt
+++ b/tests/auto/qml/qqmlenginecleanup/CMakeLists.txt
@@ -6,13 +6,11 @@
qt_internal_add_test(tst_qqmlenginecleanup
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlenginecleanup.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Qml
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
)
## Scopes:
diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
index 31a71d5e6a..d8bf86d91a 100644
--- a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
+++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
@@ -26,20 +26,20 @@
**
****************************************************************************/
-#include "../../shared/util.h"
#include <QtCore/QObject>
#include <QtQml/qqml.h>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
#include <private/qhashedstring_p.h>
#include <private/qqmlmetatype_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
//Separate test, because if engine cleanup attempts fail they can easily break unrelated tests
class tst_qqmlenginecleanup : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlenginecleanup() {}
+ tst_qqmlenginecleanup() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void test_qmlClearTypeRegistrations();
diff --git a/tests/auto/qml/qqmlerror/CMakeLists.txt b/tests/auto/qml/qqmlerror/CMakeLists.txt
index 7bb8715b01..359dd82658 100644
--- a/tests/auto/qml/qqmlerror/CMakeLists.txt
+++ b/tests/auto/qml/qqmlerror/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlerror
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlerror.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlerror/tst_qqmlerror.cpp b/tests/auto/qml/qqmlerror/tst_qqmlerror.cpp
index f282e60417..6ddf7dfe48 100644
--- a/tests/auto/qml/qqmlerror/tst_qqmlerror.cpp
+++ b/tests/auto/qml/qqmlerror/tst_qqmlerror.cpp
@@ -29,11 +29,15 @@
#include <qtest.h>
#include <QQmlError>
#include <QDebug>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlerror : public QQmlDataTest
{
Q_OBJECT
+
+public:
+ tst_qqmlerror();
+
private slots:
void url();
void description();
@@ -45,6 +49,11 @@ private slots:
void debug();
};
+tst_qqmlerror::tst_qqmlerror()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qqmlerror::url()
{
QQmlError error;
diff --git a/tests/auto/qml/qqmlexpression/CMakeLists.txt b/tests/auto/qml/qqmlexpression/CMakeLists.txt
index cc5e69d4bc..ec90797d41 100644
--- a/tests/auto/qml/qqmlexpression/CMakeLists.txt
+++ b/tests/auto/qml/qqmlexpression/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlexpression
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlexpression.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp b/tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp
index 494d5af2b8..aec1816b82 100644
--- a/tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp
+++ b/tests/auto/qml/qqmlexpression/tst_qqmlexpression.cpp
@@ -32,13 +32,13 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlexpression.h>
#include <QtQml/qqmlscriptstring.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlexpression : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlexpression() {}
+ tst_qqmlexpression() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void scriptString();
diff --git a/tests/auto/qml/qqmlfileselector/CMakeLists.txt b/tests/auto/qml/qqmlfileselector/CMakeLists.txt
index 61707f79c7..d010280a9d 100644
--- a/tests/auto/qml/qqmlfileselector/CMakeLists.txt
+++ b/tests/auto/qml/qqmlfileselector/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlfileselector
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlfileselector.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp b/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
index bc5cd2cdae..35c17ce588 100644
--- a/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
+++ b/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
@@ -35,13 +35,13 @@
#include <QQmlContext>
#include <QLoggingCategory>
#include <qqmlinfo.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlfileselector : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlfileselector() {}
+ tst_qqmlfileselector() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void basicTest();
diff --git a/tests/auto/qml/qqmlimport/CMakeLists.txt b/tests/auto/qml/qqmlimport/CMakeLists.txt
index 3d4f01da2c..6392a527a4 100644
--- a/tests/auto/qml/qqmlimport/CMakeLists.txt
+++ b/tests/auto/qml/qqmlimport/CMakeLists.txt
@@ -24,15 +24,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlimport
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlimport.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
Qt::QmlPrivate
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
index fdf72b83f0..f52b01cf04 100644
--- a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
+++ b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
@@ -34,12 +34,15 @@
#include <QtQuick/qquickitem.h>
#include <private/qqmlimport_p.h>
#include <private/qqmlengine_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QQmlImport : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQmlImport();
+
private slots:
void importPathOrder();
void testDesignerSupported();
@@ -175,6 +178,11 @@ void tst_QQmlImport::uiFormatLoading()
delete test;
}
+tst_QQmlImport::tst_QQmlImport()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQmlImport::importPathOrder()
{
#ifdef Q_OS_ANDROID
@@ -358,7 +366,9 @@ void tst_QQmlImport::removeDynamicPlugin()
{
// Load something that adds a dynamic plugin
QQmlComponent component(&engine);
- component.setData(QByteArray("import QtTest 1.0; TestResult{}"), QUrl());
+ // Make sure to use something other than QtTest here, since the !plugins.isEmpty()
+ // check will fail if we do.
+ component.setData(QByteArray("import QtQuick.tooling; Property{}"), QUrl());
QVERIFY2(component.isReady(), qPrintable(component.errorString()));
}
QQmlImportDatabase *imports = &QQmlEnginePrivate::get(&engine)->importDatabase;
diff --git a/tests/auto/qml/qqmlincubator/CMakeLists.txt b/tests/auto/qml/qqmlincubator/CMakeLists.txt
index 34f794b7d9..934199a66e 100644
--- a/tests/auto/qml/qqmlincubator/CMakeLists.txt
+++ b/tests/auto/qml/qqmlincubator/CMakeLists.txt
@@ -12,17 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlincubator
SOURCES
- ../../shared/util.cpp ../../shared/util.h
testtypes.cpp testtypes.h
tst_qqmlincubator.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::Network
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
index 7784afd35b..5850ddfa54 100644
--- a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
+++ b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp
@@ -38,16 +38,16 @@
#include <QQmlProperty>
#include <QQmlComponent>
#include <QQmlIncubator>
-#include "../../shared/util.h"
#include <private/qjsvalue_p.h>
#include <private/qqmlincubator_p.h>
#include <private/qqmlobjectcreator_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlincubator : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlincubator() {}
+ tst_qqmlincubator() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlinfo/CMakeLists.txt b/tests/auto/qml/qqmlinfo/CMakeLists.txt
index 9a66dd0728..9ba8ca4c4c 100644
--- a/tests/auto/qml/qqmlinfo/CMakeLists.txt
+++ b/tests/auto/qml/qqmlinfo/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlinfo
SOURCES
- ../../shared/util.cpp ../../shared/util.h
attached.cpp attached.h
tst_qqmlinfo.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp
index 7b7a12ee1b..e7e7d3be76 100644
--- a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp
+++ b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp
@@ -33,7 +33,7 @@
#include <QTimer>
#include <QQmlContext>
#include <qqmlinfo.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "attached.h"
@@ -41,7 +41,7 @@ class tst_qqmlinfo : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlinfo() {}
+ tst_qqmlinfo() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void qmlObject();
diff --git a/tests/auto/qml/qqmlinstantiator/CMakeLists.txt b/tests/auto/qml/qqmlinstantiator/CMakeLists.txt
index b7d967ca9f..ffe3a10b17 100644
--- a/tests/auto/qml/qqmlinstantiator/CMakeLists.txt
+++ b/tests/auto/qml/qqmlinstantiator/CMakeLists.txt
@@ -12,17 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlinstantiator
SOURCES
- ../../shared/util.cpp ../../shared/util.h
stringmodel.h
tst_qqmlinstantiator.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlModelsPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp b/tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp
index 84e08c471a..dc0365c5cf 100644
--- a/tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp
+++ b/tests/auto/qml/qqmlinstantiator/tst_qqmlinstantiator.cpp
@@ -34,13 +34,16 @@
#include <QtQmlModels/private/qqmlinstantiator_p.h>
#include <QtQml/qqmlcontext.h>
#include <QtQml/qqmlincubator.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "stringmodel.h"
class tst_qqmlinstantiator: public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qqmlinstantiator();
+
private slots:
void createNone();
void createSingle();
@@ -54,6 +57,11 @@ private slots:
void asynchronous();
};
+tst_qqmlinstantiator::tst_qqmlinstantiator()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qqmlinstantiator::createNone()
{
QQmlEngine engine;
diff --git a/tests/auto/qml/qqmlitemmodels/CMakeLists.txt b/tests/auto/qml/qqmlitemmodels/CMakeLists.txt
index 5246638739..7955eeba7b 100644
--- a/tests/auto/qml/qqmlitemmodels/CMakeLists.txt
+++ b/tests/auto/qml/qqmlitemmodels/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlitemmodels
SOURCES
- ../../shared/util.cpp ../../shared/util.h
qtestmodel.h
testtypes.h
tst_qqmlitemmodels.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp b/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
index 21bde0dd14..6fb86b98d5 100644
--- a/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
+++ b/tests/auto/qml/qqmlitemmodels/tst_qqmlitemmodels.cpp
@@ -31,7 +31,7 @@
#include <QQmlComponent>
#include <QDebug>
#include <QStringListModel>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "testtypes.h"
#include "qtestmodel.h"
@@ -45,7 +45,7 @@ class tst_qqmlitemmodels : public QQmlDataTest
Q_OBJECT
public:
- tst_qqmlitemmodels() {}
+ tst_qqmlitemmodels() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmllanguage/CMakeLists.txt b/tests/auto/qml/qqmllanguage/CMakeLists.txt
index 372e6086ed..08d747b818 100644
--- a/tests/auto/qml/qqmllanguage/CMakeLists.txt
+++ b/tests/auto/qml/qqmllanguage/CMakeLists.txt
@@ -12,18 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmllanguage
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
testtypes.cpp testtypes.h
tst_qqmllanguage.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::Network
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 052d9173a2..4aa65f53f3 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -52,9 +52,8 @@
#include <private/qqmltype_p_p.h>
#include "testtypes.h"
-#include "testhttpserver.h"
-
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#include <deque>
@@ -85,6 +84,9 @@ class tst_qqmllanguage : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qqmllanguage();
+
private slots:
void initTestCase() override;
void cleanupTestCase();
@@ -3736,6 +3738,11 @@ void tst_qqmllanguage::uncreatableTypesAsProperties()
QVERIFY(!object.isNull());
}
+tst_qqmllanguage::tst_qqmllanguage()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qqmllanguage::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/qqmllistmodel/CMakeLists.txt b/tests/auto/qml/qqmllistmodel/CMakeLists.txt
index d583dc3b0e..18c247f5b9 100644
--- a/tests/auto/qml/qqmllistmodel/CMakeLists.txt
+++ b/tests/auto/qml/qqmllistmodel/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmllistmodel
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmllistmodel.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qqmllistmodel
Qt::QmlModelsPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 6896965eea..37b0f6f1fe 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -39,7 +39,7 @@
#include <QtCore/qtranslator.h>
#include <QSignalSpy>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QVariantHash>)
@@ -74,6 +74,7 @@ class tst_qqmllistmodel : public QQmlDataTest
Q_OBJECT
public:
tst_qqmllistmodel()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qRegisterMetaType<QVector<int> >();
}
diff --git a/tests/auto/qml/qqmllistmodelworkerscript/CMakeLists.txt b/tests/auto/qml/qqmllistmodelworkerscript/CMakeLists.txt
index 66c7c3a557..577ba74f9a 100644
--- a/tests/auto/qml/qqmllistmodelworkerscript/CMakeLists.txt
+++ b/tests/auto/qml/qqmllistmodelworkerscript/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmllistmodelworkerscript
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmllistmodelworkerscript.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qqmllistmodelworkerscript
Qt::QmlModelsPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
index 262ac25d6a..93378ff647 100644
--- a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
+++ b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
@@ -38,7 +38,7 @@
#include <QtCore/qtranslator.h>
#include <QSignalSpy>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QVariantHash>)
@@ -73,6 +73,7 @@ class tst_qqmllistmodelworkerscript : public QQmlDataTest
Q_OBJECT
public:
tst_qqmllistmodelworkerscript()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qRegisterMetaType<QVector<int> >();
}
diff --git a/tests/auto/qml/qqmllistreference/CMakeLists.txt b/tests/auto/qml/qqmllistreference/CMakeLists.txt
index 15fa87b0b7..b620873c54 100644
--- a/tests/auto/qml/qqmllistreference/CMakeLists.txt
+++ b/tests/auto/qml/qqmllistreference/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmllistreference
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmllistreference.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
index 61565162e5..23b3847bc1 100644
--- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
+++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
@@ -37,13 +37,13 @@
#include <QtQml/qqmlproperty.h>
#include <QDebug>
#include <private/qquickstate_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmllistreference : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmllistreference() {}
+ tst_qqmllistreference() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private:
void modeData();
diff --git a/tests/auto/qml/qqmllocale/CMakeLists.txt b/tests/auto/qml/qqmllocale/CMakeLists.txt
index 4022cb8cc4..ca7f464c37 100644
--- a/tests/auto/qml/qqmllocale/CMakeLists.txt
+++ b/tests/auto/qml/qqmllocale/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmllocale
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmllocale.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Qml
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
index 3c9b1f1314..a318dc9ee7 100644
--- a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
+++ b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp
@@ -37,7 +37,7 @@
#include <QtCore/qscopedpointer.h>
#include <QtCore/qtimezone.h>
#include <qcolor.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <time.h>
@@ -45,7 +45,7 @@ class tst_qqmllocale : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmllocale() { }
+ tst_qqmllocale() : QQmlDataTest(QT_QMLTEST_DATADIR) { }
private slots:
void defaultLocale();
diff --git a/tests/auto/qml/qqmlmetaobject/CMakeLists.txt b/tests/auto/qml/qqmlmetaobject/CMakeLists.txt
index c7ec398a5d..a46b58f9ab 100644
--- a/tests/auto/qml/qqmlmetaobject/CMakeLists.txt
+++ b/tests/auto/qml/qqmlmetaobject/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlmetaobject
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlmetaobject.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Qml
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp b/tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp
index af285fb58b..81c6b0d2a1 100644
--- a/tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp
+++ b/tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp
@@ -29,7 +29,7 @@
#include <QtTest/QtTest>
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlengine.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
Q_DECLARE_METATYPE(QMetaMethod::MethodType)
@@ -42,6 +42,10 @@ QML_DECLARE_TYPE(MyQmlObject)
class tst_QQmlMetaObject : public QQmlDataTest
{
Q_OBJECT
+
+public:
+ tst_QQmlMetaObject();
+
private slots:
void initTestCase() override;
@@ -54,6 +58,11 @@ private:
MyQmlObject myQmlObject;
};
+tst_QQmlMetaObject::tst_QQmlMetaObject()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQmlMetaObject::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/qqmlmetatype/CMakeLists.txt b/tests/auto/qml/qqmlmetatype/CMakeLists.txt
index 55eebaa651..86b1fa6afb 100644
--- a/tests/auto/qml/qqmlmetatype/CMakeLists.txt
+++ b/tests/auto/qml/qqmlmetatype/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlmetatype
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlmetatype.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index 4d2e8c2b5d..be493484ee 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -37,13 +37,13 @@
#include <private/qqmlpropertyvalueinterceptor_p.h>
#include <private/qqmlengine_p.h>
#include <private/qqmlanybinding_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlmetatype : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlmetatype() {}
+ tst_qqmlmetatype() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlmoduleplugin/CMakeLists.txt b/tests/auto/qml/qqmlmoduleplugin/CMakeLists.txt
index 18bd80b588..43b4c032df 100644
--- a/tests/auto/qml/qqmlmoduleplugin/CMakeLists.txt
+++ b/tests/auto/qml/qqmlmoduleplugin/CMakeLists.txt
@@ -20,17 +20,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlmoduleplugin
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlmoduleplugin.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
Qt::Network
Qt::QmlPrivate
Qt::QuickShapesPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
index f1e6f7aa5a..dba70ac979 100644
--- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
+++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp
@@ -46,8 +46,8 @@
#include <unistd.h>
#endif
-#include "../../shared/testhttpserver.h"
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
// Note: this test does not use module identifier directives in the qmldir files, because
// it would result in repeated attempts to insert types into the same namespace.
@@ -58,6 +58,7 @@ class tst_qqmlmoduleplugin : public QQmlDataTest
{
Q_OBJECT
public:
+ tst_qqmlmoduleplugin();
private slots:
void initTestCase() override;
@@ -175,6 +176,11 @@ void registerStaticPlugin(const char *uri)
qRegisterStaticPluginFunction(plugin);
};
+tst_qqmlmoduleplugin::tst_qqmlmoduleplugin()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qqmlmoduleplugin::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/qqmlnotifier/CMakeLists.txt b/tests/auto/qml/qqmlnotifier/CMakeLists.txt
index 5cc0495393..dfd9d625bc 100644
--- a/tests/auto/qml/qqmlnotifier/CMakeLists.txt
+++ b/tests/auto/qml/qqmlnotifier/CMakeLists.txt
@@ -12,13 +12,11 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlnotifier
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlnotifier.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp b/tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp
index 836b94ad45..25eaa22b86 100644
--- a/tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp
+++ b/tests/auto/qml/qqmlnotifier/tst_qqmlnotifier.cpp
@@ -36,7 +36,7 @@
#include <QProcess>
#endif
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class ExportedClass : public QObject
{
@@ -140,7 +140,7 @@ class tst_qqmlnotifier : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlnotifier() {}
+ tst_qqmlnotifier() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlparser/CMakeLists.txt b/tests/auto/qml/qqmlparser/CMakeLists.txt
index c322e29e94..004bb8ea31 100644
--- a/tests/auto/qml/qqmlparser/CMakeLists.txt
+++ b/tests/auto/qml/qqmlparser/CMakeLists.txt
@@ -12,16 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlparser
SOURCES
- ../../shared/qqmljsastdumper.cpp ../../shared/qqmljsastdumper.h
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlparser.cpp
DEFINES
SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\"
- INCLUDE_DIRECTORIES
- ../../shared ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
index a480214219..1268ef8900 100644
--- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
+++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
@@ -32,8 +32,8 @@
#include <private/qqmljsastvisitor_p.h>
#include <private/qqmljsast_p.h>
-#include "../../shared/util.h"
-#include "../../shared/qqmljsastdumper.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/qqmljsastdumper_p.h>
#include <qtest.h>
#include <QDir>
@@ -240,6 +240,7 @@ private:
}
tst_qqmlparser::tst_qqmlparser()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/qml/qqmlpromise/CMakeLists.txt b/tests/auto/qml/qqmlpromise/CMakeLists.txt
index e972ab08fb..00c3dcf6b4 100644
--- a/tests/auto/qml/qqmlpromise/CMakeLists.txt
+++ b/tests/auto/qml/qqmlpromise/CMakeLists.txt
@@ -12,17 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlpromise
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlpromise.cpp
DEFINES
QT_DISABLE_DEPRECATED_BEFORE=0
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp b/tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp
index b430434526..2049376a86 100644
--- a/tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp
+++ b/tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp
@@ -42,14 +42,14 @@
#include <QQmlComponent>
#include <QDebug>
#include <QScopedPointer>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlpromise : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlpromise() {}
+ tst_qqmlpromise() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void promise_all_empty_input();
diff --git a/tests/auto/qml/qqmlproperty/CMakeLists.txt b/tests/auto/qml/qqmlproperty/CMakeLists.txt
index 21f4372058..1c695251f9 100644
--- a/tests/auto/qml/qqmlproperty/CMakeLists.txt
+++ b/tests/auto/qml/qqmlproperty/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlproperty
SOURCES
- ../../shared/util.cpp ../../shared/util.h
interfaces.h
tst_qqmlproperty.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index a1eae50048..a8c01675e4 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -41,7 +41,7 @@
#include <QtCore/qregularexpression.h>
#endif
#include <QtCore/private/qobject_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "qobject.h"
#include <QtQml/QQmlPropertyMap>
@@ -140,7 +140,7 @@ class tst_qqmlproperty : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlproperty() {}
+ tst_qqmlproperty() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlpropertycache/CMakeLists.txt b/tests/auto/qml/qqmlpropertycache/CMakeLists.txt
index 55f8c7b76b..cb396998bc 100644
--- a/tests/auto/qml/qqmlpropertycache/CMakeLists.txt
+++ b/tests/auto/qml/qqmlpropertycache/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlpropertycache
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlpropertycache.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp
index a3d84e3eb6..5e022d963f 100644
--- a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp
+++ b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp
@@ -34,13 +34,13 @@
#include <private/qmetaobjectbuilder_p.h>
#include <private/qqmlcontextdata_p.h>
#include <QCryptographicHash>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlpropertycache : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlpropertycache() {}
+ tst_qqmlpropertycache() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void properties();
diff --git a/tests/auto/qml/qqmlpropertymap/CMakeLists.txt b/tests/auto/qml/qqmlpropertymap/CMakeLists.txt
index 3092aa4eb2..291c221b23 100644
--- a/tests/auto/qml/qqmlpropertymap/CMakeLists.txt
+++ b/tests/auto/qml/qqmlpropertymap/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlpropertymap
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlpropertymap.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp b/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
index 07afc69a6d..508154e557 100644
--- a/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
+++ b/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
#include <qtest.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcontext.h>
#include <QtQml/qqmlpropertymap.h>
@@ -39,7 +39,7 @@ class tst_QQmlPropertyMap : public QQmlDataTest
{
Q_OBJECT
public:
- tst_QQmlPropertyMap() {}
+ tst_QQmlPropertyMap() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlqt/CMakeLists.txt b/tests/auto/qml/qqmlqt/CMakeLists.txt
index 1c965d5c5a..863057372b 100644
--- a/tests/auto/qml/qqmlqt/CMakeLists.txt
+++ b/tests/auto/qml/qqmlqt/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlqt
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlqt.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
index 62e42072b0..fbaafcf175 100644
--- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
+++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
@@ -44,14 +44,14 @@
#include <QQuaternion>
#include <QMatrix4x4>
#include <QFont>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qglobal_p.h>
class tst_qqmlqt : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlqt() {}
+ tst_qqmlqt() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlsettings/CMakeLists.txt b/tests/auto/qml/qqmlsettings/CMakeLists.txt
index 01d35824da..5b5ba1e257 100644
--- a/tests/auto/qml/qqmlsettings/CMakeLists.txt
+++ b/tests/auto/qml/qqmlsettings/CMakeLists.txt
@@ -12,13 +12,11 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlsettings
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlsettings.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp b/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
index 60daeb0724..baaf126be3 100644
--- a/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
+++ b/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
@@ -34,12 +34,15 @@
#include <QtGui/QFont>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QQmlSettings : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQmlSettings();
+
private slots:
void initTestCase() override;
@@ -144,6 +147,11 @@ private:
QFont m_fontProperty;
};
+tst_QQmlSettings::tst_QQmlSettings()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQmlSettings::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/qml/qqmlsqldatabase/CMakeLists.txt b/tests/auto/qml/qqmlsqldatabase/CMakeLists.txt
index b9762b2eb6..aa40348e42 100644
--- a/tests/auto/qml/qqmlsqldatabase/CMakeLists.txt
+++ b/tests/auto/qml/qqmlsqldatabase/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlsqldatabase
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlsqldatabase.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qqmlsqldatabase
Qt::QmlPrivate
Qt::QuickPrivate
Qt::Sql
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
index 654877c7ea..b1516644a3 100644
--- a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
+++ b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp
@@ -34,13 +34,14 @@
#include <QtSql/qsqldatabase.h>
#include <QtCore/qdir.h>
#include <QtCore/qfile.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmlsqldatabase : public QQmlDataTest
{
Q_OBJECT
public:
tst_qqmlsqldatabase()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qApp->setApplicationName("tst_qqmlsqldatabase");
qApp->setOrganizationName("QtProject");
diff --git a/tests/auto/qml/qqmltablemodel/CMakeLists.txt b/tests/auto/qml/qqmltablemodel/CMakeLists.txt
index 75da1fc93f..02f93b5802 100644
--- a/tests/auto/qml/qqmltablemodel/CMakeLists.txt
+++ b/tests/auto/qml/qqmltablemodel/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmltablemodel
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmltablemodel.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
Qt::QmlPrivate
Qt::Quick
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmltablemodel/tst_qqmltablemodel.cpp b/tests/auto/qml/qqmltablemodel/tst_qqmltablemodel.cpp
index 3923824fa2..a5db6bdd66 100644
--- a/tests/auto/qml/qqmltablemodel/tst_qqmltablemodel.cpp
+++ b/tests/auto/qml/qqmltablemodel/tst_qqmltablemodel.cpp
@@ -36,14 +36,14 @@
#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquicktableview_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QQmlTableModel : public QQmlDataTest
{
Q_OBJECT
public:
- tst_QQmlTableModel() {}
+ tst_QQmlTableModel() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void appendRemoveRow();
diff --git a/tests/auto/qml/qqmltranslation/CMakeLists.txt b/tests/auto/qml/qqmltranslation/CMakeLists.txt
index cb402b3e64..f685e07d9a 100644
--- a/tests/auto/qml/qqmltranslation/CMakeLists.txt
+++ b/tests/auto/qml/qqmltranslation/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmltranslation
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmltranslation.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp b/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
index 73cdba5f8c..09addff372 100644
--- a/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
+++ b/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
@@ -34,13 +34,13 @@
#include <QQuickItem>
#include <private/qqmlengine_p.h>
#include <private/qqmltypedata_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qqmltranslation : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmltranslation() {}
+ tst_qqmltranslation() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void translation_data();
diff --git a/tests/auto/qml/qqmltypeloader/CMakeLists.txt b/tests/auto/qml/qqmltypeloader/CMakeLists.txt
index 8c16b922e4..e4f99ceaf3 100644
--- a/tests/auto/qml/qqmltypeloader/CMakeLists.txt
+++ b/tests/auto/qml/qqmltypeloader/CMakeLists.txt
@@ -12,16 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmltypeloader
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
declarativetesttype.h
tst_qqmltypeloader.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Qml
Qt::QmlPrivate
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
index c765a44637..a030e56b20 100644
--- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
+++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
@@ -40,13 +40,16 @@
#include <QtQml/private/qqmltypeloader_p.h>
#include <QtQml/private/qqmlirbuilder_p.h>
#include <QtQml/private/qqmlirloader_p.h>
-#include "../../shared/testhttpserver.h"
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QQMLTypeLoader : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQMLTypeLoader();
+
private slots:
void testLoadComplete();
void loadComponentSynchronously();
@@ -73,6 +76,11 @@ private:
void checkSingleton(const QString & dataDirectory);
};
+tst_QQMLTypeLoader::tst_QQMLTypeLoader()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQMLTypeLoader::testLoadComplete()
{
#ifdef Q_OS_ANDROID
diff --git a/tests/auto/qml/qqmlvaluetypeproviders/CMakeLists.txt b/tests/auto/qml/qqmlvaluetypeproviders/CMakeLists.txt
index 697f501153..2ee105c48d 100644
--- a/tests/auto/qml/qqmlvaluetypeproviders/CMakeLists.txt
+++ b/tests/auto/qml/qqmlvaluetypeproviders/CMakeLists.txt
@@ -12,17 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlvaluetypeproviders
SOURCES
- ../../shared/util.cpp ../../shared/util.h
testtypes.cpp testtypes.h
tst_qqmlvaluetypeproviders.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp b/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp
index c0bc090bd9..6212c2d169 100644
--- a/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp
+++ b/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp
@@ -34,7 +34,7 @@
#include <QScopedPointer>
#include <private/qqmlglobal_p.h>
#include <private/qquickvaluetypes_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "testtypes.h"
QT_BEGIN_NAMESPACE
@@ -50,7 +50,7 @@ class tst_qqmlvaluetypeproviders : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlvaluetypeproviders() {}
+ tst_qqmlvaluetypeproviders() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlvaluetypes/CMakeLists.txt b/tests/auto/qml/qqmlvaluetypes/CMakeLists.txt
index fc76a3ff12..25bf4a4c9e 100644
--- a/tests/auto/qml/qqmlvaluetypes/CMakeLists.txt
+++ b/tests/auto/qml/qqmlvaluetypes/CMakeLists.txt
@@ -12,17 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlvaluetypes
SOURCES
- ../../shared/util.cpp ../../shared/util.h
testtypes.cpp testtypes.h
tst_qqmlvaluetypes.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
index c062b9cd56..c00ad90e19 100644
--- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
@@ -36,7 +36,7 @@
#include <private/qqmlglobal_p.h>
#include <private/qv4engine_p.h>
#include <private/qv4variantobject_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "testtypes.h"
QT_BEGIN_NAMESPACE
@@ -47,7 +47,7 @@ class tst_qqmlvaluetypes : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlvaluetypes() {}
+ tst_qqmlvaluetypes() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlxmlhttprequest/CMakeLists.txt b/tests/auto/qml/qqmlxmlhttprequest/CMakeLists.txt
index 4f428fe3a1..19450aaef7 100644
--- a/tests/auto/qml/qqmlxmlhttprequest/CMakeLists.txt
+++ b/tests/auto/qml/qqmlxmlhttprequest/CMakeLists.txt
@@ -12,17 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlxmlhttprequest
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlxmlhttprequest.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::Network
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
index 401152d575..a379350c2d 100644
--- a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
+++ b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
@@ -42,14 +42,14 @@
#include <QProcessEnvironment>
#endif
-#include "testhttpserver.h"
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
class tst_qqmlxmlhttprequest : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qqmlxmlhttprequest() {}
+ tst_qqmlxmlhttprequest() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/qml/qqmlxmllistmodel/CMakeLists.txt b/tests/auto/qml/qqmlxmllistmodel/CMakeLists.txt
index 3748661ce2..b529ceed8e 100644
--- a/tests/auto/qml/qqmlxmllistmodel/CMakeLists.txt
+++ b/tests/auto/qml/qqmlxmllistmodel/CMakeLists.txt
@@ -5,14 +5,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qqmlxmllistmodel
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qqmlxmllistmodel.cpp
- INCLUDE_DIRECTORIES
- ../../shared
LIBRARIES
Qt::Core
Qt::Qml
Qt::QmlXmlListModelPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp b/tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp
index 804a10ba72..4dc07b4366 100644
--- a/tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp
+++ b/tests/auto/qml/qqmlxmllistmodel/tst_qqmlxmllistmodel.cpp
@@ -36,7 +36,7 @@
#include <QNetworkRequest>
#include <QNetworkAccessManager>
#include <QtQmlXmlListModel/private/qqmlxmllistmodel_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
typedef QList<QVariantList> QQmlXmlModelData;
@@ -48,7 +48,7 @@ class tst_QQmlXmlListModel : public QQmlDataTest
{
Q_OBJECT
public:
- tst_QQmlXmlListModel() { }
+ tst_QQmlXmlListModel() : QQmlDataTest(QT_QMLTEST_DATADIR) { }
private slots:
void initTestCase() override
diff --git a/tests/auto/qml/qquickfolderlistmodel/CMakeLists.txt b/tests/auto/qml/qquickfolderlistmodel/CMakeLists.txt
index 58aa6e95f1..60d4e0c22f 100644
--- a/tests/auto/qml/qquickfolderlistmodel/CMakeLists.txt
+++ b/tests/auto/qml/qquickfolderlistmodel/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickfolderlistmodel
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickfolderlistmodel.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
index d49e9b952b..196c3c0416 100644
--- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
+++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
@@ -33,7 +33,7 @@
#include <QtCore/qfile.h>
#include <QtCore/qabstractitemmodel.h>
#include <QDebug>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#if defined (Q_OS_WIN)
#include <qt_windows.h>
@@ -48,7 +48,7 @@ class tst_qquickfolderlistmodel : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickfolderlistmodel() {}
+ tst_qquickfolderlistmodel() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
public slots:
void removed(const QModelIndex &, int start, int end) {
diff --git a/tests/auto/qml/qquickworkerscript/CMakeLists.txt b/tests/auto/qml/qquickworkerscript/CMakeLists.txt
index 52a2380ff4..94473d9032 100644
--- a/tests/auto/qml/qquickworkerscript/CMakeLists.txt
+++ b/tests/auto/qml/qquickworkerscript/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickworkerscript
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickworkerscript.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QmlWorkerScriptPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index b093dcaf07..e410bf75a3 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -38,13 +38,13 @@
#include <private/qquickworkerscript_p.h>
#include <private/qqmlengine_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QQuickWorkerScript : public QQmlDataTest
{
Q_OBJECT
public:
- tst_QQuickWorkerScript() {}
+ tst_QQuickWorkerScript() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void source();
void ready();
diff --git a/tests/auto/qml/qtqmlmodules/CMakeLists.txt b/tests/auto/qml/qtqmlmodules/CMakeLists.txt
index 9637588a8b..2bff111bc7 100644
--- a/tests/auto/qml/qtqmlmodules/CMakeLists.txt
+++ b/tests/auto/qml/qtqmlmodules/CMakeLists.txt
@@ -12,15 +12,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qtqmlmodules
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qtqmlmodules.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp b/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp
index 90b6feee28..874d6fe102 100644
--- a/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp
+++ b/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp
@@ -30,13 +30,13 @@
#include <QDebug>
#include <QQmlEngine>
#include <QQmlComponent>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qtqmlmodules : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qtqmlmodules() {}
+ tst_qtqmlmodules() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void baseTypes();
diff --git a/tests/auto/qml/qv4assembler/CMakeLists.txt b/tests/auto/qml/qv4assembler/CMakeLists.txt
index 1f73fd3495..486baf7deb 100644
--- a/tests/auto/qml/qv4assembler/CMakeLists.txt
+++ b/tests/auto/qml/qv4assembler/CMakeLists.txt
@@ -12,13 +12,11 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qv4assembler
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qv4assembler.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp b/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp
index d6bee0c96c..619466cd18 100644
--- a/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp
+++ b/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp
@@ -26,13 +26,12 @@
**
****************************************************************************/
-#include <util.h>
-
#include <QtTest/QtTest>
#include <QtCore/qprocess.h>
#include <QtCore/qtemporaryfile.h>
#include <QtQml/qqml.h>
#include <QtQml/qqmlapplicationengine.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <private/qv4global_p.h>
@@ -44,6 +43,9 @@ class tst_QV4Assembler : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QV4Assembler();
+
private slots:
void initTestCase() override;
void perfMapFile();
@@ -51,6 +53,11 @@ private slots:
void jitEnabled();
};
+tst_QV4Assembler::tst_QV4Assembler()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QV4Assembler::initTestCase()
{
qputenv("QV4_JIT_CALL_THRESHOLD", "0");
diff --git a/tests/auto/qml/qv4mm/CMakeLists.txt b/tests/auto/qml/qv4mm/CMakeLists.txt
index f5667c2b5d..93e71ac0c9 100644
--- a/tests/auto/qml/qv4mm/CMakeLists.txt
+++ b/tests/auto/qml/qv4mm/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qv4mm
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qv4mm.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
Qt::QmlPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/qml/qv4mm/tst_qv4mm.cpp b/tests/auto/qml/qv4mm/tst_qv4mm.cpp
index b6a5753e56..43438622ee 100644
--- a/tests/auto/qml/qv4mm/tst_qv4mm.cpp
+++ b/tests/auto/qml/qv4mm/tst_qv4mm.cpp
@@ -35,7 +35,7 @@
#include <private/qv4qobjectwrapper_p.h>
#include <private/qjsvalue_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <memory>
@@ -43,6 +43,9 @@ class tst_qv4mm : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qv4mm();
+
private slots:
void gcStats();
void multiWrappedQObjects();
@@ -51,6 +54,11 @@ private slots:
void createObjectsOnDestruction();
};
+tst_qv4mm::tst_qv4mm()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qv4mm::gcStats()
{
QLoggingCategory::setFilterRules("qt.qml.gc.*=true");
diff --git a/tests/auto/quick/drawingmodes/CMakeLists.txt b/tests/auto/quick/drawingmodes/CMakeLists.txt
index f7bf15f49f..b2a059f307 100644
--- a/tests/auto/quick/drawingmodes/CMakeLists.txt
+++ b/tests/auto/quick/drawingmodes/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_drawingmodes
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_drawingmodes.cpp
DEFINES
QT_DISABLE_DEPRECATED_BEFORE=0
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
index 57c4bee118..91bef35b1b 100644
--- a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
+++ b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
@@ -35,7 +35,7 @@
#include <QtQuick/qsgflatcolormaterial.h>
#include <QtGui/qscreen.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_drawingmodes : public QQmlDataTest
{
@@ -138,7 +138,10 @@ bool tst_drawingmodes::hasPixelAround(const QImage &fb, int centerX, int centerY
return false;
}
-tst_drawingmodes::tst_drawingmodes() : black(qRgb(0, 0, 0)), red(qRgb(0xff, 0, 0))
+tst_drawingmodes::tst_drawingmodes()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+ , black(qRgb(0, 0, 0))
+ , red(qRgb(0xff, 0, 0))
{
qmlRegisterType<DrawingModeItem>("Test", 1, 0, "DrawingModeItem");
outerWindow.showNormal();
diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/CMakeLists.txt b/tests/auto/quick/pointerhandlers/flickableinterop/CMakeLists.txt
index f67f9a0a59..ea1c416651 100644
--- a/tests/auto/quick/pointerhandlers/flickableinterop/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/flickableinterop/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_flickableinterop
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_flickableinterop.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp
index 869ba80658..5925965c55 100644
--- a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp
+++ b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp
@@ -45,8 +45,8 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlproperty.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -55,7 +55,8 @@ class tst_FlickableInterop : public QQmlDataTest
Q_OBJECT
public:
tst_FlickableInterop()
- :touchDevice(QTest::createTouchDevice())
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+ , touchDevice(QTest::createTouchDevice())
{}
private slots:
@@ -90,8 +91,8 @@ void tst_FlickableInterop::createView(QScopedPointer<QQuickView> &window, const
window.reset(new QQuickView);
window->setSource(testFileUrl(fileName));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
diff --git a/tests/auto/quick/pointerhandlers/mousearea_interop/CMakeLists.txt b/tests/auto/quick/pointerhandlers/mousearea_interop/CMakeLists.txt
index f799de97b8..2cbeb21f1d 100644
--- a/tests/auto/quick/pointerhandlers/mousearea_interop/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/mousearea_interop/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_mousearea_interop
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_mousearea_interop.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp b/tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp
index ee8f079978..fff1558bde 100644
--- a/tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp
+++ b/tests/auto/quick/pointerhandlers/mousearea_interop/tst_mousearea_interop.cpp
@@ -37,8 +37,8 @@
#include <QtQuick/qquickview.h>
#include <QtGui/private/qpointingdevice_p.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -47,6 +47,7 @@ class tst_MouseAreaInterop : public QQmlDataTest
Q_OBJECT
public:
tst_MouseAreaInterop()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{}
private slots:
@@ -65,8 +66,8 @@ void tst_MouseAreaInterop::createView(QScopedPointer<QQuickView> &window, const
window.reset(new QQuickView);
window->setSource(testFileUrl(fileName));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
diff --git a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/CMakeLists.txt b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/CMakeLists.txt
index 4aac9440f9..a7308133c3 100644
--- a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_multipointtoucharea_interop
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_multipointtoucharea_interop.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp
index 0312ed0141..243e769658 100644
--- a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp
+++ b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp
@@ -37,8 +37,8 @@
#include <QtQuick/qquickview.h>
#include <QtGui/private/qpointingdevice_p.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -47,6 +47,7 @@ class tst_MptaInterop : public QQmlDataTest
Q_OBJECT
public:
tst_MptaInterop()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{}
private slots:
@@ -67,8 +68,8 @@ void tst_MptaInterop::createView(QScopedPointer<QQuickView> &window, const char
window.reset(new QQuickView);
window->setSource(testFileUrl(fileName));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
diff --git a/tests/auto/quick/pointerhandlers/qquickdraghandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickdraghandler/CMakeLists.txt
index 85c664f8ca..3f2d2ac1ca 100644
--- a/tests/auto/quick/pointerhandlers/qquickdraghandler/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/qquickdraghandler/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickdraghandler
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquickdraghandler.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp b/tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp
index 059f06f469..8e191eb398 100644
--- a/tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp
@@ -37,8 +37,8 @@
#include <QtQuick/qquickview.h>
#include <QtGui/private/qpointingdevice_p.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -47,7 +47,8 @@ class tst_DragHandler : public QQmlDataTest
Q_OBJECT
public:
tst_DragHandler()
- :touchDevice(QTest::createTouchDevice())
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+ , touchDevice(QTest::createTouchDevice())
{}
private slots:
@@ -84,8 +85,8 @@ void tst_DragHandler::createView(QScopedPointer<QQuickView> &window, const char
window.reset(new QQuickView);
window->setSource(testFileUrl(fileName));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickhoverhandler/CMakeLists.txt
index 654bf1c366..52d46af9d7 100644
--- a/tests/auto/quick/pointerhandlers/qquickhoverhandler/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickhoverhandler
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquickhoverhandler.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp
index de03edf577..590182264e 100644
--- a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp
@@ -39,8 +39,8 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlproperty.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -54,6 +54,7 @@ class tst_HoverHandler : public QQmlDataTest
Q_OBJECT
public:
tst_HoverHandler()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{}
private slots:
@@ -72,8 +73,8 @@ void tst_HoverHandler::createView(QScopedPointer<QQuickView> &window, const char
window.reset(new QQuickView);
window->setSource(testFileUrl(fileName));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
diff --git a/tests/auto/quick/pointerhandlers/qquickpinchhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickpinchhandler/CMakeLists.txt
index 09550b143d..4ecf6dfbbb 100644
--- a/tests/auto/quick/pointerhandlers/qquickpinchhandler/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/qquickpinchhandler/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpinchhandler
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquickpinchhandler.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp b/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp
index 6cf6214286..667853161b 100644
--- a/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickpinchhandler/tst_qquickpinchhandler.cpp
@@ -35,8 +35,8 @@
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuick/qquickview.h>
#include <QtQml/qqmlcontext.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -50,7 +50,7 @@ class tst_QQuickPinchHandler: public QQmlDataTest
{
Q_OBJECT
public:
- tst_QQuickPinchHandler() { }
+ tst_QQuickPinchHandler() : QQmlDataTest(QT_QMLTEST_DATADIR) { }
private slots:
void cleanupTestCase();
void pinchProperties();
@@ -67,7 +67,6 @@ private slots:
void transformedpinchHandler();
private:
- QQuickView *createView();
QPointingDevice *touchscreen = QTest::createTouchDevice();
QPointingDevice *touchpad = QTest::createTouchDevice(QInputDevice::DeviceType::TouchPad);
};
@@ -84,7 +83,7 @@ static bool withinBounds(qreal lower, qreal num, qreal upper)
void tst_QQuickPinchHandler::pinchProperties()
{
- QScopedPointer<QQuickView> window(createView());
+ QScopedPointer<QQuickView> window(QQuickViewTestUtils::createView());
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
QVERIFY(window->rootObject() != nullptr);
@@ -207,7 +206,7 @@ QMutableEventPoint makeTouchPoint(int id, QPoint p, QQuickView *v, QQuickItem *i
void tst_QQuickPinchHandler::scale()
{
- QQuickView *window = createView();
+ QQuickView *window = QQuickViewTestUtils::createView();
QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
@@ -295,7 +294,7 @@ void tst_QQuickPinchHandler::scale()
void tst_QQuickPinchHandler::scaleThreeFingers()
{
- QQuickView *window = createView();
+ QQuickView *window = QQuickViewTestUtils::createView();
QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("threeFingers.qml"));
window->show();
@@ -383,7 +382,7 @@ void tst_QQuickPinchHandler::scaleNativeGesture()
{
QFETCH(QString, qmlfile);
- QQuickView *window = createView();
+ QQuickView *window = QQuickViewTestUtils::createView();
QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl(qmlfile));
window->show();
@@ -456,7 +455,7 @@ void tst_QQuickPinchHandler::scaleNativeGesture()
void tst_QQuickPinchHandler::pan()
{
- QQuickView *window = createView();
+ QQuickView *window = QQuickViewTestUtils::createView();
QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
@@ -568,7 +567,7 @@ void tst_QQuickPinchHandler::dragAxesEnabled_data()
void tst_QQuickPinchHandler::dragAxesEnabled()
{
- QQuickView *window = createView();
+ QQuickView *window = QQuickViewTestUtils::createView();
QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
@@ -635,7 +634,7 @@ void tst_QQuickPinchHandler::dragAxesEnabled()
void tst_QQuickPinchHandler::retouch()
{
const int dragThreshold = QGuiApplication::styleHints()->startDragDistance();
- QQuickView *window = createView();
+ QQuickView *window = QQuickViewTestUtils::createView();
QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
@@ -718,7 +717,7 @@ void tst_QQuickPinchHandler::retouch()
void tst_QQuickPinchHandler::cancel()
{
const int dragThreshold = QGuiApplication::styleHints()->startDragDistance();
- QQuickView *window = createView();
+ QQuickView *window = QQuickViewTestUtils::createView();
QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
@@ -811,7 +810,7 @@ void tst_QQuickPinchHandler::transformedpinchHandler()
QFETCH(QPoint, p1);
QFETCH(bool, shouldPinch);
- QQuickView *view = createView();
+ QQuickView *view = QQuickViewTestUtils::createView();
QScopedPointer<QQuickView> scope(view);
view->setSource(testFileUrl("transformedPinchHandler.qml"));
view->show();
@@ -850,14 +849,6 @@ void tst_QQuickPinchHandler::transformedpinchHandler()
}
}
-QQuickView *tst_QQuickPinchHandler::createView()
-{
- QQuickView *window = new QQuickView(0);
- window->setGeometry(0,0,240,320);
-
- return window;
-}
-
QTEST_MAIN(tst_QQuickPinchHandler)
#include "tst_qquickpinchhandler.moc"
diff --git a/tests/auto/quick/pointerhandlers/qquickpointerhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickpointerhandler/CMakeLists.txt
index 9dc541a845..1d2cb3197e 100644
--- a/tests/auto/quick/pointerhandlers/qquickpointerhandler/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/qquickpointerhandler/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpointerhandler
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquickpointerhandler.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp b/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp
index 9bbf7a38b7..2c872b80a3 100644
--- a/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp
@@ -35,8 +35,8 @@
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -236,7 +236,8 @@ class tst_PointerHandlers : public QQmlDataTest
Q_OBJECT
public:
tst_PointerHandlers()
- : touchDevice(QTest::createTouchDevice())
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+ , touchDevice(QTest::createTouchDevice())
{}
private slots:
@@ -288,8 +289,8 @@ void tst_PointerHandlers::createView(QScopedPointer<QQuickView> &window, const c
// window->setGeometry(0,0,240,320);
window->setSource(testFileUrl(fileName));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
diff --git a/tests/auto/quick/pointerhandlers/qquickpointhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickpointhandler/CMakeLists.txt
index 507bc7549b..6e48eb53d6 100644
--- a/tests/auto/quick/pointerhandlers/qquickpointhandler/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/qquickpointhandler/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpointhandler
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquickpointhandler.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp b/tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp
index a511c906f8..d22b3d86aa 100644
--- a/tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickpointhandler/tst_qquickpointhandler.cpp
@@ -39,8 +39,9 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlproperty.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -49,7 +50,8 @@ class tst_PointHandler : public QQmlDataTest
Q_OBJECT
public:
tst_PointHandler()
- : touchDevice(QTest::createTouchDevice())
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+ , touchDevice(QTest::createTouchDevice())
{}
private slots:
@@ -71,8 +73,8 @@ void tst_PointHandler::createView(QScopedPointer<QQuickView> &window, const char
window.reset(new QQuickView);
window->setSource(testFileUrl(fileName));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::centerOnScreen(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
diff --git a/tests/auto/quick/pointerhandlers/qquicktaphandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquicktaphandler/CMakeLists.txt
index babe276519..94dc41df92 100644
--- a/tests/auto/quick/pointerhandlers/qquicktaphandler/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/qquicktaphandler/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktaphandler
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquicktaphandler.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp b/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp
index 67583fae30..02d79c724c 100644
--- a/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp
@@ -41,8 +41,8 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlproperty.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -51,6 +51,7 @@ class tst_TapHandler : public QQmlDataTest
Q_OBJECT
public:
tst_TapHandler()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{}
private slots:
@@ -92,8 +93,8 @@ void tst_TapHandler::createView(QScopedPointer<QQuickView> &window, const char *
window->setSource(testFileUrl(fileName));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
diff --git a/tests/auto/quick/pointerhandlers/qquickwheelhandler/CMakeLists.txt b/tests/auto/quick/pointerhandlers/qquickwheelhandler/CMakeLists.txt
index 588fd8f2e2..0fa66bfa10 100644
--- a/tests/auto/quick/pointerhandlers/qquickwheelhandler/CMakeLists.txt
+++ b/tests/auto/quick/pointerhandlers/qquickwheelhandler/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickwheelhandler
SOURCES
- ../../../shared/util.cpp ../../../shared/util.h
- ../../shared/geometrytestutil.cpp ../../shared/geometrytestutil.h
- ../../shared/viewtestutil.cpp ../../shared/viewtestutil.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquickwheelhandler.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/pointerhandlers/qquickwheelhandler/tst_qquickwheelhandler.cpp b/tests/auto/quick/pointerhandlers/qquickwheelhandler/tst_qquickwheelhandler.cpp
index 2abf2ea8c3..84906f7848 100644
--- a/tests/auto/quick/pointerhandlers/qquickwheelhandler/tst_qquickwheelhandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickwheelhandler/tst_qquickwheelhandler.cpp
@@ -34,8 +34,8 @@
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuick/qquickview.h>
#include <QtQml/qqmlcontext.h>
-#include "../../../shared/util.h"
-#include "../../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcPointerTests, "qt.quick.pointer.tests")
@@ -43,7 +43,7 @@ class tst_QQuickWheelHandler: public QQmlDataTest
{
Q_OBJECT
public:
- tst_QQuickWheelHandler() { }
+ tst_QQuickWheelHandler() : QQmlDataTest(QT_QMLTEST_DATADIR) { }
private slots:
void singleHandler_data();
diff --git a/tests/auto/quick/qquickaccessible/CMakeLists.txt b/tests/auto/quick/qquickaccessible/CMakeLists.txt
index 8d0fcbe406..bc037a64dd 100644
--- a/tests/auto/quick/qquickaccessible/CMakeLists.txt
+++ b/tests/auto/quick/qquickaccessible/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickaccessible
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickaccessible.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickaccessible
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
index edaaed967a..136703d517 100644
--- a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
+++ b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
@@ -45,8 +45,8 @@
#include <QtQuick/private/qquicklistview_p.h>
#include <QtQuick/private/qquicktext_p.h>
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#define EXPECT(cond) \
do { \
@@ -84,6 +84,7 @@ private slots:
};
tst_QQuickAccessible::tst_QQuickAccessible()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
@@ -299,7 +300,7 @@ void tst_QQuickAccessible::quickAttachedProperties()
QQuickListView *listview = qobject_cast<QQuickListView *>(object);
QVERIFY(listview != nullptr);
QQuickItem *contentItem = listview->contentItem();
- QQuickText *childItem = QQuickVisualTestUtil::findItem<QQuickText>(contentItem, "acc_text");
+ QQuickText *childItem = QQuickVisualTestUtils::findItem<QQuickText>(contentItem, "acc_text");
QVERIFY(childItem != nullptr);
QObject *attachedObject = QQuickAccessibleAttached::attachedProperties(childItem);
diff --git a/tests/auto/quick/qquickanchors/CMakeLists.txt b/tests/auto/quick/qquickanchors/CMakeLists.txt
index 08a4298145..68da825326 100644
--- a/tests/auto/quick/qquickanchors/CMakeLists.txt
+++ b/tests/auto/quick/qquickanchors/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickanchors
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickanchors.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp b/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
index 128a154492..9c6401c60f 100644
--- a/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
+++ b/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
@@ -35,18 +35,18 @@
#include <QtQuick/private/qquicktext_p.h>
#include <QtQuick/private/qquickanchors_p_p.h>
#include <QtQuick/private/qquickitem_p.h>
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
Q_DECLARE_METATYPE(QQuickAnchors::Anchor)
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_qquickanchors : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickanchors() {}
+ tst_qquickanchors() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void basicAnchors();
diff --git a/tests/auto/quick/qquickanimatedimage/CMakeLists.txt b/tests/auto/quick/qquickanimatedimage/CMakeLists.txt
index e7a026a36f..69894ccffc 100644
--- a/tests/auto/quick/qquickanimatedimage/CMakeLists.txt
+++ b/tests/auto/quick/qquickanimatedimage/CMakeLists.txt
@@ -12,11 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickanimatedimage
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qquickanimatedimage.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -24,6 +20,7 @@ qt_internal_add_test(tst_qquickanimatedimage
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
index 31c3fb9946..2680647453 100644
--- a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
+++ b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
@@ -36,8 +36,8 @@
#include <QSignalSpy>
#include <QtQml/qqmlcontext.h>
-#include "../../shared/testhttpserver.h"
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
Q_DECLARE_METATYPE(QQuickImageBase::Status)
@@ -62,7 +62,7 @@ class tst_qquickanimatedimage : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickanimatedimage() {}
+ tst_qquickanimatedimage() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void cleanup();
diff --git a/tests/auto/quick/qquickanimatedsprite/CMakeLists.txt b/tests/auto/quick/qquickanimatedsprite/CMakeLists.txt
index 9e20d712e6..681c450078 100644
--- a/tests/auto/quick/qquickanimatedsprite/CMakeLists.txt
+++ b/tests/auto/quick/qquickanimatedsprite/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickanimatedsprite
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickanimatedsprite.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -24,6 +21,7 @@ qt_internal_add_test(tst_qquickanimatedsprite
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp b/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
index 7a56c370d5..149c4c02bc 100644
--- a/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
+++ b/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
#include <QtTest/QtTest>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuick/qquickview.h>
#include <QtQuickTest/QtQuickTest>
#include <private/qabstractanimation_p.h>
@@ -42,7 +42,7 @@ class tst_qquickanimatedsprite : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickanimatedsprite(){}
+ tst_qquickanimatedsprite() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/quick/qquickanimations/CMakeLists.txt b/tests/auto/quick/qquickanimations/CMakeLists.txt
index 203fa770fb..cf53e10a1c 100644
--- a/tests/auto/quick/qquickanimations/CMakeLists.txt
+++ b/tests/auto/quick/qquickanimations/CMakeLists.txt
@@ -12,12 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickanimations
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickanimations.cpp
DEFINES
QT_DISABLE_DEPRECATED_BEFORE=0
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -25,6 +22,7 @@ qt_internal_add_test(tst_qquickanimations
Qt::QmlModelsPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp
index 6bc8a05607..f373f53f1b 100644
--- a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp
+++ b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp
@@ -46,13 +46,13 @@
#include <limits.h>
#include <math.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickanimations : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickanimations() {}
+ tst_qquickanimations() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override
diff --git a/tests/auto/quick/qquickanimators/CMakeLists.txt b/tests/auto/quick/qquickanimators/CMakeLists.txt
index 4ad5624f85..b8c8367998 100644
--- a/tests/auto/quick/qquickanimators/CMakeLists.txt
+++ b/tests/auto/quick/qquickanimators/CMakeLists.txt
@@ -12,22 +12,17 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickanimators
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickanimators.cpp
DEFINES
QT_DISABLE_DEPRECATED_BEFORE=0
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickanimators/tst_qquickanimators.cpp b/tests/auto/quick/qquickanimators/tst_qquickanimators.cpp
index 30a1d5a560..f1cfa05d38 100644
--- a/tests/auto/quick/qquickanimators/tst_qquickanimators.cpp
+++ b/tests/auto/quick/qquickanimators/tst_qquickanimators.cpp
@@ -37,10 +37,10 @@
#include <QtQuick/private/qquickanimation_p_p.h>
#include <QtQuick/private/qquickitem_p.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
-using namespace QQuickViewTestUtil;
+using namespace QQuickViewTestUtils;
QT_BEGIN_NAMESPACE
@@ -48,6 +48,9 @@ class tst_Animators: public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_Animators();
+
private slots:
void testMultiWinAnimator_data();
void testMultiWinAnimator();
@@ -55,6 +58,11 @@ private slots:
void testTransitionsWithImplicitFrom();
};
+tst_Animators::tst_Animators()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_Animators::testMultiWinAnimator_data()
{
QTest::addColumn<int>("count");
diff --git a/tests/auto/quick/qquickapplication/CMakeLists.txt b/tests/auto/quick/qquickapplication/CMakeLists.txt
index 53582b4548..431bbc8507 100644
--- a/tests/auto/quick/qquickapplication/CMakeLists.txt
+++ b/tests/auto/quick/qquickapplication/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickapplication
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickapplication.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -24,6 +21,7 @@ qt_internal_add_test(tst_qquickapplication
Qt::QmlPrivate
Qt::Quick
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
index 785475402a..133583e72c 100644
--- a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
+++ b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
@@ -36,7 +36,7 @@
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickapplication : public QQmlDataTest
{
@@ -60,6 +60,7 @@ private:
};
tst_qquickapplication::tst_qquickapplication()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickbehaviors/CMakeLists.txt b/tests/auto/quick/qquickbehaviors/CMakeLists.txt
index e75d0b7973..5904ca48a1 100644
--- a/tests/auto/quick/qquickbehaviors/CMakeLists.txt
+++ b/tests/auto/quick/qquickbehaviors/CMakeLists.txt
@@ -12,17 +12,15 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickbehaviors
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickbehaviors.cpp
bindable.h
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp
index 35423651f9..d1bbdcbd66 100644
--- a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp
+++ b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp
@@ -36,14 +36,14 @@
#include <QtQuick/private/qquickanimation_p.h>
#include <QtQuick/private/qquicksmoothedanimation_p.h>
#include <private/qquickitem_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "bindable.h"
class tst_qquickbehaviors : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickbehaviors() {}
+ tst_qquickbehaviors() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void init() { qApp->processEvents(); } //work around animation timer bug (QTBUG-22865)
diff --git a/tests/auto/quick/qquickborderimage/CMakeLists.txt b/tests/auto/quick/qquickborderimage/CMakeLists.txt
index 7316588123..1030f08083 100644
--- a/tests/auto/quick/qquickborderimage/CMakeLists.txt
+++ b/tests/auto/quick/qquickborderimage/CMakeLists.txt
@@ -12,16 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickborderimage
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickborderimage.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -29,6 +22,7 @@ qt_internal_add_test(tst_qquickborderimage
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
index 32b502c6dc..6c8e637291 100644
--- a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
+++ b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
@@ -42,9 +42,9 @@
#include <QtQuick/qquickview.h>
#include <QtQml/qqmlcontext.h>
-#include "../../shared/testhttpserver.h"
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
@@ -96,6 +96,7 @@ void tst_qquickborderimage::cleanup()
}
tst_qquickborderimage::tst_qquickborderimage()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
@@ -601,7 +602,7 @@ void tst_qquickborderimage::borderImageMesh()
QImage mesh = window->grabWindow();
QString errorMessage;
- QVERIFY2(QQuickVisualTestUtil::compareImages(mesh, nonmesh, &errorMessage),
+ QVERIFY2(QQuickVisualTestUtils::compareImages(mesh, nonmesh, &errorMessage),
qPrintable(errorMessage));
}
#endif
diff --git a/tests/auto/quick/qquickboundaryrule/CMakeLists.txt b/tests/auto/quick/qquickboundaryrule/CMakeLists.txt
index 96395c9956..2a07d8b219 100644
--- a/tests/auto/quick/qquickboundaryrule/CMakeLists.txt
+++ b/tests/auto/quick/qquickboundaryrule/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickboundaryrule
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickboundaryrule.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -28,6 +22,7 @@ qt_internal_add_test(tst_qquickboundaryrule
Qt::Qml
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickboundaryrule/tst_qquickboundaryrule.cpp b/tests/auto/quick/qquickboundaryrule/tst_qquickboundaryrule.cpp
index 75639dba49..ee9321a236 100644
--- a/tests/auto/quick/qquickboundaryrule/tst_qquickboundaryrule.cpp
+++ b/tests/auto/quick/qquickboundaryrule/tst_qquickboundaryrule.cpp
@@ -31,14 +31,14 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquickdraghandler_p.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
class tst_qquickboundaryrule : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickboundaryrule() {}
+ tst_qquickboundaryrule() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void init() { qApp->processEvents(); } //work around animation timer bug (QTBUG-22865)
diff --git a/tests/auto/quick/qquickdeliveryagent/CMakeLists.txt b/tests/auto/quick/qquickdeliveryagent/CMakeLists.txt
index 1a5490effa..32e3cbba8c 100644
--- a/tests/auto/quick/qquickdeliveryagent/CMakeLists.txt
+++ b/tests/auto/quick/qquickdeliveryagent/CMakeLists.txt
@@ -10,21 +10,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickdeliveryagent
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickdeliveryagent.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp b/tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp
index 18a0fb54ae..058cfbc2b7 100644
--- a/tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp
+++ b/tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp
@@ -38,9 +38,9 @@
#include <QtQuick/private/qquickshadereffectsource_p.h>
#include <QtQuick/private/qquicktaphandler_p.h>
#include <QtQuick/private/qquickwindow_p.h>
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
@@ -124,6 +124,7 @@ class tst_qquickdeliveryagent : public QQmlDataTest
Q_OBJECT
public:
tst_qquickdeliveryagent()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
@@ -158,7 +159,7 @@ void tst_qquickdeliveryagent::passiveGrabberOrder()
windowAgent->setObjectName("window");
QVERIFY(subscene.deliveryAgent);
QVERIFY(subscene.deliveryAgent != windowAgent);
- QQuickVisualTestUtil::SignalMultiSpy spy;
+ QQuickVisualTestUtils::SignalMultiSpy spy;
QVERIFY(spy.connectToSignal(rootTap, &QQuickTapHandler::tapped));
QVERIFY(spy.connectToSignal(subsceneTap, &QQuickTapHandler::tapped));
diff --git a/tests/auto/quick/qquickdesignersupport/CMakeLists.txt b/tests/auto/quick/qquickdesignersupport/CMakeLists.txt
index 2cdb7328ce..39412a07f9 100644
--- a/tests/auto/quick/qquickdesignersupport/CMakeLists.txt
+++ b/tests/auto/quick/qquickdesignersupport/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickdesignersupport
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickdesignersupport.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -28,6 +22,7 @@ qt_internal_add_test(tst_qquickdesignersupport
Qt::QmlPrivate
Qt::QuickPrivate
Qt::TestPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp b/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp
index ab01ae3a50..76b7cb5557 100644
--- a/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp
+++ b/tests/auto/quick/qquickdesignersupport/tst_qquickdesignersupport.cpp
@@ -40,17 +40,17 @@
#include <private/qquickstategroup_p.h>
#include <private/qquickpropertychanges_p.h>
#include <private/qquickrectangle_p.h>
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtTest/private/qemulationdetector_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_qquickdesignersupport : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickdesignersupport() {}
+ tst_qquickdesignersupport() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void customData();
diff --git a/tests/auto/quick/qquickdroparea/CMakeLists.txt b/tests/auto/quick/qquickdroparea/CMakeLists.txt
index d66bf23714..d367f72fff 100644
--- a/tests/auto/quick/qquickdroparea/CMakeLists.txt
+++ b/tests/auto/quick/qquickdroparea/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickdroparea
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickdroparea.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -28,6 +22,7 @@ qt_internal_add_test(tst_qquickdroparea
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp
index 593f3a0efb..dbf090bfed 100644
--- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp
+++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp
@@ -37,8 +37,8 @@
#include <qpa/qplatformdrag.h>
#include <qpa/qwindowsysteminterface.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
template <typename T> static T evaluate(QObject *scope, const QString &expression)
{
@@ -60,6 +60,10 @@ template <> void evaluate<void>(QObject *scope, const QString &expression)
class tst_QQuickDropArea: public QQmlDataTest
{
Q_OBJECT
+
+public:
+ tst_QQuickDropArea();
+
private slots:
void containsDrag_internal();
void containsDrag_external();
@@ -81,6 +85,11 @@ private:
QQmlEngine engine;
};
+tst_QQuickDropArea::tst_QQuickDropArea()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickDropArea::containsDrag_internal()
{
QQuickWindow window;
diff --git a/tests/auto/quick/qquickdynamicpropertyanimation/CMakeLists.txt b/tests/auto/quick/qquickdynamicpropertyanimation/CMakeLists.txt
index 78395e4661..75ab9332d0 100644
--- a/tests/auto/quick/qquickdynamicpropertyanimation/CMakeLists.txt
+++ b/tests/auto/quick/qquickdynamicpropertyanimation/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickdynamicpropertyanimation
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickdynamicpropertyanimation.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp b/tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp
index 5251c5aff3..1b1f664841 100644
--- a/tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp
+++ b/tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp
@@ -36,13 +36,13 @@
#include <QtCore/QRect>
#include <QtGui/QColor>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickdynamicpropertyanimation : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickdynamicpropertyanimation() {}
+ tst_qquickdynamicpropertyanimation() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private:
template<class T>
diff --git a/tests/auto/quick/qquickflickable/CMakeLists.txt b/tests/auto/quick/qquickflickable/CMakeLists.txt
index 7c8e802daf..78a54e8106 100644
--- a/tests/auto/quick/qquickflickable/CMakeLists.txt
+++ b/tests/auto/quick/qquickflickable/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickflickable
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickflickable.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 52cf7b5255..9ddcc1098d 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -37,17 +37,17 @@
#include <private/qquicktransition_p.h>
#include <private/qqmlvaluetype_p.h>
#include <math.h>
-#include "../../shared/util.h"
-#include "../shared/geometrytestutil.h"
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/geometrytestutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <qpa/qwindowsysteminterface.h>
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
// an abstract Slider which only handles touch events
class TouchDragArea : public QQuickItem
@@ -147,6 +147,7 @@ class tst_qquickflickable : public QQmlDataTest
Q_OBJECT
public:
tst_qquickflickable()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{}
private slots:
@@ -365,8 +366,8 @@ void tst_qquickflickable::rebound()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("rebound.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -505,8 +506,8 @@ void tst_qquickflickable::pressDelay()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("pressDelay.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -586,8 +587,8 @@ void tst_qquickflickable::nestedPressDelay()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("nestedPressDelay.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -666,8 +667,8 @@ void tst_qquickflickable::filterReplayedPress()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("nestedPressDelay.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -709,8 +710,8 @@ void tst_qquickflickable::nestedClickThenFlick()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("nestedClickThenFlick.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -1062,8 +1063,8 @@ void tst_qquickflickable::movingAndFlicking()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -1225,8 +1226,8 @@ void tst_qquickflickable::movingAndDragging()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -1428,8 +1429,8 @@ void tst_qquickflickable::pressWhileFlicking()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -1509,8 +1510,8 @@ void tst_qquickflickable::flickVelocity()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -1553,8 +1554,8 @@ void tst_qquickflickable::margins()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("margins.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->setTitle(QTest::currentTestFunction());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -1617,8 +1618,8 @@ void tst_qquickflickable::cancelOnHide()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("hide.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject());
@@ -1636,8 +1637,8 @@ void tst_qquickflickable::cancelOnMouseGrab()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("cancel.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -1676,8 +1677,8 @@ void tst_qquickflickable::clickAndDragWhenTransformed()
QScopedPointer<QQuickView> view(new QQuickView);
view->setSource(testFileUrl("transformedFlickable.qml"));
QTRY_COMPARE(view->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(view.data());
- QQuickViewTestUtil::moveMouseAway(view.data());
+ QQuickVisualTestUtils::centerOnScreen(view.data());
+ QQuickVisualTestUtils::moveMouseAway(view.data());
view->show();
QVERIFY(QTest::qWaitForWindowActive(view.data()));
QVERIFY(view->rootObject() != nullptr);
@@ -1730,8 +1731,8 @@ void tst_qquickflickable::flickTwiceUsingTouches()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("longList.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(window->rootObject() != nullptr);
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -1811,8 +1812,8 @@ void tst_qquickflickable::nestedStopAtBounds()
QQuickView view;
view.setSource(testFileUrl("nestedStopAtBounds.qml"));
QTRY_COMPARE(view.status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(&view);
- QQuickViewTestUtil::moveMouseAway(&view);
+ QQuickVisualTestUtils::centerOnScreen(&view);
+ QQuickVisualTestUtils::moveMouseAway(&view);
view.show();
view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -1965,8 +1966,8 @@ void tst_qquickflickable::stopAtBounds()
QQuickView view;
view.setSource(testFileUrl("stopAtBounds.qml"));
QTRY_COMPARE(view.status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(&view);
- QQuickViewTestUtil::moveMouseAway(&view);
+ QQuickVisualTestUtils::centerOnScreen(&view);
+ QQuickVisualTestUtils::moveMouseAway(&view);
view.show();
view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -2070,8 +2071,8 @@ void tst_qquickflickable::nestedMouseAreaUsingTouch()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("nestedmousearea.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(window->rootObject() != nullptr);
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -2116,8 +2117,8 @@ void tst_qquickflickable::nestedSliderUsingTouch()
QScopedPointer<QQuickView> windowPtr(window);
windowPtr->setSource(testFileUrl("nestedSlider.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window);
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickVisualTestUtils::centerOnScreen(window);
+ QQuickVisualTestUtils::moveMouseAway(window);
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != nullptr);
@@ -2155,8 +2156,8 @@ void tst_qquickflickable::pressDelayWithLoader()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("pressDelayWithLoader.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != nullptr);
@@ -2172,8 +2173,8 @@ void tst_qquickflickable::movementFromProgrammaticFlick()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("movementSignals.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -2225,8 +2226,8 @@ void tst_qquickflickable::ratios_smallContent()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("ratios_smallContent.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->setTitle(QTest::currentTestFunction());
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window.data()));
@@ -2251,8 +2252,8 @@ void tst_qquickflickable::contentXYNotTruncatedToInt()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("contentXY.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -2271,8 +2272,8 @@ void tst_qquickflickable::keepGrab()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("keepGrab.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window.data());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickViewTestUtils::centerOnScreen(window.data());
+ QQuickViewTestUtils::moveMouseAway(window.data());
window->show();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -2566,8 +2567,8 @@ void tst_qquickflickable::synchronousDrag()
QQuickView *window = scopedWindow.data();
window->setSource(testFileUrl("longList.qml"));
QTRY_COMPARE(window->status(), QQuickView::Ready);
- QQuickViewTestUtil::centerOnScreen(window);
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickVisualTestUtils::centerOnScreen(window);
+ QQuickVisualTestUtils::moveMouseAway(window);
window->show();
QVERIFY(window->rootObject() != nullptr);
QVERIFY(QTest::qWaitForWindowActive(window));
diff --git a/tests/auto/quick/qquickflipable/CMakeLists.txt b/tests/auto/quick/qquickflipable/CMakeLists.txt
index 95231d7ad9..ac1d79339b 100644
--- a/tests/auto/quick/qquickflipable/CMakeLists.txt
+++ b/tests/auto/quick/qquickflipable/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickflipable
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickflipable.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp b/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp
index b4082b3d34..7106041eda 100644
--- a/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp
+++ b/tests/auto/quick/qquickflipable/tst_qquickflipable.cpp
@@ -34,12 +34,13 @@
#include <QFontMetrics>
#include <QtQuick/private/qquickrectangle_p.h>
#include <math.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickflipable : public QQmlDataTest
{
Q_OBJECT
public:
+ tst_qquickflipable();
private slots:
void create();
@@ -55,6 +56,11 @@ private:
QQmlEngine engine;
};
+tst_qquickflipable::tst_qquickflipable()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qquickflipable::create()
{
QQmlEngine engine;
diff --git a/tests/auto/quick/qquickfocusscope/CMakeLists.txt b/tests/auto/quick/qquickfocusscope/CMakeLists.txt
index dac0f78281..ff64779877 100644
--- a/tests/auto/quick/qquickfocusscope/CMakeLists.txt
+++ b/tests/auto/quick/qquickfocusscope/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickfocusscope
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickfocusscope.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
index e59bb7266c..c38f31a318 100644
--- a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
+++ b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
@@ -34,16 +34,16 @@
#include <private/qquicktextedit_p.h>
#include <QtQuick/private/qquicktext_p.h>
#include <QtQuick/private/qquickfocusscope_p.h>
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_qquickfocusscope : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickfocusscope() {}
+ tst_qquickfocusscope() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void basic();
diff --git a/tests/auto/quick/qquickfontloader/CMakeLists.txt b/tests/auto/quick/qquickfontloader/CMakeLists.txt
index bfaa048bca..dc4a6b068d 100644
--- a/tests/auto/quick/qquickfontloader/CMakeLists.txt
+++ b/tests/auto/quick/qquickfontloader/CMakeLists.txt
@@ -12,11 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickfontloader
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qquickfontloader.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -24,6 +20,7 @@ qt_internal_add_test(tst_qquickfontloader
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp b/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp
index 94d603654d..9983997dc1 100644
--- a/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp
+++ b/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp
@@ -31,8 +31,8 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlcontext.h>
#include <QtQuick/private/qquickfontloader_p.h>
-#include "../../shared/util.h"
-#include "../../shared/testhttpserver.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#include <QtQuick/QQuickView>
#include <QtQuick/QQuickItem>
@@ -59,6 +59,7 @@ private:
};
tst_qquickfontloader::tst_qquickfontloader()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickfontloader_static/CMakeLists.txt b/tests/auto/quick/qquickfontloader_static/CMakeLists.txt
index efdf13c95d..927888ba7c 100644
--- a/tests/auto/quick/qquickfontloader_static/CMakeLists.txt
+++ b/tests/auto/quick/qquickfontloader_static/CMakeLists.txt
@@ -12,12 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickfontloader_static
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickfontloader_static.cpp
DEFINES
QT_DISABLE_DEPRECATED_BEFORE=0
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -25,6 +22,7 @@ qt_internal_add_test(tst_qquickfontloader_static
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp b/tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp
index 7e848ef2fc..01cad92f86 100644
--- a/tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp
+++ b/tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp
@@ -29,7 +29,7 @@
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickView>
#include <QtQml/QQmlComponent>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <qtest.h>
QByteArray qmltemplate("import QtQuick 2.0\n"
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
{
for (int i = 0; i < 3; i++) {
QGuiApplication app(argc, argv);
- QQmlDataTest dataTest;
+ QQmlDataTest dataTest(QT_QMLTEST_DATADIR);
dataTest.initTestCase();
QQuickView window;
QQmlComponent component (window.engine());
diff --git a/tests/auto/quick/qquickframebufferobject/CMakeLists.txt b/tests/auto/quick/qquickframebufferobject/CMakeLists.txt
index 9f242842e6..7d00055533 100644
--- a/tests/auto/quick/qquickframebufferobject/CMakeLists.txt
+++ b/tests/auto/quick/qquickframebufferobject/CMakeLists.txt
@@ -12,13 +12,11 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickframebufferobject
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickframebufferobject.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp b/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp
index 5a77215624..c1d6f483fc 100644
--- a/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp
+++ b/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp
@@ -36,7 +36,7 @@
#include <QtQuick/QQuickFramebufferObject>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#ifndef GL_MAX_SAMPLES
#define GL_MAX_SAMPLES 0x8D57
@@ -143,6 +143,8 @@ class tst_QQuickFramebufferObject: public QQmlDataTest
{
Q_OBJECT
public:
+ tst_QQuickFramebufferObject();
+
private slots:
void initTestCase() override;
void testThatStuffWorks_data();
@@ -151,6 +153,11 @@ private slots:
void testInvalidate();
};
+tst_QQuickFramebufferObject::tst_QQuickFramebufferObject()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickFramebufferObject::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/quick/qquickgraphicsinfo/CMakeLists.txt b/tests/auto/quick/qquickgraphicsinfo/CMakeLists.txt
index 5a45d8aabd..2e18d1fef7 100644
--- a/tests/auto/quick/qquickgraphicsinfo/CMakeLists.txt
+++ b/tests/auto/quick/qquickgraphicsinfo/CMakeLists.txt
@@ -12,13 +12,11 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickgraphicsinfo
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickgraphicsinfo.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
index 09c423890b..f7fefef72a 100644
--- a/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
+++ b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
@@ -33,16 +33,24 @@
#include <QtQuick/qquickview.h>
#include <QtQuick/qsgrendererinterface.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QQuickGraphicsInfo : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickGraphicsInfo();
+
private slots:
void testProperties();
};
+tst_QQuickGraphicsInfo::tst_QQuickGraphicsInfo()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickGraphicsInfo::testProperties()
{
QQuickView view;
diff --git a/tests/auto/quick/qquickgridview/CMakeLists.txt b/tests/auto/quick/qquickgridview/CMakeLists.txt
index 07dd48c0a8..72c7fc352b 100644
--- a/tests/auto/quick/qquickgridview/CMakeLists.txt
+++ b/tests/auto/quick/qquickgridview/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickgridview
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickgridview.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -29,6 +23,7 @@ qt_internal_add_test(tst_qquickgridview
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index c625f99c00..b31abdb99a 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -41,9 +41,9 @@
#include <QtQuick/private/qquickgridview_p.h>
#include <QtQuick/private/qquicktext_p.h>
#include <QtQmlModels/private/qqmllistmodel_p.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtGui/qguiapplication.h>
#include "qplatformdefs.h"
@@ -55,8 +55,8 @@ Q_DECLARE_METATYPE(QQuickItemView::VerticalLayoutDirection)
Q_DECLARE_METATYPE(QQuickItemView::PositionMode)
Q_DECLARE_METATYPE(Qt::Key)
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
#define SHARE_VIEWS
@@ -318,7 +318,9 @@ private:
QString testForView;
};
-tst_QQuickGridView::tst_QQuickGridView() : m_view(nullptr)
+tst_QQuickGridView::tst_QQuickGridView()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+ , m_view(nullptr)
{
}
@@ -3725,7 +3727,7 @@ void tst_QQuickGridView::resizeGrid()
ctxt->setContextProperty("testRightToLeft", layoutDirection == Qt::RightToLeft);
ctxt->setContextProperty("testBottomToTop", verticalLayoutDirection == QQuickGridView::BottomToTop);
window->setSource(testFileUrl("resizegrid.qml"));
- QQuickViewTestUtil::centerOnScreen(window, window->size());
+ QQuickViewTestUtils::centerOnScreen(window, window->size());
window->show();
qApp->processEvents();
@@ -4332,7 +4334,7 @@ void tst_QQuickGridView::snapToRow()
QQuickView *window = getView();
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickViewTestUtils::moveMouseAway(window);
window->setSource(testFileUrl("snapToRow.qml"));
window->show();
qApp->processEvents();
@@ -4451,7 +4453,7 @@ void tst_QQuickGridView::snapOneRow()
qreal flickDuration = 180 * flickSlowdown;
QQuickView *window = getView();
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickViewTestUtils::moveMouseAway(window);
window->setSource(testFileUrl("snapOneRow.qml"));
window->show();
diff --git a/tests/auto/quick/qquickimage/CMakeLists.txt b/tests/auto/quick/qquickimage/CMakeLists.txt
index b7e5479639..b3e2d3da2f 100644
--- a/tests/auto/quick/qquickimage/CMakeLists.txt
+++ b/tests/auto/quick/qquickimage/CMakeLists.txt
@@ -12,16 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickimage
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickimage.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -29,6 +22,7 @@ qt_internal_add_test(tst_qquickimage
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
index 16f742f0aa..36c4b60718 100644
--- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp
+++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
@@ -47,13 +47,13 @@
#include <QQuickImageProvider>
#include <QQmlAbstractUrlInterceptor>
-#include "../../shared/util.h"
-#include "../../shared/testhttpserver.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
// #define DEBUG_WRITE_OUTPUT
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
Q_DECLARE_METATYPE(QQuickImageBase::Status)
@@ -110,6 +110,7 @@ private:
};
tst_qquickimage::tst_qquickimage()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickitem/CMakeLists.txt b/tests/auto/quick/qquickitem/CMakeLists.txt
index cbc91f8f50..3b10bdaa33 100644
--- a/tests/auto/quick/qquickitem/CMakeLists.txt
+++ b/tests/auto/quick/qquickitem/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickitem
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickitem.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index b36cf88c89..e4fe6df888 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -41,8 +41,8 @@
#include <QDebug>
#include <QTimer>
#include <QQmlEngine>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
#include <QSignalSpy>
#include <QTranslator>
#include <QtCore/qregularexpression.h>
@@ -181,6 +181,7 @@ class tst_qquickitem : public QQmlDataTest
{
Q_OBJECT
public:
+ tst_qquickitem();
private slots:
void initTestCase() override;
@@ -263,6 +264,11 @@ private:
}
};
+tst_qquickitem::tst_qquickitem()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qquickitem::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/quick/qquickitem2/CMakeLists.txt b/tests/auto/quick/qquickitem2/CMakeLists.txt
index 7be8bb2ab0..6abb80dc79 100644
--- a/tests/auto/quick/qquickitem2/CMakeLists.txt
+++ b/tests/auto/quick/qquickitem2/CMakeLists.txt
@@ -12,17 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickitem2
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
tst_qquickitem.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
LIBRARIES
Qt::TestPrivate
TESTDATA ${test_data}
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 10b9bf5972..72404bd161 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -40,13 +40,13 @@
#include <QtQuick/private/qquickitemchangelistener_p.h>
#include <QtGui/qstylehints.h>
#include <private/qquickitem_p.h>
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/viewtestutil.h"
-#include "../../shared/platforminputcontext.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/platforminputcontext_p.h>
#include <QtTest/private/qpropertytesthelper_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
@@ -352,6 +352,7 @@ public:
QML_DECLARE_TYPE(TabFenceItem2);
tst_QQuickItem::tst_QQuickItem()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickitemlayer/CMakeLists.txt b/tests/auto/quick/qquickitemlayer/CMakeLists.txt
index 37103b0c31..a17d57a72d 100644
--- a/tests/auto/quick/qquickitemlayer/CMakeLists.txt
+++ b/tests/auto/quick/qquickitemlayer/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickitemlayer
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickitemlayer.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
index 0fbd9cc24e..ae6947f01b 100644
--- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
+++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
@@ -34,7 +34,7 @@
#include <qopenglcontext.h>
#include <qopenglfunctions.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformintegration.h>
@@ -97,7 +97,7 @@ bool isOffscreen()
const char skipOffscreenMsg[] =
"Skipping due to grabWindow not functional on offscreen/minimal platformsi (QTBUG-63185)";
-tst_QQuickItemLayer::tst_QQuickItemLayer() { }
+tst_QQuickItemLayer::tst_QQuickItemLayer() : QQmlDataTest(QT_QMLTEST_DATADIR) { }
void tst_QQuickItemLayer::initTestCase()
{
diff --git a/tests/auto/quick/qquicklistview/CMakeLists.txt b/tests/auto/quick/qquicklistview/CMakeLists.txt
index 761d515eaf..133aca1f7e 100644
--- a/tests/auto/quick/qquicklistview/CMakeLists.txt
+++ b/tests/auto/quick/qquicklistview/CMakeLists.txt
@@ -12,10 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicklistview
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
incrementalmodel.cpp incrementalmodel.h
proxytestinnermodel.cpp proxytestinnermodel.h
randomsortmodel.cpp randomsortmodel.h
@@ -23,8 +19,6 @@ qt_internal_add_test(tst_qquicklistview
tst_qquicklistview.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -33,6 +27,7 @@ qt_internal_add_test(tst_qquicklistview
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index 2b017aa1fc..66ed8fdd3b 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -46,9 +46,9 @@
#include <QtQmlModels/private/qqmllistmodel_p.h>
#include <QtQmlModels/private/qqmldelegatemodel_p.h>
#include <qpa/qwindowsysteminterface.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include "incrementalmodel.h"
#include "proxytestinnermodel.h"
#include "randomsortmodel.h"
@@ -62,8 +62,8 @@ Q_DECLARE_METATYPE(QQuickListView::Orientation)
Q_DECLARE_METATYPE(QQuickFlickable::FlickableDirection)
Q_DECLARE_METATYPE(Qt::Key)
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
#define SHARE_VIEWS
@@ -401,7 +401,9 @@ public:
int mCacheBuffer;
};
-tst_QQuickListView::tst_QQuickListView() : m_view(nullptr)
+tst_QQuickListView::tst_QQuickListView()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+ , m_view(nullptr)
{
}
@@ -2309,7 +2311,7 @@ void tst_QQuickListView::sectionsDragOutsideBounds()
QFETCH(int, cacheBuffer);
QQuickView *window = getView();
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickViewTestUtils::moveMouseAway(window);
QaimModel model;
for (int i = 0; i < 10; i++)
@@ -5170,7 +5172,7 @@ void tst_QQuickListView::marginsResize()
QQuickView *window = getView();
window->setSource(testFileUrl("margins2.qml"));
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickViewTestUtils::moveMouseAway(window);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -5306,7 +5308,7 @@ void tst_QQuickListView::snapToItem()
QFETCH(qreal, startExtent);
QQuickView *window = getView();
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickViewTestUtils::moveMouseAway(window);
window->setSource(testFileUrl("snapToItem.qml"));
window->show();
@@ -5990,7 +5992,7 @@ void tst_QQuickListView::snapOneItemResize_QTBUG_43555()
QScopedPointer<QQuickView> window(createView());
window->resize(QSize(100, 320));
window->setResizeMode(QQuickView::SizeRootObjectToView);
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("snapOneItemResize.qml"));
window->show();
@@ -6304,7 +6306,7 @@ void tst_QQuickListView::snapOneItem()
qreal flickDuration = 180 * flickSlowdown;
QQuickView *window = getView();
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickViewTestUtils::moveMouseAway(window);
window->setSource(testFileUrl("snapOneItem.qml"));
window->show();
@@ -7939,7 +7941,7 @@ void tst_QQuickListView::matchItemLists(const QVariantList &itemLists, const QLi
void tst_QQuickListView::flickBeyondBounds()
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("flickBeyondBoundsBug.qml"));
window->show();
@@ -7981,7 +7983,7 @@ void tst_QQuickListView::flickBothDirections()
QFETCH(QPointF, targetPos);
QQuickView *window = getView();
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickViewTestUtils::moveMouseAway(window);
QQmlContext *ctxt = window->rootContext();
ctxt->setContextProperty("initialOrientation", initValues ? orientation : QQuickListView::Vertical);
@@ -8154,7 +8156,7 @@ void tst_QQuickListView::delayedChanges_QTBUG_30555()
void tst_QQuickListView::outsideViewportChangeNotAffectingView()
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("outsideViewportChangeNotAffectingView.qml"));
QQuickListView *listview = window->rootObject()->findChild<QQuickListView*>();
@@ -8188,7 +8190,7 @@ void tst_QQuickListView::outsideViewportChangeNotAffectingView()
void tst_QQuickListView::testProxyModelChangedAfterMove()
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("proxytest.qml"));
QQuickListView *listview = window->rootObject()->findChild<QQuickListView*>();
@@ -9918,7 +9920,7 @@ void tst_QQuickListView::reuse_checkThatItemsAreReused()
void tst_QQuickListView::dragOverFloatingHeaderOrFooter() // QTBUG-74046
{
QQuickView *window = getView();
- QQuickViewTestUtil::moveMouseAway(window);
+ QQuickViewTestUtils::moveMouseAway(window);
window->setSource(testFileUrl("qtbug63974.qml"));
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
diff --git a/tests/auto/quick/qquicklistview2/CMakeLists.txt b/tests/auto/quick/qquicklistview2/CMakeLists.txt
index 8cad53c0d2..944d75cf94 100644
--- a/tests/auto/quick/qquicklistview2/CMakeLists.txt
+++ b/tests/auto/quick/qquicklistview2/CMakeLists.txt
@@ -6,15 +6,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicklistview2
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquicklistview2.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +17,7 @@ qt_internal_add_test(tst_qquicklistview2
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp b/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp
index f74a9805b2..37cd6786b3 100644
--- a/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp
+++ b/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp
@@ -32,12 +32,12 @@
#include <QtQuick/private/qquicklistview_p.h>
#include <QtQuickTest/QtQuickTest>
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
class tst_QQuickListView2 : public QQmlDataTest
{
@@ -52,6 +52,7 @@ private slots:
};
tst_QQuickListView2::tst_QQuickListView2()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickloader/CMakeLists.txt b/tests/auto/quick/qquickloader/CMakeLists.txt
index 785d5348a6..87f57e1095 100644
--- a/tests/auto/quick/qquickloader/CMakeLists.txt
+++ b/tests/auto/quick/qquickloader/CMakeLists.txt
@@ -12,16 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickloader
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickloader.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -29,6 +22,7 @@ qt_internal_add_test(tst_qquickloader
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
index 4a2c7b0af0..61168ff5da 100644
--- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp
+++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
@@ -36,9 +36,9 @@
#include <QtQuick/qquickview.h>
#include <private/qquickloader_p.h>
#include <private/qquickwindowmodule_p.h>
-#include "testhttpserver.h"
-#include "../../shared/util.h"
-#include "../shared/geometrytestutil.h"
+#include <QtQuickTestUtils/private/geometrytestutils_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#include <QQmlApplicationEngine>
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
@@ -138,6 +138,7 @@ private slots:
Q_DECLARE_METATYPE(QList<QQmlError>)
tst_QQuickLoader::tst_QQuickLoader()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qmlRegisterType<SlowComponent>("LoaderTest", 1, 0, "SlowComponent");
qRegisterMetaType<QList<QQmlError>>();
diff --git a/tests/auto/quick/qquickmousearea/CMakeLists.txt b/tests/auto/quick/qquickmousearea/CMakeLists.txt
index 7061c92384..ae4d31b1df 100644
--- a/tests/auto/quick/qquickmousearea/CMakeLists.txt
+++ b/tests/auto/quick/qquickmousearea/CMakeLists.txt
@@ -12,16 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickmousearea
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickmousearea.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -29,6 +22,7 @@ qt_internal_add_test(tst_qquickmousearea
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
index 1e9f76c8ce..0cbb047048 100644
--- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
+++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
@@ -36,8 +36,8 @@
#include <QtQuick/qquickview.h>
#include <QtQml/qqmlcontext.h>
#include <QtQml/qqmlengine.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
#include <QtGui/qstylehints.h>
#include <QtGui/QCursor>
#include <QtGui/QScreen>
@@ -89,6 +89,7 @@ class tst_QQuickMouseArea: public QQmlDataTest
Q_OBJECT
public:
tst_QQuickMouseArea()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qmlRegisterType<CircleMask>("Test", 1, 0, "CircleMask");
qmlRegisterType<EventSender>("Test", 1, 0, "EventSender");
diff --git a/tests/auto/quick/qquickmultipointtoucharea/CMakeLists.txt b/tests/auto/quick/qquickmultipointtoucharea/CMakeLists.txt
index 1902b3fefa..070d978215 100644
--- a/tests/auto/quick/qquickmultipointtoucharea/CMakeLists.txt
+++ b/tests/auto/quick/qquickmultipointtoucharea/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickmultipointtoucharea
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickmultipointtoucharea.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp b/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp
index 056028b3f0..8b143d6ea8 100644
--- a/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp
+++ b/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp
@@ -38,8 +38,8 @@
#include <QtGui/QScreen>
#include <QtGui/private/qevent_p.h>
#include <QtGui/private/qpointingdevice_p.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
@@ -47,7 +47,7 @@ class tst_QQuickMultiPointTouchArea : public QQmlDataTest
{
Q_OBJECT
public:
- tst_QQuickMultiPointTouchArea() { }
+ tst_QQuickMultiPointTouchArea() : QQmlDataTest(QT_QMLTEST_DATADIR) { }
private slots:
void cleanupTestCase() {}
diff --git a/tests/auto/quick/qquickpalette/CMakeLists.txt b/tests/auto/quick/qquickpalette/CMakeLists.txt
index 98036c0a38..eefecc7ac3 100644
--- a/tests/auto/quick/qquickpalette/CMakeLists.txt
+++ b/tests/auto/quick/qquickpalette/CMakeLists.txt
@@ -6,14 +6,13 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpalette
SOURCES
- ../../shared/util.h
- ../../shared/util.cpp
tst_qquickpalette.cpp
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickpalette/tst_qquickpalette.cpp b/tests/auto/quick/qquickpalette/tst_qquickpalette.cpp
index cca7b54a8a..144bc84fda 100644
--- a/tests/auto/quick/qquickpalette/tst_qquickpalette.cpp
+++ b/tests/auto/quick/qquickpalette/tst_qquickpalette.cpp
@@ -47,7 +47,7 @@
#include <QtQuick/private/qquickabstractpaletteprovider_p.h>
#include <QtQuick/private/qquickpalettecolorprovider_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
// Use this to get a more descriptive failure message (QTBUG-87039).
#define COMPARE_PALETTES(actualPalette, expectedPalette) \
@@ -59,6 +59,9 @@ class tst_QQuickPalette : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickPalette();
+
private Q_SLOTS:
void resolvingColor();
void resolvingColor_data();
@@ -92,6 +95,11 @@ private Q_SLOTS:
using GroupGetter = QQuickColorGroup* (QQuickPalette::* )() const;
Q_DECLARE_METATYPE(GroupGetter);
+tst_QQuickPalette::tst_QQuickPalette()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickPalette::resolvingColor()
{
QFETCH(QPalette::ColorGroup, colorGroup);
diff --git a/tests/auto/quick/qquickpath/CMakeLists.txt b/tests/auto/quick/qquickpath/CMakeLists.txt
index c616519987..fd1d003e80 100644
--- a/tests/auto/quick/qquickpath/CMakeLists.txt
+++ b/tests/auto/quick/qquickpath/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpath
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickpath.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickpath/tst_qquickpath.cpp b/tests/auto/quick/qquickpath/tst_qquickpath.cpp
index c89ce730a8..c1c34ddc06 100644
--- a/tests/auto/quick/qquickpath/tst_qquickpath.cpp
+++ b/tests/auto/quick/qquickpath/tst_qquickpath.cpp
@@ -31,13 +31,13 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQuick/private/qquickpath_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QuickPath : public QQmlDataTest
{
Q_OBJECT
public:
- tst_QuickPath() {}
+ tst_QuickPath() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void arc();
diff --git a/tests/auto/quick/qquickpathview/CMakeLists.txt b/tests/auto/quick/qquickpathview/CMakeLists.txt
index 2f3bd53500..167fdeea9f 100644
--- a/tests/auto/quick/qquickpathview/CMakeLists.txt
+++ b/tests/auto/quick/qquickpathview/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpathview
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickpathview.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -29,6 +23,7 @@ qt_internal_add_test(tst_qquickpathview
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index 4011ac930c..8f45368f1c 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -45,16 +45,16 @@
#include <QStringListModel>
#include <QFile>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <math.h>
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
Q_DECLARE_METATYPE(QQuickPathView::HighlightRangeMode)
Q_DECLARE_METATYPE(QQuickPathView::PositionMode)
@@ -186,6 +186,7 @@ private:
};
tst_QQuickPathView::tst_QQuickPathView()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
@@ -1515,7 +1516,7 @@ void tst_QQuickPathView::undefinedPath()
void tst_QQuickPathView::mouseDrag()
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
@@ -1585,7 +1586,7 @@ void tst_QQuickPathView::mouseDrag()
void tst_QQuickPathView::nestedMouseAreaDrag()
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("nestedmousearea.qml"));
window->show();
window->requestActivate();
@@ -1608,7 +1609,7 @@ void tst_QQuickPathView::nestedMouseAreaDrag()
void tst_QQuickPathView::flickNClick() // QTBUG-77173
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("nestedmousearea2.qml"));
window->show();
window->requestActivate();
@@ -1903,7 +1904,7 @@ void tst_QQuickPathView::cancelDrag()
{
QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("dragpath.qml"));
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->show();
window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -1950,7 +1951,7 @@ void tst_QQuickPathView::maximumFlickVelocity()
{
QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("dragpath.qml"));
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->show();
window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
@@ -1996,7 +1997,7 @@ void tst_QQuickPathView::snapToItem()
QFETCH(bool, enforceRange);
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("panels.qml"));
window->show();
window->requestActivate();
@@ -2040,7 +2041,7 @@ void tst_QQuickPathView::snapOneItem()
QFETCH(bool, enforceRange);
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("panels.qml"));
window->show();
window->requestActivate();
@@ -2309,7 +2310,7 @@ void tst_QQuickPathView::changePathDuringRefill()
void tst_QQuickPathView::nestedinFlickable()
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("nestedInFlickable.qml"));
window->show();
window->requestActivate();
@@ -2417,7 +2418,7 @@ void tst_QQuickPathView::nestedinFlickable()
void tst_QQuickPathView::ungrabNestedinFlickable()
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("ungrabNestedinFlickable.qml"));
window->show();
window->requestActivate();
@@ -2451,7 +2452,7 @@ void tst_QQuickPathView::ungrabNestedinFlickable()
void tst_QQuickPathView::flickableDelegate()
{
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("flickableDelegate.qml"));
window->show();
window->requestActivate();
@@ -2684,7 +2685,7 @@ void tst_QQuickPathView::movementDirection()
QFETCH(qreal, tooffset);
QScopedPointer<QQuickView> window(createView());
- QQuickViewTestUtil::moveMouseAway(window.data());
+ QQuickVisualTestUtils::moveMouseAway(window.data());
window->setSource(testFileUrl("movementDirection.qml"));
window->show();
window->requestActivate();
diff --git a/tests/auto/quick/qquickpincharea/CMakeLists.txt b/tests/auto/quick/qquickpincharea/CMakeLists.txt
index 4f417366a1..62e9bf3f3b 100644
--- a/tests/auto/quick/qquickpincharea/CMakeLists.txt
+++ b/tests/auto/quick/qquickpincharea/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpincharea
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickpincharea.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickpincharea/tst_qquickpincharea.cpp b/tests/auto/quick/qquickpincharea/tst_qquickpincharea.cpp
index 55fb07f744..fd84123ff3 100644
--- a/tests/auto/quick/qquickpincharea/tst_qquickpincharea.cpp
+++ b/tests/auto/quick/qquickpincharea/tst_qquickpincharea.cpp
@@ -35,14 +35,14 @@
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuick/qquickview.h>
#include <QtQml/qqmlcontext.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
class tst_QQuickPinchArea: public QQmlDataTest
{
Q_OBJECT
public:
- tst_QQuickPinchArea() { }
+ tst_QQuickPinchArea() : QQmlDataTest(QT_QMLTEST_DATADIR) { }
private slots:
void cleanupTestCase();
void pinchProperties();
diff --git a/tests/auto/quick/qquickpixmapcache/CMakeLists.txt b/tests/auto/quick/qquickpixmapcache/CMakeLists.txt
index e50a6eb6a8..3e20d02657 100644
--- a/tests/auto/quick/qquickpixmapcache/CMakeLists.txt
+++ b/tests/auto/quick/qquickpixmapcache/CMakeLists.txt
@@ -12,11 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpixmapcache
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qquickpixmapcache.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Concurrent
Qt::CorePrivate
@@ -25,6 +21,7 @@ qt_internal_add_test(tst_qquickpixmapcache
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
index 13a3378905..88c0feac6a 100644
--- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
+++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
@@ -32,8 +32,8 @@
#include <QtQuick/qquickimageprovider.h>
#include <QtQml/QQmlComponent>
#include <QNetworkReply>
-#include "../../shared/util.h"
-#include "testhttpserver.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#if QT_CONFIG(concurrent)
#include <qtconcurrentrun.h>
@@ -46,7 +46,7 @@ class tst_qquickpixmapcache : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickpixmapcache() {}
+ tst_qquickpixmapcache() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void initTestCase() override;
diff --git a/tests/auto/quick/qquickpositioners/CMakeLists.txt b/tests/auto/quick/qquickpositioners/CMakeLists.txt
index e72958c6cd..a7732c1493 100644
--- a/tests/auto/quick/qquickpositioners/CMakeLists.txt
+++ b/tests/auto/quick/qquickpositioners/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpositioners
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickpositioners.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -28,6 +22,7 @@ qt_internal_add_test(tst_qquickpositioners
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
index 1b8fc638c6..2da96a60b7 100644
--- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
+++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
@@ -34,12 +34,12 @@
#include <QtQuickTest/QtQuickTest>
#include <private/qquickitem_p.h>
#include <qqmlexpression.h>
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
@@ -306,6 +306,7 @@ void tst_qquickpositioners::moveTransitions_flow_data()
}
tst_qquickpositioners::tst_qquickpositioners()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
@@ -1023,7 +1024,7 @@ void tst_qquickpositioners::populateTransitions(const QString &positionerObjectN
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
+ QScopedPointer<QQuickView> window(QQuickViewTestUtils::createView());
window->setInitialProperties({
{"usePopulateTransition", usePopulateTransition},
@@ -1111,7 +1112,7 @@ void tst_qquickpositioners::addTransitions(const QString &positionerObjectName)
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
+ QScopedPointer<QQuickView> window(QQuickViewTestUtils::createView());
window->setInitialProperties({
{"usePopulateTransition", QVariant(false)},
{"enableAddTransition", QVariant(true)},
@@ -1235,7 +1236,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
+ QScopedPointer<QQuickView> window(QQuickViewTestUtils::createView());
window->setInitialProperties({
{"usePopulateTransition", QVariant(false)},
{"enableAddTransition", QVariant(false)},
diff --git a/tests/auto/quick/qquickrectangle/CMakeLists.txt b/tests/auto/quick/qquickrectangle/CMakeLists.txt
index 5ccb12a3f7..c292acdfff 100644
--- a/tests/auto/quick/qquickrectangle/CMakeLists.txt
+++ b/tests/auto/quick/qquickrectangle/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickrectangle
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickrectangle.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
index 536280337a..54935e5fda 100644
--- a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
+++ b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
@@ -35,7 +35,7 @@
#include <private/qquickitem_p.h>
#include <private/qquickrectangle_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickrectangle : public QQmlDataTest
{
@@ -57,6 +57,7 @@ private:
};
tst_qquickrectangle::tst_qquickrectangle()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickrendercontrol/CMakeLists.txt b/tests/auto/quick/qquickrendercontrol/CMakeLists.txt
index 46cfc1513c..4015785def 100644
--- a/tests/auto/quick/qquickrendercontrol/CMakeLists.txt
+++ b/tests/auto/quick/qquickrendercontrol/CMakeLists.txt
@@ -6,16 +6,14 @@
qt_internal_add_test(tst_qquickrendercontrol
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickrendercontrol.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
)
#### Keys ignored in scope 1:.:.:qquickrendercontrol.pro:<TRUE>:
diff --git a/tests/auto/quick/qquickrendercontrol/tst_qquickrendercontrol.cpp b/tests/auto/quick/qquickrendercontrol/tst_qquickrendercontrol.cpp
index ee0d9d271e..3130272e71 100644
--- a/tests/auto/quick/qquickrendercontrol/tst_qquickrendercontrol.cpp
+++ b/tests/auto/quick/qquickrendercontrol/tst_qquickrendercontrol.cpp
@@ -39,7 +39,7 @@
#include <QQmlEngine>
#include <QQmlComponent>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformintegration.h>
@@ -79,6 +79,9 @@ class tst_RenderControl : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_RenderControl();
+
private slots:
void initTestCase() override;
void cleanupTestCase();
@@ -93,6 +96,11 @@ private:
AnimationDriver *animDriver;
};
+tst_RenderControl::tst_RenderControl()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_RenderControl::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/quick/qquickrepeater/CMakeLists.txt b/tests/auto/quick/qquickrepeater/CMakeLists.txt
index 3e7fda53c0..b65573596a 100644
--- a/tests/auto/quick/qquickrepeater/CMakeLists.txt
+++ b/tests/auto/quick/qquickrepeater/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickrepeater
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickrepeater.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -28,6 +22,7 @@ qt_internal_add_test(tst_qquickrepeater
Qt::QmlModelsPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
index 3634a3ea3c..168c0561d0 100644
--- a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
+++ b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
@@ -39,12 +39,12 @@
#include <QtQmlModels/private/qqmlobjectmodel_p.h>
#include <QtGui/qstandarditemmodel.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
class tst_QQuickRepeater : public QQmlDataTest
@@ -109,6 +109,7 @@ private:
};
tst_QQuickRepeater::tst_QQuickRepeater()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickscreen/CMakeLists.txt b/tests/auto/quick/qquickscreen/CMakeLists.txt
index 65c5538be3..a4fca2bca4 100644
--- a/tests/auto/quick/qquickscreen/CMakeLists.txt
+++ b/tests/auto/quick/qquickscreen/CMakeLists.txt
@@ -6,16 +6,14 @@
qt_internal_add_test(tst_qquickscreen
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickscreen.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
)
## Scopes:
diff --git a/tests/auto/quick/qquickscreen/tst_qquickscreen.cpp b/tests/auto/quick/qquickscreen/tst_qquickscreen.cpp
index ff6031619c..a77839afa4 100644
--- a/tests/auto/quick/qquickscreen/tst_qquickscreen.cpp
+++ b/tests/auto/quick/qquickscreen/tst_qquickscreen.cpp
@@ -32,18 +32,26 @@
#include <QtQuick/QQuickItem>
#include <QtQuick/QQuickView>
#include <QtGui/QScreen>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuick/private/qquickscreen_p.h>
#include <QDebug>
class tst_qquickscreen : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qquickscreen();
+
private slots:
void basicProperties();
void screenOnStartup();
void fullScreenList();
};
+tst_qquickscreen::tst_qquickscreen()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qquickscreen::basicProperties()
{
QQuickView view;
diff --git a/tests/auto/quick/qquickshadereffect/CMakeLists.txt b/tests/auto/quick/qquickshadereffect/CMakeLists.txt
index 6eebadeedf..100890ff5b 100644
--- a/tests/auto/quick/qquickshadereffect/CMakeLists.txt
+++ b/tests/auto/quick/qquickshadereffect/CMakeLists.txt
@@ -6,16 +6,14 @@
qt_internal_add_test(tst_qquickshadereffect
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickshadereffect.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
)
# Resources:
diff --git a/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp b/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
index 070eba32c0..176001b599 100644
--- a/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
+++ b/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
@@ -34,7 +34,7 @@
#include <QMatrix4x4>
#include <QtQuick/QQuickView>
#include <QtQml/QQmlEngine>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class TestShaderEffect : public QQuickShaderEffect
{
@@ -102,6 +102,7 @@ private:
};
tst_qquickshadereffect::tst_qquickshadereffect()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qmlRegisterType<TestShaderEffect>("ShaderEffectTest", 1, 0, "TestShaderEffect");
}
diff --git a/tests/auto/quick/qquickshape/CMakeLists.txt b/tests/auto/quick/qquickshape/CMakeLists.txt
index 325d812ed2..77e5fb49a4 100644
--- a/tests/auto/quick/qquickshape/CMakeLists.txt
+++ b/tests/auto/quick/qquickshape/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickshape
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickshape.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -28,6 +22,7 @@ qt_internal_add_test(tst_qquickshape
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickShapesPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickshape/tst_qquickshape.cpp b/tests/auto/quick/qquickshape/tst_qquickshape.cpp
index 3a26f7e382..14f280e354 100644
--- a/tests/auto/quick/qquickshape/tst_qquickshape.cpp
+++ b/tests/auto/quick/qquickshape/tst_qquickshape.cpp
@@ -36,12 +36,12 @@
#include <QtQuickShapes/private/qquickshape_p.h>
#include <QStandardPaths>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
class PolygonProvider : public QObject
{
@@ -93,6 +93,7 @@ private:
};
tst_QQuickShape::tst_QQuickShape()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
// Force the software backend to get reliable rendering results regardless of the hw and drivers.
QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
@@ -293,7 +294,7 @@ void tst_QQuickShape::render()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- QVERIFY2(QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage),
+ QVERIFY2(QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage),
qPrintable(errorMessage));
}
@@ -317,7 +318,7 @@ void tst_QQuickShape::renderWithMultipleSp()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- QVERIFY2(QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage),
+ QVERIFY2(QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage),
qPrintable(errorMessage));
}
@@ -341,7 +342,7 @@ void tst_QQuickShape::radialGrad()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- QVERIFY2(QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage),
+ QVERIFY2(QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage),
qPrintable(errorMessage));
}
@@ -365,7 +366,7 @@ void tst_QQuickShape::conicalGrad()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- QVERIFY2(QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage),
+ QVERIFY2(QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage),
qPrintable(errorMessage));
}
@@ -389,7 +390,7 @@ void tst_QQuickShape::renderPolyline()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- const bool res = QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage);
+ const bool res = QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage);
if (!res) { // For visual inspection purposes.
QTest::qWait(5000);
const QString &tempLocation = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
@@ -418,7 +419,7 @@ void tst_QQuickShape::renderMultiline()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- const bool res = QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage);
+ const bool res = QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage);
if (!res) { // For visual inspection purposes.
QTest::qWait(5000);
const QString &tempLocation = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
@@ -484,7 +485,7 @@ void tst_QQuickShape::polylineDataTypes()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- const bool res = QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage);
+ const bool res = QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage);
if (!res) { // For visual inspection purposes.
QTest::qWait(5000);
const QString &tempLocation = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
@@ -635,7 +636,7 @@ void tst_QQuickShape::multilineDataTypes()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- const bool res = QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage);
+ const bool res = QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage);
if (!res) { // For visual inspection purposes.
QTest::qWait(5000);
const QString &tempLocation = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
@@ -683,7 +684,7 @@ void tst_QQuickShape::multilineStronglyTyped()
QString errorMessage;
const QImage actualImg = img.convertToFormat(refImg.format());
- const bool res = QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage);
+ const bool res = QQuickVisualTestUtils::compareImages(actualImg, refImg, &errorMessage);
if (!res) { // For visual inspection purposes.
QTest::qWait(5000);
const QString &tempLocation = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
diff --git a/tests/auto/quick/qquickshortcut/CMakeLists.txt b/tests/auto/quick/qquickshortcut/CMakeLists.txt
index dda488abff..8887b9ba23 100644
--- a/tests/auto/quick/qquickshortcut/CMakeLists.txt
+++ b/tests/auto/quick/qquickshortcut/CMakeLists.txt
@@ -12,14 +12,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickshortcut
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickshortcut.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Qml
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp b/tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp
index 6351b97fb3..0655b053e3 100644
--- a/tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp
+++ b/tests/auto/quick/qquickshortcut/tst_qquickshortcut.cpp
@@ -35,12 +35,15 @@
#include <QtQuickWidgets/qquickwidget.h>
#endif
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_QQuickShortcut : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickShortcut();
+
private slots:
void standardShortcuts_data();
void standardShortcuts();
@@ -83,6 +86,11 @@ static QVariant shortcutMap(const QVariant &key, bool enabled = true, bool autoR
return shortcutMap(key, Qt::WindowShortcut, enabled, autoRepeat);
}
+tst_QQuickShortcut::tst_QQuickShortcut()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickShortcut::standardShortcuts_data()
{
QTest::addColumn<QKeySequence::StandardKey>("standardKey");
diff --git a/tests/auto/quick/qquicksmoothedanimation/CMakeLists.txt b/tests/auto/quick/qquicksmoothedanimation/CMakeLists.txt
index f487e786ab..18dc389ad2 100644
--- a/tests/auto/quick/qquicksmoothedanimation/CMakeLists.txt
+++ b/tests/auto/quick/qquicksmoothedanimation/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicksmoothedanimation
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquicksmoothedanimation.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp b/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp
index 14d2e858e8..fee7068825 100644
--- a/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp
+++ b/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp
@@ -31,7 +31,7 @@
#include <QtQuick/private/qquicksmoothedanimation_p.h>
#include <QtQuick/private/qquickrectangle_p.h>
#include <private/qqmlvaluetype_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquicksmoothedanimation : public QQmlDataTest
{
@@ -55,6 +55,7 @@ private:
};
tst_qquicksmoothedanimation::tst_qquicksmoothedanimation()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickspringanimation/CMakeLists.txt b/tests/auto/quick/qquickspringanimation/CMakeLists.txt
index b90f76cdf6..04fa4fde53 100644
--- a/tests/auto/quick/qquickspringanimation/CMakeLists.txt
+++ b/tests/auto/quick/qquickspringanimation/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickspringanimation
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickspringanimation.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickspringanimation/tst_qquickspringanimation.cpp b/tests/auto/quick/qquickspringanimation/tst_qquickspringanimation.cpp
index 9042e94c75..6e545e62f2 100644
--- a/tests/auto/quick/qquickspringanimation/tst_qquickspringanimation.cpp
+++ b/tests/auto/quick/qquickspringanimation/tst_qquickspringanimation.cpp
@@ -31,7 +31,7 @@
#include <QtQuick/qquickview.h>
#include <private/qquickspringanimation_p.h>
#include <private/qqmlvaluetype_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquickspringanimation : public QQmlDataTest
{
@@ -50,6 +50,7 @@ private:
};
tst_qquickspringanimation::tst_qquickspringanimation()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickspritesequence/CMakeLists.txt b/tests/auto/quick/qquickspritesequence/CMakeLists.txt
index 3955536260..27aac12df1 100644
--- a/tests/auto/quick/qquickspritesequence/CMakeLists.txt
+++ b/tests/auto/quick/qquickspritesequence/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickspritesequence
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickspritesequence.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -23,6 +20,7 @@ qt_internal_add_test(tst_qquickspritesequence
Qt::Network
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp b/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp
index e5d55a6871..6af58990f7 100644
--- a/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp
+++ b/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
#include <QtTest/QtTest>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuick/qquickview.h>
#include <private/qquickspritesequence_p.h>
@@ -34,7 +34,7 @@ class tst_qquickspritesequence : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickspritesequence(){}
+ tst_qquickspritesequence() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private slots:
void test_properties();
diff --git a/tests/auto/quick/qquickstates/CMakeLists.txt b/tests/auto/quick/qquickstates/CMakeLists.txt
index 00b259e763..657e11b392 100644
--- a/tests/auto/quick/qquickstates/CMakeLists.txt
+++ b/tests/auto/quick/qquickstates/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickstates
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickstates.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickstates/tst_qquickstates.cpp b/tests/auto/quick/qquickstates/tst_qquickstates.cpp
index c565ec3a83..23a7691765 100644
--- a/tests/auto/quick/qquickstates/tst_qquickstates.cpp
+++ b/tests/auto/quick/qquickstates/tst_qquickstates.cpp
@@ -37,7 +37,7 @@
#include <QtQuick/private/qquickstategroup_p.h>
#include <private/qquickitem_p.h>
#include <private/qqmlproperty_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class MyAttached : public QObject
{
@@ -143,7 +143,7 @@ class tst_qquickstates : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquickstates() {}
+ tst_qquickstates() : QQmlDataTest(QT_QMLTEST_DATADIR) {}
private:
QByteArray fullDataPath(const QString &path) const;
diff --git a/tests/auto/quick/qquicktableview/CMakeLists.txt b/tests/auto/quick/qquicktableview/CMakeLists.txt
index 04842aaae2..6ffe1b13d7 100644
--- a/tests/auto/quick/qquicktableview/CMakeLists.txt
+++ b/tests/auto/quick/qquicktableview/CMakeLists.txt
@@ -12,16 +12,10 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktableview
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
testmodel.h
tst_qquicktableview.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -30,6 +24,7 @@ qt_internal_add_test(tst_qquicktableview
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
index 340c44fdb5..8c9680f305 100644
--- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
+++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
@@ -43,12 +43,12 @@
#include "testmodel.h"
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
-using namespace QQuickViewTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickViewTestUtils;
+using namespace QQuickVisualTestUtils;
static const char* kDelegateObjectName = "tableViewDelegate";
static const char *kDelegatesCreatedCountProp = "delegatesCreatedCount";
@@ -209,6 +209,7 @@ private slots:
};
tst_QQuickTableView::tst_QQuickTableView()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquicktext/CMakeLists.txt b/tests/auto/quick/qquicktext/CMakeLists.txt
index 569347e287..90c7f30a93 100644
--- a/tests/auto/quick/qquicktext/CMakeLists.txt
+++ b/tests/auto/quick/qquicktext/CMakeLists.txt
@@ -12,11 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktext
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qquicktext.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -25,6 +21,7 @@ qt_internal_add_test(tst_qquicktext
Qt::QmlPrivate
Qt::QuickPrivate
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 339bea0e6f..4601d112c1 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -44,8 +44,8 @@
#include <private/qguiapplication_p.h>
#include <limits.h>
#include <QtGui/QMouseEvent>
-#include "../../shared/util.h"
-#include "testhttpserver.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)
@@ -198,6 +198,7 @@ void tst_qquicktext::cleanup()
}
tst_qquicktext::tst_qquicktext()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
standard << "the quick brown fox jumped over the lazy dog"
<< "the quick brown fox\n jumped over the lazy dog";
diff --git a/tests/auto/quick/qquicktextdocument/CMakeLists.txt b/tests/auto/quick/qquicktextdocument/CMakeLists.txt
index c2e52317fe..5533bbbdc4 100644
--- a/tests/auto/quick/qquicktextdocument/CMakeLists.txt
+++ b/tests/auto/quick/qquicktextdocument/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktextdocument
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquicktextdocument.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp b/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp
index e9c699db6a..dd6c375139 100644
--- a/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp
+++ b/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp
@@ -36,11 +36,14 @@
#include <QtGui/QTextDocumentWriter>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_qquicktextdocument : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qquicktextdocument();
+
private slots:
void textDocumentWriter();
void textDocumentWithImage();
@@ -48,6 +51,11 @@ private slots:
QString text = QStringLiteral("foo bar");
+tst_qquicktextdocument::tst_qquicktextdocument()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qquicktextdocument::textDocumentWriter()
{
QQmlEngine e;
diff --git a/tests/auto/quick/qquicktextedit/CMakeLists.txt b/tests/auto/quick/qquicktextedit/CMakeLists.txt
index 57a955877b..ab3bc65b4d 100644
--- a/tests/auto/quick/qquicktextedit/CMakeLists.txt
+++ b/tests/auto/quick/qquicktextedit/CMakeLists.txt
@@ -12,16 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktextedit
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquicktextedit.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -29,6 +22,7 @@ qt_internal_add_test(tst_qquicktextedit
Qt::NetworkPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index 73723f857c..bec02269d1 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -27,7 +27,7 @@
****************************************************************************/
#include <qtest.h>
#include <QtTest/QSignalSpy>
-#include "../../shared/testhttpserver.h"
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#include <math.h>
#include <QFile>
#include <QTextDocument>
@@ -50,10 +50,11 @@
#include <QClipboard>
#include <QMimeData>
#include <private/qquicktextcontrol_p.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
-#include "../../shared/platformquirks.h"
-#include "../../shared/platforminputcontext.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickTestUtils/private/platformquirks_p.h>
+#include <QtQuickTestUtils/private/platforminputcontext_p.h>
#include <private/qinputmethod_p.h>
#include <QtGui/qstylehints.h>
#include <qmath.h>
@@ -317,6 +318,7 @@ QList<Key> &operator <<(QList<Key> &keys, Qt::Key key)
}
tst_qquicktextedit::tst_qquicktextedit()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qRegisterMetaType<QQuickTextEdit::TextFormat>();
qRegisterMetaType<QQuickTextEdit::SelectionMode>();
@@ -2583,8 +2585,8 @@ void tst_qquicktextedit::linkHover()
QQuickView window(testFileUrl("linkInteraction.qml"));
window.setFlag(Qt::FramelessWindowHint);
QVERIFY(window.rootObject() != nullptr);
- QQuickViewTestUtil::centerOnScreen(&window);
- QQuickViewTestUtil::moveMouseAway(&window);
+ QQuickVisualTestUtils::centerOnScreen(&window);
+ QQuickVisualTestUtils::moveMouseAway(&window);
window.show();
window.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&window));
@@ -2625,8 +2627,8 @@ void tst_qquicktextedit::linkInteraction()
{
QQuickView window(testFileUrl("linkInteraction.qml"));
QVERIFY(window.rootObject() != nullptr);
- QQuickViewTestUtil::centerOnScreen(&window);
- QQuickViewTestUtil::moveMouseAway(&window);
+ QQuickVisualTestUtils::centerOnScreen(&window);
+ QQuickVisualTestUtils::moveMouseAway(&window);
window.show();
window.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&window));
diff --git a/tests/auto/quick/qquicktextinput/CMakeLists.txt b/tests/auto/quick/qquicktextinput/CMakeLists.txt
index 6e8d855a58..8f49477a30 100644
--- a/tests/auto/quick/qquicktextinput/CMakeLists.txt
+++ b/tests/auto/quick/qquicktextinput/CMakeLists.txt
@@ -12,17 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquicktextinput
SOURCES
- ../../shared/testhttpserver.cpp ../../shared/testhttpserver.h
- ../../shared/util.cpp ../../shared/util.h
tst_qquicktextinput.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 04d0302427..cc406cd205 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -27,8 +27,8 @@
****************************************************************************/
#include <qtest.h>
#include <QtTest/QSignalSpy>
-#include "../../shared/util.h"
-#include "../../shared/testhttpserver.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/testhttpserver_p.h>
#include <private/qinputmethod_p.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlexpression.h>
@@ -51,8 +51,8 @@
#endif
#include "qplatformdefs.h"
-#include "../../shared/platformquirks.h"
-#include "../../shared/platforminputcontext.h"
+#include <QtQuickTestUtils/private/platformquirks_p.h>
+#include <QtQuickTestUtils/private/platforminputcontext_p.h>
Q_DECLARE_METATYPE(QQuickTextInput::SelectionMode)
Q_DECLARE_METATYPE(QQuickTextInput::EchoMode)
@@ -302,6 +302,7 @@ void tst_qquicktextinput::cleanup()
}
tst_qquicktextinput::tst_qquicktextinput()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
standard << "the quick brown fox jumped over the lazy dog"
<< "It's supercalifragisiticexpialidocious!"
diff --git a/tests/auto/quick/qquickview/CMakeLists.txt b/tests/auto/quick/qquickview/CMakeLists.txt
index 16babb106a..c18b9edd7d 100644
--- a/tests/auto/quick/qquickview/CMakeLists.txt
+++ b/tests/auto/quick/qquickview/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickview
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickview.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickview/tst_qquickview.cpp b/tests/auto/quick/qquickview/tst_qquickview.cpp
index 7e47e0ca59..068acc7733 100644
--- a/tests/auto/quick/qquickview/tst_qquickview.cpp
+++ b/tests/auto/quick/qquickview/tst_qquickview.cpp
@@ -31,12 +31,12 @@
#include <QtQml/qqmlcontext.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/qquickitem.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtGui/QWindow>
#include <QtCore/QDebug>
#include <QtQml/qqmlengine.h>
-#include "../shared/geometrytestutil.h"
+#include <QtQuickTestUtils/private/geometrytestutils_p.h>
class tst_QQuickView : public QQmlDataTest
{
@@ -54,6 +54,7 @@ private slots:
tst_QQuickView::tst_QQuickView()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickview_extra/CMakeLists.txt b/tests/auto/quick/qquickview_extra/CMakeLists.txt
index 4fa75da811..6713ddae61 100644
--- a/tests/auto/quick/qquickview_extra/CMakeLists.txt
+++ b/tests/auto/quick/qquickview_extra/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickview_extra
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickview_extra.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp b/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
index f697a438bd..1ad248d899 100644
--- a/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
+++ b/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
@@ -30,7 +30,7 @@
#include <QtQuick/qquickview.h>
#include <QtQuick/qquickitem.h>
#include <QtQml/qqmlengine.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtCore/QDebug>
#include <QtCore/QTimer>
@@ -45,7 +45,7 @@ private slots:
void qtbug_87228();
};
-tst_QQuickViewExtra::tst_QQuickViewExtra() { }
+tst_QQuickViewExtra::tst_QQuickViewExtra() : QQmlDataTest(QT_QMLTEST_DATADIR) { }
void tst_QQuickViewExtra::qtbug_87228()
{
diff --git a/tests/auto/quick/qquickvisualdatamodel/CMakeLists.txt b/tests/auto/quick/qquickvisualdatamodel/CMakeLists.txt
index 8222fd001f..c5b3fd0d97 100644
--- a/tests/auto/quick/qquickvisualdatamodel/CMakeLists.txt
+++ b/tests/auto/quick/qquickvisualdatamodel/CMakeLists.txt
@@ -12,15 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickvisualdatamodel
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickvisualdatamodel.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -28,6 +22,7 @@ qt_internal_add_test(tst_qquickvisualdatamodel
Qt::QmlModelsPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
index 0037747043..fd4a6cdabf 100644
--- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
+++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
@@ -25,9 +25,9 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
#include <qtest.h>
#include <QtCore/qregularexpression.h>
@@ -47,8 +47,8 @@
#include <math.h>
#include <QtGui/qstandarditemmodel.h>
-using namespace QQuickVisualTestUtil;
-using namespace QQuickViewTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickViewTestUtils;
template <typename T, int N> int lengthOf(const T (&)[N]) { return N; }
@@ -502,6 +502,7 @@ void tst_qquickvisualdatamodel::cleanupTestCase()
}
tst_qquickvisualdatamodel::tst_qquickvisualdatamodel()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quick/qquickwindow/CMakeLists.txt b/tests/auto/quick/qquickwindow/CMakeLists.txt
index 4b353cb277..2216f255a6 100644
--- a/tests/auto/quick/qquickwindow/CMakeLists.txt
+++ b/tests/auto/quick/qquickwindow/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickwindow
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickwindow.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 8d1fd7c0ba..e1f3d19b00 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -38,9 +38,9 @@
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuick/private/qquickloader_p.h>
#include <QtQuick/private/qquickmousearea_p.h>
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
#include <QSignalSpy>
#include <private/qquickwindow_p.h>
#include <private/qguiapplication_p.h>
@@ -402,7 +402,8 @@ class tst_qquickwindow : public QQmlDataTest
Q_OBJECT
public:
tst_qquickwindow()
- : touchDevice(QTest::createTouchDevice())
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+ , touchDevice(QTest::createTouchDevice())
, touchDeviceWithVelocity(QTest::createTouchDevice(QInputDevice::DeviceType::TouchScreen,
QInputDevice::Capability::Position | QPointingDevice::Capability::Velocity))
{
@@ -1701,7 +1702,7 @@ void tst_qquickwindow::headless()
// Verify that the visual output is the same
QImage newContent = window->grabWindow();
QString errorMessage;
- QVERIFY2(QQuickVisualTestUtil::compareImages(newContent, originalContent, &errorMessage),
+ QVERIFY2(QQuickVisualTestUtils::compareImages(newContent, originalContent, &errorMessage),
qPrintable(errorMessage));
}
@@ -1736,7 +1737,7 @@ void tst_qquickwindow::destroyShowWithoutHide()
QImage newContent = window->grabWindow();
QString errorMessage;
- QVERIFY2(QQuickVisualTestUtil::compareImages(newContent, originalContent, &errorMessage),
+ QVERIFY2(QQuickVisualTestUtils::compareImages(newContent, originalContent, &errorMessage),
qPrintable(errorMessage));
}
@@ -2149,7 +2150,7 @@ void tst_qquickwindow::requestActivate()
QTRY_COMPARE(QGuiApplication::focusWindow(), window1.data());
QVERIFY(window1->isActive());
- QQuickItem *item = QQuickVisualTestUtil::findItem<QQuickItem>(window1->contentItem(), "item1");
+ QQuickItem *item = QQuickVisualTestUtils::findItem<QQuickItem>(window1->contentItem(), "item1");
QVERIFY(item);
//copied from src/qmltest/quicktestevent.cpp
diff --git a/tests/auto/quick/rendernode/CMakeLists.txt b/tests/auto/quick/rendernode/CMakeLists.txt
index 037ff85843..2c0ff2a5c2 100644
--- a/tests/auto/quick/rendernode/CMakeLists.txt
+++ b/tests/auto/quick/rendernode/CMakeLists.txt
@@ -12,16 +12,14 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_rendernode
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_rendernode.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp
index 98d0970ca0..1dd622a51d 100644
--- a/tests/auto/quick/rendernode/tst_rendernode.cpp
+++ b/tests/auto/quick/rendernode/tst_rendernode.cpp
@@ -35,7 +35,7 @@
#include <QtGui/qscreen.h>
#include <private/qsgrendernode_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class tst_rendernode: public QQmlDataTest
{
@@ -182,6 +182,7 @@ protected:
};
tst_rendernode::tst_rendernode()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qmlRegisterType<ClearItem>("Test", 1, 0, "ClearItem");
qmlRegisterType<MessUpItem>("Test", 1, 0, "MessUpItem");
diff --git a/tests/auto/quick/scenegraph/CMakeLists.txt b/tests/auto/quick/scenegraph/CMakeLists.txt
index 046629ba04..0dc617975e 100644
--- a/tests/auto/quick/scenegraph/CMakeLists.txt
+++ b/tests/auto/quick/scenegraph/CMakeLists.txt
@@ -6,21 +6,16 @@
qt_internal_add_test(tst_scenegraph
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_scenegraph.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
)
#### Keys ignored in scope 1:.:.:scenegraph.pro:<TRUE>:
diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
index 9803412703..96518dbcfa 100644
--- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp
+++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
@@ -45,13 +45,13 @@
#include <private/qsgrenderloop_p.h>
#include <private/qsgrhisupport_p.h>
-#include "../../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformintegration.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class PerPixelRect : public QQuickItem
{
@@ -102,6 +102,9 @@ class tst_SceneGraph : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_SceneGraph();
+
private slots:
void initTestCase() override;
@@ -126,6 +129,11 @@ public:
~ScopedList() { qDeleteAll(*this); }
};
+tst_SceneGraph::tst_SceneGraph()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_SceneGraph::initTestCase()
{
qmlRegisterType<PerPixelRect>("SceneGraphTest", 1, 0, "PerPixelRect");
diff --git a/tests/auto/quick/shared/visualtestutil.cpp b/tests/auto/quick/shared/visualtestutil.cpp
deleted file mode 100644
index 06f7386902..0000000000
--- a/tests/auto/quick/shared/visualtestutil.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "visualtestutil.h"
-
-#include <QtQuick/QQuickItem>
-#include <QtCore/QDebug>
-
-bool QQuickVisualTestUtil::delegateVisible(QQuickItem *item)
-{
- return item->isVisible() && !QQuickItemPrivate::get(item)->culled;
-}
-
-QQuickItem *QQuickVisualTestUtil::findVisibleChild(QQuickItem *parent, const QString &objectName)
-{
- QQuickItem *item = 0;
- QList<QQuickItem*> items = parent->findChildren<QQuickItem*>(objectName);
- for (int i = 0; i < items.count(); ++i) {
- if (items.at(i)->isVisible() && !QQuickItemPrivate::get(items.at(i))->culled) {
- item = items.at(i);
- break;
- }
- }
- return item;
-}
-
-void QQuickVisualTestUtil::dumpTree(QQuickItem *parent, int depth)
-{
- static QString padding(" ");
- for (int i = 0; i < parent->childItems().count(); ++i) {
- QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i));
- if (!item)
- continue;
- qDebug() << padding.left(depth*2) << item;
- dumpTree(item, depth+1);
- }
-}
-
-// A custom compare function to avoid issues such as:
-// When running on native Nvidia graphics cards on linux, the
-// distance field glyph pixels have a measurable, but not visible
-// pixel error. This was GT-216 with the ubuntu "nvidia-319" driver package.
-// llvmpipe does not show the same issue.
-
-bool QQuickVisualTestUtil::compareImages(const QImage &ia, const QImage &ib, QString *errorMessage)
-{
- if (ia.size() != ib.size()) {
- QDebug(errorMessage) << "Images are of different size:" << ia.size() << ib.size()
- << "DPR:" << ia.devicePixelRatio() << ib.devicePixelRatio();
- return false;
- }
- if (ia.format() != ib.format()) {
- QDebug(errorMessage) << "Images are of different formats:" << ia.format() << ib.format();
- return false;
- }
-
- int w = ia.width();
- int h = ia.height();
- const int tolerance = 5;
- for (int y=0; y<h; ++y) {
- const uint *as= (const uint *) ia.constScanLine(y);
- const uint *bs= (const uint *) ib.constScanLine(y);
- for (int x=0; x<w; ++x) {
- uint a = as[x];
- uint b = bs[x];
-
- // No tolerance for error in the alpha.
- if ((a & 0xff000000) != (b & 0xff000000)
- || qAbs(qRed(a) - qRed(b)) > tolerance
- || qAbs(qRed(a) - qRed(b)) > tolerance
- || qAbs(qRed(a) - qRed(b)) > tolerance) {
- QDebug(errorMessage) << "Mismatch at:" << x << y << ':'
- << Qt::hex << Qt::showbase << a << b;
- return false;
- }
- }
- }
- return true;
-}
diff --git a/tests/auto/quick/touchmouse/CMakeLists.txt b/tests/auto/quick/touchmouse/CMakeLists.txt
index 703f4f7578..4c29b7b42d 100644
--- a/tests/auto/quick/touchmouse/CMakeLists.txt
+++ b/tests/auto/quick/touchmouse/CMakeLists.txt
@@ -12,21 +12,16 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_touchmouse
SOURCES
- ../../shared/util.cpp ../../shared/util.h
- ../shared/geometrytestutil.cpp ../shared/geometrytestutil.h
- ../shared/viewtestutil.cpp ../shared/viewtestutil.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_touchmouse.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
Qt::QmlPrivate
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
index ef0df0cddb..b06137716c 100644
--- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp
+++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
@@ -46,8 +46,8 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlproperty.h>
-#include "../../shared/util.h"
-#include "../shared/viewtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
@@ -217,6 +217,7 @@ class tst_TouchMouse : public QQmlDataTest
Q_OBJECT
public:
tst_TouchMouse()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{}
private slots:
@@ -429,7 +430,7 @@ void tst_TouchMouse::testEventFilter()
// QScopedPointer<QQuickView> window(createView());
// window.setSource(testFileUrl("singleitem.qml"));
// window.show();
-// QQuickViewTestUtil::centerOnScreen(&window);
+// QQuickVisualTestUtils::centerOnScreen(&window);
// QVERIFY(QTest::qWaitForWindowActive(&window));
// QVERIFY(window->rootObject() != 0);
diff --git a/tests/auto/quickcontrols2/accessibility/CMakeLists.txt b/tests/auto/quickcontrols2/accessibility/CMakeLists.txt
index dafca24b7d..704b2d45cd 100644
--- a/tests/auto/quickcontrols2/accessibility/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/accessibility/CMakeLists.txt
@@ -16,9 +16,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_accessibility
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_accessibility.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -32,6 +29,7 @@ qt_internal_add_test(tst_accessibility
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/accessibility/tst_accessibility.cpp b/tests/auto/quickcontrols2/accessibility/tst_accessibility.cpp
index f2cb8b60e6..cd6c408230 100644
--- a/tests/auto/quickcontrols2/accessibility/tst_accessibility.cpp
+++ b/tests/auto/quickcontrols2/accessibility/tst_accessibility.cpp
@@ -39,8 +39,8 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlcontext.h>
#include <QtQuick/private/qquickitem_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuickTemplates2/private/qquickpopup_p.h>
-#include "../shared/util.h"
#if QT_CONFIG(accessibility)
#include <QtGui/private/qguiapplication_p.h>
@@ -53,6 +53,9 @@ class tst_accessibility : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_accessibility();
+
private slots:
void a11y_data();
void a11y();
@@ -96,6 +99,11 @@ QQuickItem *findItem(QObject *object)
return item;
}
+tst_accessibility::tst_accessibility()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_accessibility::a11y_data()
{
QTest::addColumn<QString>("fileBaseName");
diff --git a/tests/auto/quickcontrols2/cursor/CMakeLists.txt b/tests/auto/quickcontrols2/cursor/CMakeLists.txt
index ebb6ec8cc6..4a8296a0e4 100644
--- a/tests/auto/quickcontrols2/cursor/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/cursor/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_cursor
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_cursor.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_cursor
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/cursor/tst_cursor.cpp b/tests/auto/quickcontrols2/cursor/tst_cursor.cpp
index 37a9e0c150..d9f7f4cc4f 100644
--- a/tests/auto/quickcontrols2/cursor/tst_cursor.cpp
+++ b/tests/auto/quickcontrols2/cursor/tst_cursor.cpp
@@ -35,9 +35,9 @@
****************************************************************************/
#include <QtTest/qtest.h>
-#include "../shared/visualtestutil.h"
#include <QtQuick/qquickview.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickcontrol_p.h>
#include <QtQuickTemplates2/private/qquickpageindicator_p.h>
@@ -50,7 +50,7 @@
# include <QtGui/qcursor.h>
#endif
-using namespace QQuickVisualTestUtil;
+using namespace QQuickControlsTestUtils;
class tst_cursor : public QQmlDataTest
{
@@ -69,6 +69,7 @@ private slots:
};
tst_cursor::tst_cursor()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
QQuickStyle::setStyle("Basic");
}
@@ -190,7 +191,7 @@ void tst_cursor::scrollBar()
{
// Ensure that the mouse cursor has the correct shape when over a scrollbar
// which is itself over a text area with IBeamCursor.
- QQuickApplicationHelper helper(this, QStringLiteral("scrollbar.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("scrollbar.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
diff --git a/tests/auto/quickcontrols2/customization/CMakeLists.txt b/tests/auto/quickcontrols2/customization/CMakeLists.txt
index daa234d205..cf86185aca 100644
--- a/tests/auto/quickcontrols2/customization/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/customization/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_customization
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_customization.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_customization
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/customization/tst_customization.cpp b/tests/auto/quickcontrols2/customization/tst_customization.cpp
index 02c7597863..0829e29e3d 100644
--- a/tests/auto/quickcontrols2/customization/tst_customization.cpp
+++ b/tests/auto/quickcontrols2/customization/tst_customization.cpp
@@ -41,12 +41,13 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickwindow.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
#include <QtQuickControls2/qquickstyle.h>
#include <QtQuickControls2/private/qquickstyle_p.h>
#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
-#include "../shared/visualtestutil.h"
-using namespace QQuickVisualTestUtil;
+using namespace QQuickControlsTestUtils;
struct ControlInfo
{
@@ -112,6 +113,9 @@ class tst_customization : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_customization();
+
private slots:
void initTestCase() override;
void cleanupTestCase();
@@ -212,6 +216,11 @@ extern "C" Q_DECL_EXPORT void qt_removeQObject(QObject *object)
}
}
+tst_customization::tst_customization()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_customization::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/CMakeLists.txt b/tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/CMakeLists.txt
index 220e826c71..64022f6293 100644
--- a/tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/CMakeLists.txt
@@ -6,9 +6,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickfiledialogimpl
SOURCES
- ../../shared/qtest_quickcontrols.h
- ../../shared/util.cpp ../../shared/util.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquickfiledialogimpl.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -19,12 +16,14 @@ qt_internal_add_test(tst_qquickfiledialogimpl
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickDialogs2Private
Qt::QuickDialogs2QuickImplPrivate
Qt::QuickDialogs2UtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp b/tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp
index a8fe4c1592..b4725801fb 100644
--- a/tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp
+++ b/tests/auto/quickcontrols2/dialogs/qquickfiledialogimpl/tst_qquickfiledialogimpl.cpp
@@ -34,15 +34,13 @@
**
****************************************************************************/
-#include "../../shared/dialogtestutil.h"
-#include "../../shared/util.h"
-#include "../../shared/visualtestutil.h"
-
#include <QtTest/qtest.h>
#include <QtTest/qsignalspy.h>
#include <QtQml/qqmlfile.h>
#include <QtQuick/private/qquicklistview_p.h>
#include <QtQuickTest/quicktest.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
+#include <QtQuickControlsTestUtils/private/dialogstestutils_p.h>
#include <QtQuickDialogs2/private/qquickfiledialog_p.h>
#include <QtQuickDialogs2QuickImpl/private/qquickplatformfiledialog_p.h>
#include <QtQuickDialogs2QuickImpl/private/qquickfiledialogdelegate_p.h>
@@ -55,14 +53,19 @@
#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p_p.h>
#include <QtQuickTemplates2/private/qquicklabel_p.h>
#include <QtQuickTemplates2/private/qquickoverlay_p.h>
+#include <QtQuickControls2/qquickstyle.h>
-using namespace QQuickDialogTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickDialogTestUtils;
+using namespace QQuickControlsTestUtils;
class tst_QQuickFileDialogImpl : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickFileDialogImpl();
+
private slots:
void initTestCase() override;
void cleanupTestCase();
@@ -129,6 +132,11 @@ void tst_QQuickFileDialogImpl::enterText(QWindow *window, const QString &textToE
}
}
+tst_QQuickFileDialogImpl::tst_QQuickFileDialogImpl()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickFileDialogImpl::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/CMakeLists.txt b/tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/CMakeLists.txt
index b631dc8bab..4fffdf10b3 100644
--- a/tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/CMakeLists.txt
@@ -6,9 +6,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickfontdialogimpl
SOURCES
- ../../shared/qtest_quickcontrols.h
- ../../shared/util.cpp ../../shared/util.h
- ../../shared/visualtestutil.cpp ../../shared/visualtestutil.h
tst_qquickfontdialogimpl.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -19,11 +16,13 @@ qt_internal_add_test(tst_qquickfontdialogimpl
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickDialogs2Private
Qt::QuickDialogs2QuickImplPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/tst_qquickfontdialogimpl.cpp b/tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/tst_qquickfontdialogimpl.cpp
index 1de003818f..92265693ff 100644
--- a/tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/tst_qquickfontdialogimpl.cpp
+++ b/tests/auto/quickcontrols2/dialogs/qquickfontdialogimpl/tst_qquickfontdialogimpl.cpp
@@ -34,10 +34,6 @@
**
****************************************************************************/
-#include "../../shared/dialogtestutil.h"
-#include "../../shared/util.h"
-#include "../../shared/visualtestutil.h"
-
#include <QtTest/qtest.h>
#include <QtTest/qsignalspy.h>
#include <QtQml/qqmlfile.h>
@@ -46,6 +42,8 @@
#include <QtQuickDialogs2/private/qquickfontdialog_p.h>
#include <QtQuickDialogs2QuickImpl/private/qquickfontdialogimpl_p.h>
#include <QtQuickTest/quicktest.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
+#include <QtQuickControlsTestUtils/private/dialogstestutils_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickcombobox_p.h>
#include <QtQuickTemplates2/private/qquicktextfield_p.h>
@@ -53,14 +51,19 @@
#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p_p.h>
#include <QtQuickTemplates2/private/qquicklabel_p.h>
#include <QtQuickTemplates2/private/qquickoverlay_p.h>
+#include <QtQuickControls2/qquickstyle.h>
-using namespace QQuickDialogTestUtil;
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickDialogTestUtils;
+using namespace QQuickControlsTestUtils;
class tst_QQuickFontDialogImpl : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickFontDialogImpl();
+
private slots:
void writingSystem();
void listViews();
@@ -126,6 +129,11 @@ private:
QVERIFY2(closePopup(&dialogHelper, BUTTON, errorMessage), qPrintable(errorMessage)); \
QTRY_VERIFY(!dialogHelper.quickDialog->isVisible());
+tst_QQuickFontDialogImpl::tst_QQuickFontDialogImpl()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickFontDialogImpl::writingSystem()
{
CREATE_DIALOG_TEST_HELPER
diff --git a/tests/auto/quickcontrols2/focus/CMakeLists.txt b/tests/auto/quickcontrols2/focus/CMakeLists.txt
index 74738cc2a5..8f6d53f7da 100644
--- a/tests/auto/quickcontrols2/focus/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/focus/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_focus
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_focus.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_focus
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/focus/tst_focus.cpp b/tests/auto/quickcontrols2/focus/tst_focus.cpp
index 92df4665be..0232034a2b 100644
--- a/tests/auto/quickcontrols2/focus/tst_focus.cpp
+++ b/tests/auto/quickcontrols2/focus/tst_focus.cpp
@@ -36,24 +36,31 @@
#include <qtest.h>
#include <QtTest/QSignalSpy>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpointingdevice.h>
+#include <QtGui/qstylehints.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlcontext.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquickitem_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickcontrol_p.h>
-#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/qpointingdevice.h>
-#include <QtGui/qstylehints.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickControls2/qquickstyle.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickControlsTestUtils;
class tst_focus : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_focus();
+
private slots:
void initTestCase() override;
@@ -72,6 +79,11 @@ private slots:
void scope();
};
+tst_focus::tst_focus()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_focus::initTestCase()
{
QQuickStyle::setStyle("Basic");
diff --git a/tests/auto/quickcontrols2/font/CMakeLists.txt b/tests/auto/quickcontrols2/font/CMakeLists.txt
index e7cef47674..ce782668fb 100644
--- a/tests/auto/quickcontrols2/font/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/font/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_font
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_font.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -28,6 +25,7 @@ qt_internal_add_test(tst_font
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/font/tst_font.cpp b/tests/auto/quickcontrols2/font/tst_font.cpp
index 976658b51e..a3adcfd6c4 100644
--- a/tests/auto/quickcontrols2/font/tst_font.cpp
+++ b/tests/auto/quickcontrols2/font/tst_font.cpp
@@ -35,19 +35,18 @@
****************************************************************************/
#include <QtTest/qtest.h>
-#include "../shared/visualtestutil.h"
#include <QtGui/qfont.h>
#include <QtGui/qpa/qplatformtheme.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickcontrol_p.h>
#include <QtQuickTemplates2/private/qquickpopup_p.h>
#include <QtQuickTemplates2/private/qquicktheme_p_p.h>
-
-using namespace QQuickVisualTestUtil;
+#include <QtQuickControls2/qquickstyle.h>
class tst_font : public QQmlDataTest
{
@@ -87,6 +86,7 @@ static QFont testFont()
}
tst_font::tst_font()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
QQuickStyle::setStyle("Basic");
}
diff --git a/tests/auto/quickcontrols2/palette/CMakeLists.txt b/tests/auto/quickcontrols2/palette/CMakeLists.txt
index 1a00f79973..e6e9128866 100644
--- a/tests/auto/quickcontrols2/palette/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/palette/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_palette
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_palette.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_palette
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/palette/tst_palette.cpp b/tests/auto/quickcontrols2/palette/tst_palette.cpp
index d8e1a3bfdf..ced6d6c352 100644
--- a/tests/auto/quickcontrols2/palette/tst_palette.cpp
+++ b/tests/auto/quickcontrols2/palette/tst_palette.cpp
@@ -35,12 +35,11 @@
****************************************************************************/
#include <QtTest/qtest.h>
-#include "../shared/visualtestutil.h"
-
#include <QtGui/qpalette.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickcontrol_p.h>
@@ -49,8 +48,9 @@
#include <QtQuickTemplates2/private/qquickpopup_p_p.h>
#include <QtQuickTemplates2/private/qquicktheme_p_p.h>
#include <QtQuickTemplates2/private/qquickbutton_p.h>
+#include <QtQuickControls2/qquickstyle.h>
-using namespace QQuickVisualTestUtil;
+//using namespace QQuickVisualTestUtils;
// Need a more descriptive failure message: QTBUG-87039
#define COMPARE_PALETTES(actualPalette, expectedPalette) \
@@ -62,6 +62,9 @@ class tst_palette : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_palette();
+
private slots:
void initTestCase() override;
@@ -82,6 +85,11 @@ private slots:
void updateBindings();
};
+tst_palette::tst_palette()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_palette::initTestCase()
{
QQuickStyle::setStyle("Basic");
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt b/tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt
index 00cde69c12..140d78a14e 100644
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickapplicationwindow
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickapplicationwindow.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_qquickapplicationwindow
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp b/tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
index fa42d81a79..8828292df7 100644
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
+++ b/tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
@@ -42,6 +42,8 @@
#include <QtQml/qqmlcontext.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquickitem_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickoverlay_p.h>
@@ -52,10 +54,9 @@
#include <QtQuickTemplates2/private/qquicktextarea_p.h>
#include <QtQuickTemplates2/private/qquicktextfield_p.h>
#include <QtQuickTemplates2/private/qquicktheme_p_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickControls2/qquickstyle.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_QQuickApplicationWindow : public QQmlDataTest
{
@@ -85,6 +86,7 @@ private slots:
};
tst_QQuickApplicationWindow::tst_QQuickApplicationWindow()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
QQuickStyle::setStyle("Basic");
}
diff --git a/tests/auto/quickcontrols2/qquickcontrol/CMakeLists.txt b/tests/auto/quickcontrols2/qquickcontrol/CMakeLists.txt
index a8e6e65560..e090869744 100644
--- a/tests/auto/quickcontrols2/qquickcontrol/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickcontrol/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickcontrol
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickcontrol.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_qquickcontrol
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickcontrol/tst_qquickcontrol.cpp b/tests/auto/quickcontrols2/qquickcontrol/tst_qquickcontrol.cpp
index 8b38bf7bb7..eb57884454 100644
--- a/tests/auto/quickcontrols2/qquickcontrol/tst_qquickcontrol.cpp
+++ b/tests/auto/quickcontrols2/qquickcontrol/tst_qquickcontrol.cpp
@@ -36,18 +36,21 @@
#include <QtTest/qtest.h>
#include <QtTest/qsignalspy.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/qtest_quickcontrols.h"
#include <QtGui/qpa/qwindowsysteminterface.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtQuickTemplates2/private/qquickbutton_p.h>
+#include <QtQuickControlsTestUtils/private/qtest_quickcontrols_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_QQuickControl : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickControl();
+
private slots:
void initTestCase() override;
void flickable();
@@ -56,6 +59,10 @@ private:
QScopedPointer<QPointingDevice> touchDevice;
};
+tst_QQuickControl::tst_QQuickControl()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
void tst_QQuickControl::initTestCase()
{
diff --git a/tests/auto/quickcontrols2/qquickdrawer/CMakeLists.txt b/tests/auto/quickcontrols2/qquickdrawer/CMakeLists.txt
index 8eb1f14871..91ed6a3e50 100644
--- a/tests/auto/quickcontrols2/qquickdrawer/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickdrawer/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickdrawer
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickdrawer.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_qquickdrawer
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickdrawer/tst_qquickdrawer.cpp b/tests/auto/quickcontrols2/qquickdrawer/tst_qquickdrawer.cpp
index 2c7ec045fe..86e114e3c3 100644
--- a/tests/auto/quickcontrols2/qquickdrawer/tst_qquickdrawer.cpp
+++ b/tests/auto/quickcontrols2/qquickdrawer/tst_qquickdrawer.cpp
@@ -36,9 +36,7 @@
#include <QtTest/qtest.h>
#include <QtTest/qsignalspy.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/qtest_quickcontrols.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtGui/qpointingdevice.h>
#include <QtGui/qstylehints.h>
@@ -46,19 +44,27 @@
#include <QtGui/qpa/qwindowsysteminterface.h>
#include <QtQuick/private/qquickwindow_p.h>
#include <QtQuick/private/qquickflickable_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickoverlay_p.h>
#include <QtQuickTemplates2/private/qquickpopup_p_p.h>
#include <QtQuickTemplates2/private/qquickdrawer_p.h>
#include <QtQuickTemplates2/private/qquickbutton_p.h>
#include <QtQuickTemplates2/private/qquickslider_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
+#include <QtQuickControlsTestUtils/private/qtest_quickcontrols_p.h>
-using namespace QQuickVisualTestUtil;
+//using namespace QQuickVisualTestUtils;
+using namespace QQuickControlsTestUtils;
class tst_QQuickDrawer : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickDrawer();
+
private slots:
void initTestCase() override;
@@ -116,6 +122,11 @@ private:
};
+tst_QQuickDrawer::tst_QQuickDrawer()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickDrawer::initTestCase()
{
QQmlDataTest::initTestCase();
@@ -168,7 +179,7 @@ void tst_QQuickDrawer::visible_data()
void tst_QQuickDrawer::visible()
{
QFETCH(QString, source);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -209,7 +220,7 @@ void tst_QQuickDrawer::visible()
void tst_QQuickDrawer::state()
{
- QQuickApplicationHelper helper(this, "applicationwindow.qml");
+ QQuickControlsApplicationHelper helper(this, "applicationwindow.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -330,7 +341,7 @@ void tst_QQuickDrawer::position()
QFETCH(QPoint, to);
QFETCH(qreal, position);
- QQuickApplicationHelper helper(this, QStringLiteral("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -378,7 +389,7 @@ void tst_QQuickDrawer::dragMargin()
QFETCH(qreal, dragFromLeft);
QFETCH(qreal, dragFromRight);
- QQuickApplicationHelper helper(this, QStringLiteral("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -425,7 +436,7 @@ static QRectF geometry(const QQuickItem *item)
void tst_QQuickDrawer::reposition()
{
- QQuickApplicationHelper helper(this, QStringLiteral("reposition.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("reposition.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -484,7 +495,7 @@ void tst_QQuickDrawer::reposition()
void tst_QQuickDrawer::header()
{
- QQuickApplicationHelper helper(this, QStringLiteral("header.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("header.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -539,7 +550,7 @@ void tst_QQuickDrawer::hover()
QFETCH(QString, source);
QFETCH(bool, modal);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -623,7 +634,7 @@ void tst_QQuickDrawer::wheel()
QFETCH(QString, source);
QFETCH(bool, modal);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -686,7 +697,7 @@ void tst_QQuickDrawer::wheel()
void tst_QQuickDrawer::multiple()
{
- QQuickApplicationHelper helper(this, QStringLiteral("multiple.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("multiple.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -831,7 +842,7 @@ void tst_QQuickDrawer::touch()
QFETCH(QPoint, from);
QFETCH(QPoint, to);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -866,7 +877,7 @@ void tst_QQuickDrawer::touch()
void tst_QQuickDrawer::multiTouch()
{
- QQuickApplicationHelper helper(this, QStringLiteral("multiTouch.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("multiTouch.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -980,7 +991,7 @@ void tst_QQuickDrawer::multiTouch()
void tst_QQuickDrawer::grabber()
{
- QQuickApplicationHelper helper(this, QStringLiteral("grabber.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("grabber.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1025,7 +1036,7 @@ void tst_QQuickDrawer::interactive_data()
void tst_QQuickDrawer::interactive()
{
QFETCH(QString, source);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1088,7 +1099,7 @@ void tst_QQuickDrawer::flickable()
QFETCH(QPoint, from);
QFETCH(QPoint, to);
- QQuickApplicationHelper helper(this, QStringLiteral("flickable.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("flickable.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1145,7 +1156,7 @@ void tst_QQuickDrawer::dragOverModalShadow()
{
QFETCH(bool, mouse);
- QQuickApplicationHelper helper(this, QStringLiteral("dragOverModalShadow.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("dragOverModalShadow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1202,7 +1213,7 @@ void tst_QQuickDrawer::nonModal()
{
QFETCH(bool, mouse);
- QQuickApplicationHelper helper(this, QStringLiteral("window.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("window.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1286,7 +1297,7 @@ void tst_QQuickDrawer::slider()
QFETCH(bool, mouse);
QFETCH(int, delta);
- QQuickApplicationHelper helper(this, QStringLiteral("slider.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("slider.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1334,7 +1345,7 @@ void tst_QQuickDrawer::slider()
void tst_QQuickDrawer::topEdgeScreenEdge()
{
- QQuickApplicationHelper helper(this, QStringLiteral("topEdgeScreenEdge.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("topEdgeScreenEdge.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
diff --git a/tests/auto/quickcontrols2/qquickheaderview/CMakeLists.txt b/tests/auto/quickcontrols2/qquickheaderview/CMakeLists.txt
index a8809a8427..1bfae70cbb 100644
--- a/tests/auto/quickcontrols2/qquickheaderview/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickheaderview/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickheaderview
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickheaderview.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,10 +22,12 @@ qt_internal_add_test(tst_qquickheaderview
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickheaderview/tst_qquickheaderview.cpp b/tests/auto/quickcontrols2/qquickheaderview/tst_qquickheaderview.cpp
index db2529cb0b..a34c6ab6df 100644
--- a/tests/auto/quickcontrols2/qquickheaderview/tst_qquickheaderview.cpp
+++ b/tests/auto/quickcontrols2/qquickheaderview/tst_qquickheaderview.cpp
@@ -34,7 +34,6 @@
**
****************************************************************************/
-#include "../shared/util.h"
#include <QtTest/qsignalspy.h>
#include <QtTest/qtest.h>
@@ -42,6 +41,7 @@
#include <QtQml/QQmlEngine>
#include <QtQuick/private/qquickwindow_p.h>
#include <QtQuick/private/qquicktext_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickheaderview_p.h>
#include <private/qquickheaderview_p_p.h>
@@ -212,6 +212,9 @@ private:
class tst_QQuickHeaderView : public QQmlDataTest {
Q_OBJECT
+public:
+ tst_QQuickHeaderView();
+
private slots:
void initTestCase() override;
void cleanupTestCase();
@@ -239,6 +242,11 @@ private:
}
};
+tst_QQuickHeaderView::tst_QQuickHeaderView()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickHeaderView::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/quickcontrols2/qquickiconimage/CMakeLists.txt b/tests/auto/quickcontrols2/qquickiconimage/CMakeLists.txt
index d6ce5fd25c..acb9b99a1a 100644
--- a/tests/auto/quickcontrols2/qquickiconimage/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickiconimage/CMakeLists.txt
@@ -16,9 +16,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickiconimage
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickiconimage.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -34,9 +31,11 @@ qt_internal_add_test(tst_qquickiconimage
Qt::Quick
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickiconimage/tst_qquickiconimage.cpp b/tests/auto/quickcontrols2/qquickiconimage/tst_qquickiconimage.cpp
index 475981a2ae..3aaa91967e 100644
--- a/tests/auto/quickcontrols2/qquickiconimage/tst_qquickiconimage.cpp
+++ b/tests/auto/quickcontrols2/qquickiconimage/tst_qquickiconimage.cpp
@@ -39,12 +39,12 @@
#include <QtQuick/qquickimageprovider.h>
#include <QtQuick/qquickitemgrabresult.h>
#include <QtQuick/private/qquickimage_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickControls2/qquickstyle.h>
#include <QtQuickControls2Impl/private/qquickiconimage_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_qquickiconimage : public QQmlDataTest
{
@@ -92,6 +92,7 @@ static QImage grabItemToImage(QQuickItem *item)
QSKIP("Test does not support device pixel ratio greater than 2")
tst_qquickiconimage::tst_qquickiconimage() :
+ QQmlDataTest(QT_QMLTEST_DATADIR),
dpr(qGuiApp->devicePixelRatio()),
integerDpr(qCeil(dpr))
{
diff --git a/tests/auto/quickcontrols2/qquickiconlabel/CMakeLists.txt b/tests/auto/quickcontrols2/qquickiconlabel/CMakeLists.txt
index 54bc7172af..463268be8a 100644
--- a/tests/auto/quickcontrols2/qquickiconlabel/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickiconlabel/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickiconlabel
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickiconlabel.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -30,9 +27,11 @@ qt_internal_add_test(tst_qquickiconlabel
Qt::Quick
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickiconlabel/tst_qquickiconlabel.cpp b/tests/auto/quickcontrols2/qquickiconlabel/tst_qquickiconlabel.cpp
index 526ecf05b6..6119a9e571 100644
--- a/tests/auto/quickcontrols2/qquickiconlabel/tst_qquickiconlabel.cpp
+++ b/tests/auto/quickcontrols2/qquickiconlabel/tst_qquickiconlabel.cpp
@@ -34,14 +34,13 @@
#include <QtQuick/qquickview.h>
#include <QtQuick/qquickitemgrabresult.h>
#include <QtQuick/private/qquicktext_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtQuickTemplates2/private/qquickicon_p.h>
#include <QtQuickControls2Impl/private/qquickiconimage_p.h>
#include <QtQuickControls2Impl/private/qquickiconlabel_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_qquickiconlabel : public QQmlDataTest
{
@@ -59,6 +58,7 @@ private slots:
};
tst_qquickiconlabel::tst_qquickiconlabel()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
}
diff --git a/tests/auto/quickcontrols2/qquickmaterialstyleconf/CMakeLists.txt b/tests/auto/quickcontrols2/qquickmaterialstyleconf/CMakeLists.txt
index ef5c2d1352..753413c163 100644
--- a/tests/auto/quickcontrols2/qquickmaterialstyleconf/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickmaterialstyleconf/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickmaterialstyleconf
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickmaterialstyleconf.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_qquickmaterialstyleconf
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp b/tests/auto/quickcontrols2/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp
index e0fd8fefce..6b145d7ac6 100644
--- a/tests/auto/quickcontrols2/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp
+++ b/tests/auto/quickcontrols2/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp
@@ -36,17 +36,19 @@
#include <qtest.h>
#include <QtQuick/private/qquickitem_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuickControls2/private/qquickstyle_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickControlsTestUtils;
class tst_qquickmaterialstyleconf : public QQmlDataTest
{
Q_OBJECT
public:
+ tst_qquickmaterialstyleconf();
private slots:
void conf();
@@ -54,9 +56,14 @@ private slots:
void variants();
};
+tst_qquickmaterialstyleconf::tst_qquickmaterialstyleconf()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qquickmaterialstyleconf::conf()
{
- QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QFont customFont;
@@ -101,7 +108,7 @@ void tst_qquickmaterialstyleconf::variants()
QQuickStylePrivate::reset();
qputenv("QT_QUICK_CONTROLS_CONF", confPath);
- QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
diff --git a/tests/auto/quickcontrols2/qquickmenu/CMakeLists.txt b/tests/auto/quickcontrols2/qquickmenu/CMakeLists.txt
index 20dcaca04a..14ef0a8fc4 100644
--- a/tests/auto/quickcontrols2/qquickmenu/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickmenu/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickmenu
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickmenu.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_qquickmenu
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp b/tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp
index b3d91dc83e..4bb67e0321 100644
--- a/tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp
+++ b/tests/auto/quickcontrols2/qquickmenu/tst_qquickmenu.cpp
@@ -43,9 +43,10 @@
#include <QtQml/qqmlcontext.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquickitem_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/qtest_quickcontrols.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
+#include <QtQuickControlsTestUtils/private/qtest_quickcontrols_p.h>
#include <QtQuickTemplates2/private/qquickaction_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
@@ -55,13 +56,15 @@
#include <QtQuickTemplates2/private/qquickmenuitem_p.h>
#include <QtQuickTemplates2/private/qquickmenuseparator_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickControlsTestUtils;
class tst_QQuickMenu : public QQmlDataTest
{
Q_OBJECT
public:
+ tst_QQuickMenu();
private slots:
void defaults();
@@ -104,9 +107,14 @@ private slots:
void giveMenuItemFocusOnButtonPress();
};
+tst_QQuickMenu::tst_QQuickMenu()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickMenu::defaults()
{
- QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickMenu *emptyMenu = helper.appWindow->property("emptyMenu").value<QQuickMenu*>();
@@ -118,7 +126,7 @@ void tst_QQuickMenu::defaults()
void tst_QQuickMenu::count()
{
- QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickMenu *menu = helper.window->property("emptyMenu").value<QQuickMenu*>();
@@ -151,7 +159,7 @@ void tst_QQuickMenu::mouse()
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Mouse hovering not functional on offscreen/minimal platforms");
- QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -251,7 +259,7 @@ void tst_QQuickMenu::mouse()
void tst_QQuickMenu::pressAndHold()
{
- QQuickApplicationHelper helper(this, QLatin1String("pressAndHold.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("pressAndHold.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -276,7 +284,7 @@ void tst_QQuickMenu::contextMenuKeyboard()
if (QGuiApplication::styleHints()->tabFocusBehavior() != Qt::TabFocusAllControls)
QSKIP("This platform only allows tab focus for text controls");
- QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -462,7 +470,7 @@ void tst_QQuickMenu::disabledMenuItemKeyNavigation()
if (QGuiApplication::styleHints()->tabFocusBehavior() != Qt::TabFocusAllControls)
QSKIP("This platform only allows tab focus for text controls");
- QQuickApplicationHelper helper(this, QLatin1String("disabledMenuItemKeyNavigation.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("disabledMenuItemKeyNavigation.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -527,7 +535,7 @@ void tst_QQuickMenu::mnemonics()
QSKIP("Mnemonics are not used on macOS");
#endif
- QQuickApplicationHelper helper(this, QLatin1String("mnemonics.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("mnemonics.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -581,7 +589,7 @@ void tst_QQuickMenu::menuButton()
if (QGuiApplication::styleHints()->tabFocusBehavior() != Qt::TabFocusAllControls)
QSKIP("This platform only allows tab focus for text controls");
- QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -608,7 +616,7 @@ void tst_QQuickMenu::menuButton()
void tst_QQuickMenu::addItem()
{
- QQuickApplicationHelper helper(this, QLatin1String("addItem.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("addItem.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -630,7 +638,7 @@ void tst_QQuickMenu::addItem()
void tst_QQuickMenu::menuSeparator()
{
- QQuickApplicationHelper helper(this, QLatin1String("menuSeparator.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("menuSeparator.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
centerOnScreen(window);
@@ -708,7 +716,7 @@ void tst_QQuickMenu::menuSeparator()
void tst_QQuickMenu::repeater()
{
- QQuickApplicationHelper helper(this, QLatin1String("repeater.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("repeater.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -753,7 +761,7 @@ void tst_QQuickMenu::repeater()
void tst_QQuickMenu::order()
{
- QQuickApplicationHelper helper(this, QLatin1String("order.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("order.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -775,7 +783,7 @@ void tst_QQuickMenu::order()
void tst_QQuickMenu::popup()
{
- QQuickApplicationHelper helper(this, QLatin1String("popup.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("popup.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -932,7 +940,7 @@ void tst_QQuickMenu::popup()
void tst_QQuickMenu::actions()
{
- QQuickApplicationHelper helper(this, QLatin1String("actions.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("actions.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1001,7 +1009,7 @@ void tst_QQuickMenu::actions()
void tst_QQuickMenu::removeTakeItem()
{
- QQuickApplicationHelper helper(this, QLatin1String("removeTakeItem.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("removeTakeItem.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1059,7 +1067,7 @@ void tst_QQuickMenu::subMenuMouse()
QFETCH(bool, cascade);
- QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("subMenus.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -1166,7 +1174,7 @@ void tst_QQuickMenu::subMenuDisabledMouse()
QFETCH(bool, cascade);
- QQuickApplicationHelper helper(this, QLatin1String("subMenuDisabled.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("subMenuDisabled.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -1229,7 +1237,7 @@ void tst_QQuickMenu::subMenuKeyboard()
QFETCH(bool, cascade);
QFETCH(bool, mirrored);
- QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("subMenus.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -1355,7 +1363,7 @@ void tst_QQuickMenu::subMenuDisabledKeyboard()
QFETCH(bool, cascade);
QFETCH(bool, mirrored);
- QQuickApplicationHelper helper(this, QLatin1String("subMenuDisabled.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("subMenuDisabled.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -1441,7 +1449,7 @@ void tst_QQuickMenu::subMenuPosition()
QFETCH(bool, mirrored);
QFETCH(qreal, overlap);
- QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("subMenus.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
@@ -1569,7 +1577,7 @@ void tst_QQuickMenu::subMenuPosition()
void tst_QQuickMenu::addRemoveSubMenus()
{
- QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("subMenus.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1641,7 +1649,7 @@ void tst_QQuickMenu::scrollable()
{
QFETCH(QString, qmlFilePath);
- QQuickApplicationHelper helper(this, qmlFilePath);
+ QQuickControlsApplicationHelper helper(this, qmlFilePath);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1681,7 +1689,7 @@ void tst_QQuickMenu::disableWhenTriggered()
QFETCH(int, menuItemIndex);
QFETCH(int, subMenuItemIndex);
- QQuickApplicationHelper helper(this, QLatin1String("disableWhenTriggered.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("disableWhenTriggered.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1737,7 +1745,7 @@ void tst_QQuickMenu::menuItemWidth()
{
QFETCH(bool, mirrored);
- QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -1769,7 +1777,7 @@ void tst_QQuickMenu::menuItemWidthAfterMenuWidthChanged()
{
QFETCH(bool, mirrored);
- QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -1817,7 +1825,7 @@ void tst_QQuickMenu::menuItemWidthAfterImplicitWidthChanged()
{
QFETCH(bool, mirrored);
- QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -1851,7 +1859,7 @@ void tst_QQuickMenu::menuItemWidthAfterImplicitWidthChanged()
void tst_QQuickMenu::menuItemWidthAfterRetranslate()
{
- QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -1883,7 +1891,7 @@ void tst_QQuickMenu::menuItemWidthAfterRetranslate()
void tst_QQuickMenu::giveMenuItemFocusOnButtonPress()
{
- QQuickApplicationHelper helper(this, QLatin1String("giveMenuItemFocusOnButtonPress.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("giveMenuItemFocusOnButtonPress.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
diff --git a/tests/auto/quickcontrols2/qquickmenubar/CMakeLists.txt b/tests/auto/quickcontrols2/qquickmenubar/CMakeLists.txt
index 9f3656f0fd..88735ad57f 100644
--- a/tests/auto/quickcontrols2/qquickmenubar/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickmenubar/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickmenubar
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickmenubar.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_qquickmenubar
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickmenubar/tst_qquickmenubar.cpp b/tests/auto/quickcontrols2/qquickmenubar/tst_qquickmenubar.cpp
index 0570024062..4a76ec8eb0 100644
--- a/tests/auto/quickcontrols2/qquickmenubar/tst_qquickmenubar.cpp
+++ b/tests/auto/quickcontrols2/qquickmenubar/tst_qquickmenubar.cpp
@@ -36,24 +36,24 @@
#include <QtTest>
#include <QtQml>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/qtest_quickcontrols.h"
-
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickbutton_p.h>
#include <QtQuickTemplates2/private/qquickmenu_p.h>
#include <QtQuickTemplates2/private/qquickmenubar_p.h>
#include <QtQuickTemplates2/private/qquickmenubaritem_p.h>
#include <QtQuickTemplates2/private/qquickmenuitem_p.h>
+#include <QtQuickControlsTestUtils/private/qtest_quickcontrols_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_qquickmenubar : public QQmlDataTest
{
Q_OBJECT
public:
+ tst_qquickmenubar();
private slots:
void delegate();
@@ -64,6 +64,11 @@ private slots:
void checkHighlightWhenMenuDismissed();
};
+tst_qquickmenubar::tst_qquickmenubar()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qquickmenubar::delegate()
{
QQmlApplicationEngine engine(testFileUrl("empty.qml"));
diff --git a/tests/auto/quickcontrols2/qquickninepatchimage/CMakeLists.txt b/tests/auto/quickcontrols2/qquickninepatchimage/CMakeLists.txt
index d9a18c4959..56edab461d 100644
--- a/tests/auto/quickcontrols2/qquickninepatchimage/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickninepatchimage/CMakeLists.txt
@@ -16,16 +16,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickninepatchimage
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickninepatchimage.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
- LIBRARIES
- Qt::GuiPrivate
- Qt::QuickControls2Private
- Qt::QuickPrivate
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -35,9 +28,11 @@ qt_internal_add_test(tst_qquickninepatchimage
Qt::Quick
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickninepatchimage/tst_qquickninepatchimage.cpp b/tests/auto/quickcontrols2/qquickninepatchimage/tst_qquickninepatchimage.cpp
index 5a62c00a7f..0578248379 100644
--- a/tests/auto/quickcontrols2/qquickninepatchimage/tst_qquickninepatchimage.cpp
+++ b/tests/auto/quickcontrols2/qquickninepatchimage/tst_qquickninepatchimage.cpp
@@ -28,7 +28,6 @@
#include <qtest.h>
#include <QtTest/qsignalspy.h>
-
#include <QtCore/qmath.h>
#include <QtCore/qsize.h>
#include <QtGui/private/qhighdpiscaling_p.h>
@@ -37,16 +36,18 @@
#include <QtQuick/qquickview.h>
#include <QtQuick/qquickitemgrabresult.h>
#include <QtQuick/private/qquickimage_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_qquickninepatchimage : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_qquickninepatchimage();
+
private slots:
void ninePatch_data();
void ninePatch();
@@ -66,6 +67,11 @@ static QImage grabItemToImage(QQuickItem *item)
return result->image();
}
+tst_qquickninepatchimage::tst_qquickninepatchimage()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qquickninepatchimage::ninePatch_data()
{
QTest::addColumn<int>("dpr");
diff --git a/tests/auto/quickcontrols2/qquickpopup/CMakeLists.txt b/tests/auto/quickcontrols2/qquickpopup/CMakeLists.txt
index ad0c89c940..715cf5868c 100644
--- a/tests/auto/quickcontrols2/qquickpopup/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickpopup/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickpopup
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickpopup.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_qquickpopup
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp b/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp
index 51a14a948f..f8f3467a96 100644
--- a/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp
+++ b/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp
@@ -36,14 +36,13 @@
#include <QtTest/qtest.h>
#include <QtTest/qsignalspy.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-#include "../shared/qtest_quickcontrols.h"
#include <QtCore/qoperatingsystemversion.h>
#include <QtGui/qpa/qwindowsysteminterface.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquickpalette_p.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
#include <QtQuickTemplates2/private/qquickcombobox_p.h>
#include <QtQuickTemplates2/private/qquickdialog_p.h>
@@ -54,13 +53,20 @@
#include <QtQuickTemplates2/private/qquickslider_p.h>
#include <QtQuickTemplates2/private/qquickstackview_p.h>
#include <QtQuickTemplates2/private/qquickpopup_p_p.h>
+#include <QtQuickTemplates2/private/qquicktooltip_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
+#include <QtQuickControlsTestUtils/private/qtest_quickcontrols_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickControlsTestUtils;
class tst_QQuickPopup : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickPopup();
+
private slots:
void initTestCase() override;
void visible_data();
@@ -104,6 +110,11 @@ private slots:
void releaseAfterExitTransition();
};
+tst_QQuickPopup::tst_QQuickPopup()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickPopup::initTestCase()
{
QQmlDataTest::initTestCase();
@@ -120,7 +131,7 @@ void tst_QQuickPopup::visible_data()
void tst_QQuickPopup::visible()
{
QFETCH(QString, source);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -154,7 +165,7 @@ void tst_QQuickPopup::visible()
void tst_QQuickPopup::state()
{
- QQuickApplicationHelper helper(this, "applicationwindow.qml");
+ QQuickControlsApplicationHelper helper(this, "applicationwindow.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -217,7 +228,7 @@ void tst_QQuickPopup::overlay()
QFETCH(bool, dim);
QScopedPointer<QPointingDevice> device(QTest::createTouchDevice());
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -368,7 +379,7 @@ void tst_QQuickPopup::zOrder_data()
void tst_QQuickPopup::zOrder()
{
QFETCH(QString, source);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -478,7 +489,7 @@ void tst_QQuickPopup::closePolicy()
QFETCH(QString, source);
QFETCH(QQuickPopup::ClosePolicy, closePolicy);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -563,7 +574,7 @@ void tst_QQuickPopup::activeFocusOnClose1()
{
// Test that a popup that never sets focus: true (e.g. ToolTip) doesn't affect
// the active focus item when it closes.
- QQuickApplicationHelper helper(this, QStringLiteral("activeFocusOnClose1.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("activeFocusOnClose1.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -607,7 +618,7 @@ void tst_QQuickPopup::activeFocusOnClose2()
// Test that a popup that sets focus: true but relinquishes focus (e.g. by
// calling forceActiveFocus() on another item) before it closes doesn't
// affect the active focus item when it closes.
- QQuickApplicationHelper helper(this, QStringLiteral("activeFocusOnClose2.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("activeFocusOnClose2.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -645,7 +656,7 @@ void tst_QQuickPopup::activeFocusOnClose3()
{
// Test that a closing popup that had focus doesn't steal focus from
// another popup that the focus was transferred to.
- QQuickApplicationHelper helper(this, QStringLiteral("activeFocusOnClose3.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("activeFocusOnClose3.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -677,7 +688,7 @@ void tst_QQuickPopup::activeFocusOnClose3()
void tst_QQuickPopup::activeFocusOnClosingSeveralPopups()
{
// Test that active focus isn't lost when multiple popup closing simultaneously
- QQuickApplicationHelper helper(this, QStringLiteral("activeFocusOnClosingSeveralPopups.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("activeFocusOnClosingSeveralPopups.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -739,7 +750,7 @@ void tst_QQuickPopup::hover()
QFETCH(QString, source);
QFETCH(bool, modal);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -815,7 +826,7 @@ void tst_QQuickPopup::wheel()
QFETCH(QString, source);
QFETCH(bool, modal);
- QQuickApplicationHelper helper(this, source);
+ QQuickControlsApplicationHelper helper(this, source);
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -886,7 +897,7 @@ void tst_QQuickPopup::parentDestroyed()
void tst_QQuickPopup::nested()
{
- QQuickApplicationHelper helper(this, QStringLiteral("nested.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("nested.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -914,7 +925,7 @@ void tst_QQuickPopup::nested()
// QTBUG-56697
void tst_QQuickPopup::grabber()
{
- QQuickApplicationHelper helper(this, QStringLiteral("grabber.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("grabber.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -967,7 +978,7 @@ void tst_QQuickPopup::cursorShape()
{
// Ensure that the mouse cursor has the correct shape when over a popup
// which is itself over an item with a different shape.
- QQuickApplicationHelper helper(this, QStringLiteral("cursor.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("cursor.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -1026,7 +1037,7 @@ void tst_QQuickPopup::closeOnEscapeWithNestedPopups()
{
// Tests the scenario in the Gallery example, where there are nested popups that should
// close in the correct order when the Escape key is pressed.
- QQuickApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithNestedPopups.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithNestedPopups.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -1090,7 +1101,7 @@ void tst_QQuickPopup::closeOnEscapeWithNestedPopups()
void tst_QQuickPopup::closeOnEscapeWithVisiblePopup()
{
- QQuickApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithVisiblePopup.qml"));
+ QQuickControlsApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithVisiblePopup.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1141,7 +1152,7 @@ void tst_QQuickPopup::orientation()
QFETCH(Qt::ScreenOrientation, orientation);
QFETCH(QPointF, position);
- QQuickApplicationHelper helper(this, "orientation.qml");
+ QQuickControlsApplicationHelper helper(this, "orientation.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1181,7 +1192,7 @@ void tst_QQuickPopup::qquickview()
// QTBUG-73447
void tst_QQuickPopup::disabledPalette()
{
- QQuickApplicationHelper helper(this, "disabledPalette.qml");
+ QQuickControlsApplicationHelper helper(this, "disabledPalette.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1218,7 +1229,7 @@ void tst_QQuickPopup::disabledPalette()
void tst_QQuickPopup::disabledParentPalette()
{
- QQuickApplicationHelper helper(this, "disabledPalette.qml");
+ QQuickControlsApplicationHelper helper(this, "disabledPalette.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1264,7 +1275,7 @@ void tst_QQuickPopup::disabledParentPalette()
void tst_QQuickPopup::countChanged()
{
- QQuickApplicationHelper helper(this, "countChanged.qml");
+ QQuickControlsApplicationHelper helper(this, "countChanged.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1285,7 +1296,7 @@ void tst_QQuickPopup::toolTipCrashOnClose()
if (!canImportModule("import QtGraphicalEffects; DropShadow {}"))
QSKIP("Test requires QtGraphicalEffects");
- QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml");
+ QQuickControlsApplicationHelper helper(this, "toolTipCrashOnClose.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1304,7 +1315,7 @@ void tst_QQuickPopup::setOverlayParentToNull()
if (!canImportModule("import QtGraphicalEffects; DropShadow {}"))
QSKIP("Test requires QtGraphicalEffects");
- QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml");
+ QQuickControlsApplicationHelper helper(this, "toolTipCrashOnClose.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1327,7 +1338,7 @@ void tst_QQuickPopup::tabFence()
if (QGuiApplication::styleHints()->tabFocusBehavior() != Qt::TabFocusAllControls)
QSKIP("This platform only allows tab focus for text controls");
- QQuickApplicationHelper helper(this, "tabFence.qml");
+ QQuickControlsApplicationHelper helper(this, "tabFence.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1381,7 +1392,7 @@ void tst_QQuickPopup::tabFence()
void tst_QQuickPopup::invisibleToolTipOpen()
{
- QQuickApplicationHelper helper(this, "invisibleToolTipOpen.qml");
+ QQuickControlsApplicationHelper helper(this, "invisibleToolTipOpen.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1412,7 +1423,7 @@ void tst_QQuickPopup::invisibleToolTipOpen()
void tst_QQuickPopup::centerInOverlayWithinStackViewItem()
{
- QQuickApplicationHelper helper(this, "centerInOverlayWithinStackViewItem.qml");
+ QQuickControlsApplicationHelper helper(this, "centerInOverlayWithinStackViewItem.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
@@ -1428,7 +1439,7 @@ void tst_QQuickPopup::centerInOverlayWithinStackViewItem()
void tst_QQuickPopup::destroyDuringExitTransition()
{
- QQuickApplicationHelper helper(this, "destroyDuringExitTransition.qml");
+ QQuickControlsApplicationHelper helper(this, "destroyDuringExitTransition.qml");
QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
diff --git a/tests/auto/quickcontrols2/qquickstyle/CMakeLists.txt b/tests/auto/quickcontrols2/qquickstyle/CMakeLists.txt
index c1d3a30e5f..c39a9a04e6 100644
--- a/tests/auto/quickcontrols2/qquickstyle/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickstyle/CMakeLists.txt
@@ -12,16 +12,9 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickstyle
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickstyle.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
- LIBRARIES
- Qt::CorePrivate
- Qt::GuiPrivate
- Qt::QuickControls2Private
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -29,9 +22,11 @@ qt_internal_add_test(tst_qquickstyle
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp b/tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp
index 9725905160..fad00473d4 100644
--- a/tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp
+++ b/tests/auto/quickcontrols2/qquickstyle/tst_qquickstyle.cpp
@@ -37,6 +37,7 @@
#include <QtTest/qtest.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuickControls2/qquickstyle.h>
#include <QtQuickControls2/private/qquickstyle_p.h>
#include <QtQuickTemplates2/private/qquicklabel_p.h>
@@ -44,12 +45,13 @@
#include <QtQuickTemplates2/private/qquicktheme_p.h>
#include <QtGui/private/qguiapplication_p.h>
-#include "../shared/util.h"
-
class tst_QQuickStyle : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_QQuickStyle();
+
private slots:
void cleanup();
void lookup();
@@ -63,6 +65,11 @@ private:
void unloadControls();
};
+tst_QQuickStyle::tst_QQuickStyle()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickStyle::cleanup()
{
unloadControls();
diff --git a/tests/auto/quickcontrols2/qquickuniversalstyleconf/CMakeLists.txt b/tests/auto/quickcontrols2/qquickuniversalstyleconf/CMakeLists.txt
index ac4a70d332..55c7d78299 100644
--- a/tests/auto/quickcontrols2/qquickuniversalstyleconf/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/qquickuniversalstyleconf/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickuniversalstyleconf
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_qquickuniversalstyleconf.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_qquickuniversalstyleconf
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp b/tests/auto/quickcontrols2/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp
index bef3b1cdc0..1892dd3cf7 100644
--- a/tests/auto/quickcontrols2/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp
+++ b/tests/auto/quickcontrols2/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp
@@ -36,24 +36,32 @@
#include <qtest.h>
#include <QtQuick/private/qquickitem_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickControls2/private/qquickstyle_p.h>
+#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickControlsTestUtils;
class tst_qquickuniversalstyleconf : public QQmlDataTest
{
Q_OBJECT
public:
+ tst_qquickuniversalstyleconf();
private slots:
void conf();
};
+tst_qquickuniversalstyleconf::tst_qquickuniversalstyleconf()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_qquickuniversalstyleconf::conf()
{
- QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
QFont customFont;
diff --git a/tests/auto/quickcontrols2/sanity/CMakeLists.txt b/tests/auto/quickcontrols2/sanity/CMakeLists.txt
index c0d773b2dd..f81efb0bc1 100644
--- a/tests/auto/quickcontrols2/sanity/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/sanity/CMakeLists.txt
@@ -6,9 +6,6 @@
qt_internal_add_test(tst_sanity
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_sanity.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -20,9 +17,11 @@ qt_internal_add_test(tst_sanity
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
)
diff --git a/tests/auto/quickcontrols2/sanity/tst_sanity.cpp b/tests/auto/quickcontrols2/sanity/tst_sanity.cpp
index ecbcf8de03..c29a191cd9 100644
--- a/tests/auto/quickcontrols2/sanity/tst_sanity.cpp
+++ b/tests/auto/quickcontrols2/sanity/tst_sanity.cpp
@@ -46,9 +46,11 @@
#include <QtQml/private/qqmljsast_p.h>
#include <QtQml/private/qqmljsastvisitor_p.h>
#include <QtQml/private/qqmlmetatype_p.h>
-#include "../../../auto/quickcontrols2/shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickControlsTestUtils;
Q_GLOBAL_STATIC(QObjectList, qt_qobjects)
@@ -178,7 +180,7 @@ void tst_Sanity::initTestCase()
// TODO: add native styles: QTBUG-87108
};
for (const auto &stylePathPair : styleRelativePaths) {
- forEachControl(&engine, stylePathPair.first, stylePathPair.second, QStringList(),
+ forEachControl(&engine, QQC2_IMPORT_PATH, stylePathPair.first, stylePathPair.second, QStringList(),
[&](const QString &relativePath, const QUrl &absoluteUrl) {
installedQmlFiles.insert(relativePath, absoluteUrl.toLocalFile());
});
diff --git a/tests/auto/quickcontrols2/shared/util.cpp b/tests/auto/quickcontrols2/shared/util.cpp
deleted file mode 100644
index 31647d69fb..0000000000
--- a/tests/auto/quickcontrols2/shared/util.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "util.h"
-
-#include <QtQml/QQmlComponent>
-#include <QtQml/QQmlError>
-#include <QtQml/QQmlContext>
-#include <QtQml/QQmlEngine>
-#include <QtCore/QTextStream>
-#include <QtCore/QDebug>
-#include <QtCore/QMutexLocker>
-
-QQmlDataTest *QQmlDataTest::m_instance = 0;
-
-QQmlDataTest::QQmlDataTest() :
-#ifdef QT_TESTCASE_BUILDDIR
- m_dataDirectory(QTest::qFindTestData("data", QT_QMLTEST_DATADIR, 0, QT_TESTCASE_BUILDDIR)),
-#else
- m_dataDirectory(QTest::qFindTestData("data", QT_QMLTEST_DATADIR, 0)),
-#endif
-
- m_dataDirectoryUrl(m_dataDirectory.startsWith(QLatin1Char(':'))
- ? QUrl(QLatin1String("qrc") + m_dataDirectory)
- : QUrl::fromLocalFile(m_dataDirectory + QLatin1Char('/')))
-{
- m_instance = this;
-}
-
-QQmlDataTest::~QQmlDataTest()
-{
- m_instance = 0;
-}
-
-void QQmlDataTest::initTestCase()
-{
- QVERIFY2(!m_dataDirectory.isEmpty(), "'data' directory not found");
- m_directory = QFileInfo(m_dataDirectory).absolutePath();
- if (m_dataDirectoryUrl.scheme() != QLatin1String("qrc"))
- QVERIFY2(QDir::setCurrent(m_directory), qPrintable(QLatin1String("Could not chdir to ") + m_directory));
-}
-
-QString QQmlDataTest::testFile(const QString &fileName) const
-{
- if (m_directory.isEmpty())
- qFatal("QQmlDataTest::initTestCase() not called.");
- QString result = m_dataDirectory;
- result += QLatin1Char('/');
- result += fileName;
- return result;
-}
-
-QByteArray QQmlDataTest::msgComponentError(const QQmlComponent &c,
- const QQmlEngine *engine /* = 0 */)
-{
- QString result;
- const QList<QQmlError> errors = c.errors();
- QTextStream str(&result);
- str << "Component '" << c.url().toString() << "' has " << errors.size()
- << " errors: '";
- for (int i = 0; i < errors.size(); ++i) {
- if (i)
- str << ", '";
- str << errors.at(i).toString() << '\'';
-
- }
- if (!engine)
- if (QQmlContext *context = c.creationContext())
- engine = context->engine();
- if (engine) {
- str << " Import paths: (" << engine->importPathList().join(QStringLiteral(", "))
- << ") Plugin paths: (" << engine->pluginPathList().join(QStringLiteral(", "))
- << ')';
- }
- return result.toLocal8Bit();
-}
-
-bool QQmlDataTest::canImportModule(const QString &importTestQmlSource) const
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.setData(importTestQmlSource.toLatin1(), QUrl());
- return !component.isError();
-}
-
-Q_GLOBAL_STATIC(QMutex, qQmlTestMessageHandlerMutex)
-
-QQmlTestMessageHandler *QQmlTestMessageHandler::m_instance = 0;
-
-void QQmlTestMessageHandler::messageHandler(QtMsgType, const QMessageLogContext &, const QString &message)
-{
- QMutexLocker locker(qQmlTestMessageHandlerMutex());
- if (QQmlTestMessageHandler::m_instance)
- QQmlTestMessageHandler::m_instance->m_messages.push_back(message);
-}
-
-QQmlTestMessageHandler::QQmlTestMessageHandler()
-{
- QMutexLocker locker(qQmlTestMessageHandlerMutex());
- Q_ASSERT(!QQmlTestMessageHandler::m_instance);
- QQmlTestMessageHandler::m_instance = this;
- m_oldHandler = qInstallMessageHandler(messageHandler);
-}
-
-QQmlTestMessageHandler::~QQmlTestMessageHandler()
-{
- QMutexLocker locker(qQmlTestMessageHandlerMutex());
- Q_ASSERT(QQmlTestMessageHandler::m_instance);
- qInstallMessageHandler(m_oldHandler);
- QQmlTestMessageHandler::m_instance = 0;
-}
diff --git a/tests/auto/quickcontrols2/shared/util.h b/tests/auto/quickcontrols2/shared/util.h
deleted file mode 100644
index 50d161e058..0000000000
--- a/tests/auto/quickcontrols2/shared/util.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQMLTESTUTILS_H
-#define QQMLTESTUTILS_H
-
-#include <QtCore/QDir>
-#include <QtCore/QUrl>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QStringList>
-#include <QtTest/QTest>
-
-QT_FORWARD_DECLARE_CLASS(QQmlComponent)
-QT_FORWARD_DECLARE_CLASS(QQmlEngine)
-
-/* Base class for tests with data that are located in a "data" subfolder. */
-
-class QQmlDataTest : public QObject
-{
- Q_OBJECT
-public:
- QQmlDataTest();
- virtual ~QQmlDataTest();
-
- QString testFile(const QString &fileName) const;
- inline QString testFile(const char *fileName) const
- { return testFile(QLatin1String(fileName)); }
- inline QUrl testFileUrl(const QString &fileName) const
- { return QUrl::fromLocalFile(testFile(fileName)); }
- inline QUrl testFileUrl(const char *fileName) const
- { return testFileUrl(QLatin1String(fileName)); }
-
- inline QString dataDirectory() const { return m_dataDirectory; }
- inline QUrl dataDirectoryUrl() const { return m_dataDirectoryUrl; }
- inline QString directory() const { return m_directory; }
-
- static inline QQmlDataTest *instance() { return m_instance; }
-
- static QByteArray msgComponentError(const QQmlComponent &,
- const QQmlEngine *engine = 0);
-
- bool canImportModule(const QString &importTestQmlSource) const;
-
-public slots:
- virtual void initTestCase();
-
-private:
- static QQmlDataTest *m_instance;
-
- const QString m_dataDirectory;
- const QUrl m_dataDirectoryUrl;
- QString m_directory;
-};
-
-class QQmlTestMessageHandler
-{
- Q_DISABLE_COPY(QQmlTestMessageHandler)
-public:
- QQmlTestMessageHandler();
- ~QQmlTestMessageHandler();
-
- const QStringList &messages() const { return m_messages; }
- const QString messageString() const { return m_messages.join(QLatin1Char('\n')); }
-
- void clear() { m_messages.clear(); }
-
-private:
- static void messageHandler(QtMsgType, const QMessageLogContext &, const QString &message);
-
- static QQmlTestMessageHandler *m_instance;
- QStringList m_messages;
- QtMessageHandler m_oldHandler;
-};
-
-#endif // QQMLTESTUTILS_H
diff --git a/tests/auto/quickcontrols2/shared/util.pri b/tests/auto/quickcontrols2/shared/util.pri
deleted file mode 100644
index 6366776b2b..0000000000
--- a/tests/auto/quickcontrols2/shared/util.pri
+++ /dev/null
@@ -1,14 +0,0 @@
-QT += testlib-private core-private gui-private qml-private quick-private qmltest quicktemplates2-private quickcontrols2 quickcontrols2-private
-
-HEADERS += $$PWD/visualtestutil.h \
- $$PWD/util.h \
- $$PWD/qtest_quickcontrols.h
-SOURCES += $$PWD/visualtestutil.cpp \
- $$PWD/util.cpp
-
-android|ios {
- DEFINES += QT_QMLTEST_DATADIR=\\\":/data\\\"
-} else {
- DEFINES += QT_QMLTEST_DATADIR=\\\"$${_PRO_FILE_PWD_}/data\\\"
-}
-DEFINES += QQC2_IMPORT_PATH=\\\"$$QQC2_SOURCE_TREE/src\\\"
diff --git a/tests/auto/quickcontrols2/shared/visualtestutil.cpp b/tests/auto/quickcontrols2/shared/visualtestutil.cpp
deleted file mode 100644
index ff0d9e8e5e..0000000000
--- a/tests/auto/quickcontrols2/shared/visualtestutil.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "visualtestutil.h"
-
-#include <QtQuick/QQuickItem>
-#include <QtCore/QDebug>
-#include <QtGui/QCursor>
-#include <QtCore/QCoreApplication>
-#include <QtQml/QQmlFile>
-#include <QtTest/qsignalspy.h>
-#include <QtTest/QTest>
-
-bool QQuickVisualTestUtil::delegateVisible(QQuickItem *item)
-{
- return item->isVisible() && !QQuickItemPrivate::get(item)->culled;
-}
-
-QQuickItem *QQuickVisualTestUtil::findVisibleChild(QQuickItem *parent, const QString &objectName)
-{
- QQuickItem *item = 0;
- QList<QQuickItem*> items = parent->findChildren<QQuickItem*>(objectName);
- for (int i = 0; i < items.count(); ++i) {
- if (items.at(i)->isVisible() && !QQuickItemPrivate::get(items.at(i))->culled) {
- item = items.at(i);
- break;
- }
- }
- return item;
-}
-
-void QQuickVisualTestUtil::dumpTree(QQuickItem *parent, int depth)
-{
- static QString padding(" ");
- for (int i = 0; i < parent->childItems().count(); ++i) {
- QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i));
- if (!item)
- continue;
- qDebug() << padding.left(depth*2) << item;
- dumpTree(item, depth+1);
- }
-}
-
-void QQuickVisualTestUtil::moveMouseAway(QQuickWindow *window)
-{
-#if QT_CONFIG(cursor) // Get the cursor out of the way.
- // Using "bottomRight() + QPoint(100, 100)" was causing issues on Ubuntu,
- // where the window was positioned at the bottom right corner of the window
- // (even after centering the window on the screen), so we use another position.
- QCursor::setPos(window->geometry().bottomLeft() + QPoint(0, 10));
-#endif
-
- // make sure hover events from QQuickWindowPrivate::flushFrameSynchronousEvents()
- // do not interfere with the tests
- QEvent leave(QEvent::Leave);
- QCoreApplication::sendEvent(window, &leave);
-}
-
-void QQuickVisualTestUtil::centerOnScreen(QQuickWindow *window)
-{
- const QRect screenGeometry = window->screen()->availableGeometry();
- const QPoint offset = QPoint(window->width() / 2, window->height() / 2);
- window->setFramePosition(screenGeometry.center() - offset);
-}
-
-/*!
- \internal
-
- Finds the delegate at \c index belonging to \c itemView, using the given \c flags.
-
- If the view needs to be polished, the function will wait for it to be done before continuing,
- and returns \c nullptr if the polish didn't happen.
-*/
-QQuickItem *QQuickVisualTestUtil::findViewDelegateItem(QQuickItemView *itemView, int index, FindViewDelegateItemFlags flags)
-{
- if (QQuickTest::qIsPolishScheduled(itemView)) {
- if (!QQuickTest::qWaitForItemPolished(itemView)) {
- qWarning() << "failed to polish" << itemView;
- return nullptr;
- }
- }
-
- // Do this after the polish, just in case the count changes after a polish...
- if (index <= -1 || index >= itemView->count()) {
- qWarning() << "index" << index << "is out of bounds for" << itemView;
- return nullptr;
- }
-
- if (flags.testFlag(FindViewDelegateItemFlag::PositionViewAtIndex))
- itemView->positionViewAtIndex(index, QQuickItemView::Center);
-
- return itemView->itemAtIndex(index);
-}
-
-void QQuickVisualTestUtil::forEachControl(QQmlEngine *engine, const QString &sourcePath, const QString &targetPath, const QStringList &skipList, QQuickVisualTestUtil::ForEachCallback callback)
-{
- // We cannot use QQmlComponent to load QML files directly from the source tree.
- // For styles that use internal QML types (eg. material/Ripple.qml), the source
- // dir would be added as an "implicit" import path overriding the actual import
- // path (qtbase/qml/QtQuick/Controls.2/Material). => The QML engine fails to load
- // the style C++ plugin from the implicit import path (the source dir).
- //
- // Therefore we only use the source tree for finding out the set of QML files that
- // a particular style implements, and then we locate the respective QML files in
- // the engine's import path. This way we can use QQmlComponent to load each QML file
- // for benchmarking.
-
- const QFileInfoList entries = QDir(QQC2_IMPORT_PATH "/" + sourcePath).entryInfoList(QStringList("*.qml"), QDir::Files);
- for (const QFileInfo &entry : entries) {
- QString name = entry.baseName();
- if (!skipList.contains(name)) {
- const auto importPathList = engine->importPathList();
- for (const QString &importPath : importPathList) {
- QString name = entry.dir().dirName() + "/" + entry.fileName();
- QString filePath = importPath + "/" + targetPath + "/" + entry.fileName();
- if (filePath.startsWith(":"))
- filePath.prepend("qrc");
- if (QFile::exists(filePath)) {
- callback(name, QUrl::fromLocalFile(filePath));
- break;
- } else {
- QUrl url(filePath);
- filePath = QQmlFile::urlToLocalFileOrQrc(filePath);
- if (!filePath.isEmpty() && QFile::exists(filePath)) {
- callback(name, url);
- break;
- }
- }
- }
- }
- }
-}
-
-void QQuickVisualTestUtil::addTestRowForEachControl(QQmlEngine *engine, const QString &sourcePath, const QString &targetPath, const QStringList &skipList)
-{
- forEachControl(engine, sourcePath, targetPath, skipList, [&](const QString &relativePath, const QUrl &absoluteUrl) {
- QTest::newRow(qPrintable(relativePath)) << absoluteUrl;
- });
-}
-
-QQuickVisualTestUtil::MnemonicKeySimulator::MnemonicKeySimulator(QWindow *window)
- : m_window(window), m_modifiers(Qt::NoModifier)
-{
-}
-
-void QQuickVisualTestUtil::MnemonicKeySimulator::press(Qt::Key key)
-{
- // QTest::keyPress() but not generating the press event for the modifier key.
- if (key == Qt::Key_Alt)
- m_modifiers |= Qt::AltModifier;
- QTest::simulateEvent(m_window, true, key, m_modifiers, QString(), false);
-}
-
-void QQuickVisualTestUtil::MnemonicKeySimulator::release(Qt::Key key)
-{
- // QTest::keyRelease() but not generating the release event for the modifier key.
- if (key == Qt::Key_Alt)
- m_modifiers &= ~Qt::AltModifier;
- QTest::simulateEvent(m_window, false, key, m_modifiers, QString(), false);
-}
-
-void QQuickVisualTestUtil::MnemonicKeySimulator::click(Qt::Key key)
-{
- press(key);
- release(key);
-}
-
-
-bool QQuickVisualTestUtil::verifyButtonClickable(QQuickAbstractButton *button)
-{
- if (!button->window()) {
- qWarning() << "button" << button << "doesn't have an associated window";
- return false;
- }
-
- if (!button->isEnabled()) {
- qWarning() << "button" << button << "is not enabled";
- return false;
- }
-
- if (!button->isVisible()) {
- qWarning() << "button" << button << "is not visible";
- return false;
- }
-
- if (button->width() <= 0.0) {
- qWarning() << "button" << button << "must have a width greater than 0";
- return false;
- }
-
- if (button->height() <= 0.0) {
- qWarning() << "button" << button << "must have a height greater than 0";
- return false;
- }
-
- return true;
-}
-
-bool QQuickVisualTestUtil::clickButton(QQuickAbstractButton *button)
-{
- if (!verifyButtonClickable(button))
- return false;
-
- QSignalSpy spy(button, &QQuickAbstractButton::clicked);
- if (!spy.isValid()) {
- qWarning() << "button" << button << "must have a valid clicked signal";
- return false;
- }
-
- const QPoint buttonCenter = button->mapToScene(QPointF(button->width() / 2, button->height() / 2)).toPoint();
- QTest::mouseClick(button->window(), Qt::LeftButton, Qt::NoModifier, buttonCenter);
- if (spy.count() != 1) {
- qWarning() << "clicked signal of button" << button << "was not emitted after clicking";
- return false;
- }
-
- return true;
-}
-
-bool QQuickVisualTestUtil::doubleClickButton(QQuickAbstractButton *button)
-{
- if (!verifyButtonClickable(button))
- return false;
-
- QSignalSpy spy(button, &QQuickAbstractButton::clicked);
- if (!spy.isValid()) {
- qWarning() << "button" << button << "must have a valid doubleClicked signal";
- return false;
- }
-
- const QPoint buttonCenter = button->mapToScene(QPointF(button->width() / 2, button->height() / 2)).toPoint();
- QTest::mouseDClick(button->window(), Qt::LeftButton, Qt::NoModifier, buttonCenter);
- if (spy.count() != 1) {
- qWarning() << "doubleClicked signal of button" << button << "was not emitted after double-clicking";
- return false;
- }
-
- return true;
-}
diff --git a/tests/auto/quickcontrols2/shared/visualtestutil.h b/tests/auto/quickcontrols2/shared/visualtestutil.h
deleted file mode 100644
index 142aefd209..0000000000
--- a/tests/auto/quickcontrols2/shared/visualtestutil.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKVISUALTESTUTIL_H
-#define QQUICKVISUALTESTUTIL_H
-
-#include <functional>
-
-#include <QtCore/QPointer>
-#include <QtQuick/QQuickItem>
-#include <QtQml/QQmlExpression>
-#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/private/qquickitemview_p.h>
-#include <QtQuickTest/quicktest.h>
-#include <QtQuickControls2/qquickstyle.h>
-#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
-#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
-
-#include "util.h"
-
-namespace QQuickVisualTestUtil
-{
- QQuickItem *findVisibleChild(QQuickItem *parent, const QString &objectName);
-
- void dumpTree(QQuickItem *parent, int depth = 0);
-
- bool delegateVisible(QQuickItem *item);
-
- void centerOnScreen(QQuickWindow *window);
-
- void moveMouseAway(QQuickWindow *window);
-
- /*
- Find an item with the specified objectName. If index is supplied then the
- item must also evaluate the {index} expression equal to index
- */
- template<typename T>
- T *findItem(QQuickItem *parent, const QString &objectName, int index = -1)
- {
- const QMetaObject &mo = T::staticMetaObject;
- for (int i = 0; i < parent->childItems().count(); ++i) {
- QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i));
- if (!item)
- continue;
- if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
- if (index != -1) {
- QQmlExpression e(qmlContext(item), item, "index");
- if (e.evaluate().toInt() == index)
- return static_cast<T*>(item);
- } else {
- return static_cast<T*>(item);
- }
- }
- item = findItem<T>(item, objectName, index);
- if (item)
- return static_cast<T*>(item);
- }
-
- return 0;
- }
-
- template<typename T>
- QList<T*> findItems(QQuickItem *parent, const QString &objectName, bool visibleOnly = true)
- {
- QList<T*> items;
- const QMetaObject &mo = T::staticMetaObject;
- for (int i = 0; i < parent->childItems().count(); ++i) {
- QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i));
- if (!item || (visibleOnly && (!item->isVisible() || QQuickItemPrivate::get(item)->culled)))
- continue;
- if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
- items.append(static_cast<T*>(item));
- items += findItems<T>(item, objectName);
- }
-
- return items;
- }
-
- template<typename T>
- QList<T*> findItems(QQuickItem *parent, const QString &objectName, const QList<int> &indexes)
- {
- QList<T*> items;
- for (int i=0; i<indexes.count(); i++)
- items << qobject_cast<QQuickItem*>(findItem<T>(parent, objectName, indexes[i]));
- return items;
- }
-
- enum class FindViewDelegateItemFlag {
- None = 0x0,
- PositionViewAtIndex = 0x01
- };
- Q_DECLARE_FLAGS(FindViewDelegateItemFlags, FindViewDelegateItemFlag)
-
- QQuickItem* findViewDelegateItem(QQuickItemView *itemView, int index,
- FindViewDelegateItemFlags flags = FindViewDelegateItemFlag::PositionViewAtIndex);
-
- /*!
- \internal
-
- Same as above except allows use in QTRY_* functions without having to call it again
- afterwards to assign the delegate.
- */
- template<typename T>
- bool findViewDelegateItem(QQuickItemView *itemView, int index, T &delegateItem,
- FindViewDelegateItemFlags flags = FindViewDelegateItemFlag::PositionViewAtIndex)
- {
- delegateItem = qobject_cast<T>(findViewDelegateItem(itemView, index, flags));
- return delegateItem != nullptr;
- }
-
- class QQuickApplicationHelper
- {
- public:
- QQuickApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath,
- const QStringList &qmlImportPaths = {},
- const QVariantMap &initialProperties = {})
- {
- for (const auto &path : qmlImportPaths)
- engine.addImportPath(path);
-
- QQmlComponent component(&engine);
-
- component.loadUrl(testCase->testFileUrl(testFilePath));
- QVERIFY2(component.isReady(), qPrintable(component.errorString()));
- QObject *rootObject = component.createWithInitialProperties(initialProperties);
- cleanup.reset(rootObject);
- if (component.isError() || !rootObject) {
- errorMessage = QString::fromUtf8("Failed to create window: %1").arg(component.errorString()).toUtf8();
- return;
- }
-
- window = qobject_cast<QQuickWindow*>(rootObject);
- appWindow = qobject_cast<QQuickApplicationWindow*>(rootObject);
- if (!window) {
- errorMessage = QString::fromUtf8("Root object %1 must be a QQuickWindow subclass").arg(QDebug::toString(window)).toUtf8();
- return;
- }
-
- if (window->isVisible()) {
- errorMessage = QString::fromUtf8("Expected window not to be visible, but it is").toUtf8();
- return;
- }
-
- ready = true;
- }
-
- // Return a C-style string instead of QString because that's what QTest uses for error messages,
- // so it saves code at the calling site.
- inline const char *failureMessage() const
- {
- return errorMessage.constData();
- }
-
- QQmlEngine engine;
- QScopedPointer<QObject> cleanup;
- QQuickApplicationWindow *appWindow = nullptr;
- QQuickWindow *window = nullptr;
-
- bool ready = false;
- // Store as a byte array so that we can return its raw data safely;
- // using qPrintable() in failureMessage() will construct a throwaway QByteArray
- // that is destroyed before the function returns.
- QByteArray errorMessage;
- };
-
- struct QQuickStyleHelper
- {
- bool updateStyle(const QString &style)
- {
- // If it's not the first time a style has been set and the new style is not different, do nothing.
- if (!currentStyle.isEmpty() && style == currentStyle)
- return false;
-
- engine.reset();
- currentStyle = style;
- qmlClearTypeRegistrations();
- engine.reset(new QQmlEngine);
- QQuickStyle::setStyle(style);
-
- QQmlComponent component(engine.data());
- component.setData(QString("import QtQuick\nimport QtQuick.Controls\n Control { }").toUtf8(), QUrl());
-
- return true;
- }
-
- QString currentStyle;
- QScopedPointer<QQmlEngine> engine;
- };
-
- typedef std::function<void(const QString &/*relativePath*/, const QUrl &/*absoluteUrl*/)> ForEachCallback;
-
- void forEachControl(QQmlEngine *engine, const QString &sourcePath, const QString &targetPath, const QStringList &skipList, ForEachCallback callback);
- void addTestRowForEachControl(QQmlEngine *engine, const QString &sourcePath, const QString &targetPath, const QStringList &skipList = QStringList());
-
- // Helper to simulate Alt itself and Alt+<key> events.
- class MnemonicKeySimulator
- {
- Q_DISABLE_COPY(MnemonicKeySimulator)
- public:
- explicit MnemonicKeySimulator(QWindow *window);
-
- void press(Qt::Key key);
- void release(Qt::Key key);
- void click(Qt::Key key);
-
- private:
- QPointer<QWindow> m_window;
- Qt::KeyboardModifiers m_modifiers;
- };
-
- [[nodiscard]] bool verifyButtonClickable(QQuickAbstractButton *button);
- [[nodiscard]] bool clickButton(QQuickAbstractButton *button);
- [[nodiscard]] bool doubleClickButton(QQuickAbstractButton *button);
-}
-
-#define QQUICK_VERIFY_POLISH(item) \
- QTRY_COMPARE(QQuickItemPrivate::get(item)->polishScheduled, false)
-
-#endif // QQUICKVISUALTESTUTIL_H
diff --git a/tests/auto/quickcontrols2/styleimports/CMakeLists.txt b/tests/auto/quickcontrols2/styleimports/CMakeLists.txt
index 67012c1d56..0bdcce6774 100644
--- a/tests/auto/quickcontrols2/styleimports/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/styleimports/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_styleimports
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_styleimports.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -26,9 +23,11 @@ qt_internal_add_test(tst_styleimports
Qt::QuickControls2
Qt::QuickControls2ImplPrivate
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/styleimports/tst_styleimports.cpp b/tests/auto/quickcontrols2/styleimports/tst_styleimports.cpp
index fe5148ed7d..68ac8461b0 100644
--- a/tests/auto/quickcontrols2/styleimports/tst_styleimports.cpp
+++ b/tests/auto/quickcontrols2/styleimports/tst_styleimports.cpp
@@ -41,16 +41,18 @@
#include <QtQml/qqmlapplicationengine.h>
#include <QtQml/qqmlengine.h>
#include <QtQuick/qquickwindow.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtQuickControls2/qquickstyle.h>
#include <QtQuickControls2/private/qquickstyle_p.h>
#include <QtQuickControls2Impl/private/qquickiconlabel_p.h>
-#include "../shared/util.h"
-
class tst_StyleImports : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_StyleImports();
+
private slots:
void initTestCase() override;
@@ -65,6 +67,11 @@ private slots:
void fallbackStyleShouldNotOverwriteTheme();
};
+tst_StyleImports::tst_StyleImports()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_StyleImports::initTestCase()
{
QQmlDataTest::initTestCase();
diff --git a/tests/auto/quickcontrols2/styleimportscompiletimematerial/CMakeLists.txt b/tests/auto/quickcontrols2/styleimportscompiletimematerial/CMakeLists.txt
index 06a8fe664c..361ceb9f17 100644
--- a/tests/auto/quickcontrols2/styleimportscompiletimematerial/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/styleimportscompiletimematerial/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_styleimportscompiletimematerial
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_styleimportscompiletimematerial.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_styleimportscompiletimematerial
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/styleimportscompiletimematerial/tst_styleimportscompiletimematerial.cpp b/tests/auto/quickcontrols2/styleimportscompiletimematerial/tst_styleimportscompiletimematerial.cpp
index c0f88b3119..52833c52ec 100644
--- a/tests/auto/quickcontrols2/styleimportscompiletimematerial/tst_styleimportscompiletimematerial.cpp
+++ b/tests/auto/quickcontrols2/styleimportscompiletimematerial/tst_styleimportscompiletimematerial.cpp
@@ -42,26 +42,35 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/private/qqmlmetatype_p.h>
#include <QtQuick/qquickwindow.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtQuickControls2/qquickstyle.h>
#include <QtQuickControls2/private/qquickstyle_p.h>
#include <QtQuickTemplates2/private/qquickbutton_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickControlsTestUtils;
class tst_StyleImportsCompileTimeMaterial : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_StyleImportsCompileTimeMaterial();
+
private slots:
void importMaterialStyleWithoutControls();
};
+tst_StyleImportsCompileTimeMaterial::tst_StyleImportsCompileTimeMaterial()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_StyleImportsCompileTimeMaterial::importMaterialStyleWithoutControls()
{
- QQuickApplicationHelper helper(this, QLatin1String("importMaterialStyleWithoutControls.qml"));
+ QQuickControlsApplicationHelper helper(this, QLatin1String("importMaterialStyleWithoutControls.qml"));
QVERIFY2(helper.ready, helper.failureMessage());
auto button = helper.window->property("button").value<QQuickButton*>();
diff --git a/tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/CMakeLists.txt b/tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/CMakeLists.txt
index 2e5c80669e..ca1a4f51ba 100644
--- a/tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_styleimportscompiletimeqmlonly
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_styleimportscompiletimeqmlonly.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_styleimportscompiletimeqmlonly
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/tst_styleimportscompiletimeqmlonly.cpp b/tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/tst_styleimportscompiletimeqmlonly.cpp
index 7fd41ed9ba..b66b1179fa 100644
--- a/tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/tst_styleimportscompiletimeqmlonly.cpp
+++ b/tests/auto/quickcontrols2/styleimportscompiletimeqmlonly/tst_styleimportscompiletimeqmlonly.cpp
@@ -41,26 +41,33 @@
#include <QtQml/qqmlapplicationengine.h>
#include <QtQml/qqmlengine.h>
#include <QtQuick/qquickwindow.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
#include <QtQuickControls2/qquickstyle.h>
#include <QtQuickControls2/private/qquickstyle_p.h>
#include <QtQuickTemplates2/private/qquickbutton_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-
-using namespace QQuickVisualTestUtil;
+using namespace QQuickControlsTestUtils;
class tst_StyleImportsCompileTimeQmlOnly : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_StyleImportsCompileTimeQmlOnly();
+
private slots:
void importQmlOnlyStyleWithoutControls();
};
+tst_StyleImportsCompileTimeQmlOnly::tst_StyleImportsCompileTimeQmlOnly()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_StyleImportsCompileTimeQmlOnly::importQmlOnlyStyleWithoutControls()
{
- QQuickApplicationHelper helper(this,
+ QQuickControlsApplicationHelper helper(this,
QLatin1String("importQmlOnlyStyleWithoutControls.qml"), QStringList() << dataDirectory());
QVERIFY2(helper.ready, helper.failureMessage());
diff --git a/tests/auto/quickcontrols2/translation/CMakeLists.txt b/tests/auto/quickcontrols2/translation/CMakeLists.txt
index e21dc99965..cbb8b30c95 100644
--- a/tests/auto/quickcontrols2/translation/CMakeLists.txt
+++ b/tests/auto/quickcontrols2/translation/CMakeLists.txt
@@ -12,9 +12,6 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_translation
SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
tst_translation.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -25,9 +22,11 @@ qt_internal_add_test(tst_translation
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickcontrols2/translation/tst_translation.cpp b/tests/auto/quickcontrols2/translation/tst_translation.cpp
index 58ce86ccd8..b398ce4794 100644
--- a/tests/auto/quickcontrols2/translation/tst_translation.cpp
+++ b/tests/auto/quickcontrols2/translation/tst_translation.cpp
@@ -35,12 +35,12 @@
****************************************************************************/
#include <QtTest/qtest.h>
-#include "../shared/visualtestutil.h"
-
#include <QtCore/qtranslator.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformtheme.h>
#include <QtQuick/qquickview.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
#include <QtQuickTemplates2/private/qquickcombobox_p.h>
#include <QtQuickTemplates2/private/qquickdialog_p.h>
@@ -48,7 +48,7 @@
#include <QtQuickTemplates2/private/qquicktextfield_p.h>
#include <QtQuickControls2/qquickstyle.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
class tst_translation : public QQmlDataTest
{
@@ -64,6 +64,7 @@ private slots:
};
tst_translation::tst_translation()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
QQuickStyle::setStyle("Basic");
}
diff --git a/tests/auto/quicktest/polish-qml/CMakeLists.txt b/tests/auto/quicktest/polish-qml/CMakeLists.txt
index ff09b1e82e..0cf36f9ab4 100644
--- a/tests/auto/quicktest/polish-qml/CMakeLists.txt
+++ b/tests/auto/quicktest/polish-qml/CMakeLists.txt
@@ -13,14 +13,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_polish-qml
QMLTEST
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_polish-qml.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Quick
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quicktest/polish-qml/tst_polish-qml.cpp b/tests/auto/quicktest/polish-qml/tst_polish-qml.cpp
index e525a8a5af..a378af58af 100644
--- a/tests/auto/quicktest/polish-qml/tst_polish-qml.cpp
+++ b/tests/auto/quicktest/polish-qml/tst_polish-qml.cpp
@@ -33,8 +33,6 @@
#include <QtQuick/qquickview.h>
#include <QtQuickTest/quicktest.h>
-#include "../../shared/util.h"
-
class CustomItem : public QQuickItem
{
Q_OBJECT
diff --git a/tests/auto/quicktest/polish/CMakeLists.txt b/tests/auto/quicktest/polish/CMakeLists.txt
index d980935c88..acb29bab9d 100644
--- a/tests/auto/quicktest/polish/CMakeLists.txt
+++ b/tests/auto/quicktest/polish/CMakeLists.txt
@@ -13,14 +13,12 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_polish
QMLTEST
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_polish.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Quick
Qt::QuickPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quicktest/polish/tst_polish.cpp b/tests/auto/quicktest/polish/tst_polish.cpp
index 3b96002cd2..ec0580c15d 100644
--- a/tests/auto/quicktest/polish/tst_polish.cpp
+++ b/tests/auto/quicktest/polish/tst_polish.cpp
@@ -33,7 +33,7 @@
#include <QQuickView>
#include <QtQuickTest/quicktest.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
class CustomItem : public QQuickItem
{
@@ -62,6 +62,7 @@ private slots:
};
tst_Polish::tst_Polish()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qmlRegisterType<CustomItem>("Test", 1, 0, "CustomItem");
}
diff --git a/tests/auto/quicktest/quicktestmainwithsetup/CMakeLists.txt b/tests/auto/quicktest/quicktestmainwithsetup/CMakeLists.txt
index 9d627dbe43..c8900b38de 100644
--- a/tests/auto/quicktest/quicktestmainwithsetup/CMakeLists.txt
+++ b/tests/auto/quicktest/quicktestmainwithsetup/CMakeLists.txt
@@ -13,13 +13,11 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_quicktestmainwithsetup
QMLTEST
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_quicktestmainwithsetup.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp b/tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp
index b5deeceac4..38b50bd617 100644
--- a/tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp
+++ b/tests/auto/quicktest/quicktestmainwithsetup/tst_quicktestmainwithsetup.cpp
@@ -33,8 +33,6 @@
#include <QtQuick/qquickview.h>
#include <QtQuickTest/quicktest.h>
-#include "../../shared/util.h"
-
class QmlRegisterTypeCppType : public QObject
{
Q_OBJECT
diff --git a/tests/auto/quicktest/signalspy/CMakeLists.txt b/tests/auto/quicktest/signalspy/CMakeLists.txt
index cda19b605a..8160687340 100644
--- a/tests/auto/quicktest/signalspy/CMakeLists.txt
+++ b/tests/auto/quicktest/signalspy/CMakeLists.txt
@@ -6,14 +6,12 @@
qt_internal_add_test(tst_signalspy
SOURCES
- ../../shared/util.cpp ../../shared/util.h
mypropertymap.cpp mypropertymap.h
tst_signalspy.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::Gui
Qt::Quick
+ Qt::QuickTestUtilsPrivate
)
## Scopes:
diff --git a/tests/auto/quicktest/signalspy/tst_signalspy.cpp b/tests/auto/quicktest/signalspy/tst_signalspy.cpp
index 0806f43c1c..839d5c4b02 100644
--- a/tests/auto/quicktest/signalspy/tst_signalspy.cpp
+++ b/tests/auto/quicktest/signalspy/tst_signalspy.cpp
@@ -32,7 +32,7 @@
#include <qquickitem.h>
#include <qquickview.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include "mypropertymap.h"
class tst_SignalSpy : public QQmlDataTest
@@ -50,6 +50,7 @@ private:
};
tst_SignalSpy::tst_SignalSpy()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
qmlRegisterType<MyPropertyMap>("MyImport", 1, 0, "MyPropertyMap");
}
diff --git a/tests/auto/quickwidgets/qquickwidget/CMakeLists.txt b/tests/auto/quickwidgets/qquickwidget/CMakeLists.txt
index 9018d5544d..b1e5b873f2 100644
--- a/tests/auto/quickwidgets/qquickwidget/CMakeLists.txt
+++ b/tests/auto/quickwidgets/qquickwidget/CMakeLists.txt
@@ -12,10 +12,7 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickwidget
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickwidget.cpp
- INCLUDE_DIRECTORIES
- ../../shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -25,6 +22,7 @@ qt_internal_add_test(tst_qquickwidget
Qt::QuickWidgets
Qt::QuickWidgetsPrivate
Qt::WidgetsPrivate
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
index c902cf56b3..c564a29c51 100644
--- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
+++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
@@ -34,7 +34,7 @@
#include <QtQuick/qquickview.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/private/qquickitem_p.h>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#include <QtGui/QWindow>
#include <QtGui/QScreen>
#include <QtGui/QImage>
@@ -152,6 +152,7 @@ private:
};
tst_qquickwidget::tst_qquickwidget()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
{
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
}
diff --git a/tests/benchmarks/quick/events/CMakeLists.txt b/tests/benchmarks/quick/events/CMakeLists.txt
index 29ee7bc803..112249ad11 100644
--- a/tests/benchmarks/quick/events/CMakeLists.txt
+++ b/tests/benchmarks/quick/events/CMakeLists.txt
@@ -6,15 +6,9 @@
qt_internal_add_benchmark(tst_qevents
SOURCES
- ../../../auto/quick/shared/geometrytestutil.cpp ../../../auto/quick/shared/geometrytestutil.h
- ../../../auto/quick/shared/viewtestutil.cpp ../../../auto/quick/shared/viewtestutil.h
- ../../../auto/quick/shared/visualtestutil.cpp ../../../auto/quick/shared/visualtestutil.h
- ../../../auto/shared/util.cpp ../../../auto/shared/util.h
tst_events.cpp
DEFINES
QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
- INCLUDE_DIRECTORIES
- ../../../auto/shared
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Gui
@@ -24,6 +18,7 @@ qt_internal_add_benchmark(tst_qevents
Qt::Quick
Qt::QuickPrivate
Qt::Test
+ Qt::QuickTestUtilsPrivate
)
#### Keys ignored in scope 1:.:.:events.pro:<TRUE>:
diff --git a/tests/benchmarks/quick/events/tst_events.cpp b/tests/benchmarks/quick/events/tst_events.cpp
index 1033dc30b6..df4239a503 100644
--- a/tests/benchmarks/quick/events/tst_events.cpp
+++ b/tests/benchmarks/quick/events/tst_events.cpp
@@ -30,9 +30,8 @@
#include <QtQuick>
#include <QtQuick/private/qquickmousearea_p.h>
#include <QDebug>
-#include "../../../auto/shared/util.h"
-#include "../../../auto/quick/shared/viewtestutil.h"
-
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
class TestView : public QQuickView
{
@@ -45,6 +44,9 @@ class tst_events : public QQmlDataTest
{
Q_OBJECT
+public:
+ tst_events();
+
private slots:
void mousePressRelease();
void mouseMove();
@@ -64,6 +66,11 @@ private:
TestView window;
};
+tst_events::tst_events()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_events::mousePressRelease()
{
QQuickMouseArea *mouseArea = window.rootObject()->findChild<QQuickMouseArea *>("mouseArea");
diff --git a/tests/benchmarks/quickcontrols2/creationtime/CMakeLists.txt b/tests/benchmarks/quickcontrols2/creationtime/CMakeLists.txt
index d7dcb3da8f..9e3a6d58c1 100644
--- a/tests/benchmarks/quickcontrols2/creationtime/CMakeLists.txt
+++ b/tests/benchmarks/quickcontrols2/creationtime/CMakeLists.txt
@@ -6,9 +6,6 @@
qt_internal_add_test(tst_creationtime
SOURCES
- ../../../auto/quickcontrols2/shared/qtest_quickcontrols.h
- ../../../auto/quickcontrols2/shared/util.cpp ../../../auto/quickcontrols2/shared/util.h
- ../../../auto/quickcontrols2/shared/visualtestutil.cpp ../../../auto/quickcontrols2/shared/visualtestutil.h
tst_creationtime.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -20,9 +17,11 @@ qt_internal_add_test(tst_creationtime
Qt::QmlPrivate
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
)
diff --git a/tests/benchmarks/quickcontrols2/creationtime/tst_creationtime.cpp b/tests/benchmarks/quickcontrols2/creationtime/tst_creationtime.cpp
index 5577966273..d0259e9a01 100644
--- a/tests/benchmarks/quickcontrols2/creationtime/tst_creationtime.cpp
+++ b/tests/benchmarks/quickcontrols2/creationtime/tst_creationtime.cpp
@@ -39,9 +39,12 @@
#include <QtQml>
#include <QtQuickControls2/qquickstyle.h>
-#include "../../../auto/quickcontrols2/shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/viewtestutils_p.h>
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickControlsTestUtils;
+using namespace QQuickVisualTestUtils;
class tst_CreationTime : public QObject
{
@@ -111,7 +114,8 @@ void tst_CreationTime::basicStyle()
void tst_CreationTime::basicStyle_data()
{
QTest::addColumn<QUrl>("url");
- addTestRowForEachControl(styleHelper.engine.data(), "basic", "QtQuick/Controls/Basic", QStringList() << "ApplicationWindow");
+ addTestRowForEachControl(styleHelper.engine.data(), QQC2_IMPORT_PATH, "basic", "QtQuick/Controls/Basic",
+ QStringList() << "ApplicationWindow");
}
void tst_CreationTime::fusion()
@@ -123,7 +127,9 @@ void tst_CreationTime::fusion()
void tst_CreationTime::fusion_data()
{
QTest::addColumn<QUrl>("url");
- addTestRowForEachControl(styleHelper.engine.data(), "fusion", "QtQuick/Controls/Fusion", QStringList() << "ApplicationWindow" << "ButtonPanel" << "CheckIndicator" << "RadioIndicator" << "SliderGroove" << "SliderHandle" << "SwitchIndicator");
+ addTestRowForEachControl(styleHelper.engine.data(), QQC2_IMPORT_PATH, "fusion", "QtQuick/Controls/Fusion",
+ QStringList() << "ApplicationWindow" << "ButtonPanel" << "CheckIndicator"
+ << "RadioIndicator" << "SliderGroove" << "SliderHandle" << "SwitchIndicator");
}
void tst_CreationTime::imagine()
@@ -135,7 +141,8 @@ void tst_CreationTime::imagine()
void tst_CreationTime::imagine_data()
{
QTest::addColumn<QUrl>("url");
- addTestRowForEachControl(styleHelper.engine.data(), "imagine", "QtQuick/Controls/Imagine", QStringList() << "ApplicationWindow");
+ addTestRowForEachControl(styleHelper.engine.data(), QQC2_IMPORT_PATH, "imagine", "QtQuick/Controls/Imagine",
+ QStringList() << "ApplicationWindow");
}
void tst_CreationTime::material()
@@ -147,7 +154,9 @@ void tst_CreationTime::material()
void tst_CreationTime::material_data()
{
QTest::addColumn<QUrl>("url");
- addTestRowForEachControl(styleHelper.engine.data(), "material", "QtQuick/Controls/Material", QStringList() << "ApplicationWindow" << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate");
+ addTestRowForEachControl(styleHelper.engine.data(), QQC2_IMPORT_PATH, "material", "QtQuick/Controls/Material",
+ QStringList() << "ApplicationWindow" << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator"
+ << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate");
}
void tst_CreationTime::universal()
@@ -159,7 +168,8 @@ void tst_CreationTime::universal()
void tst_CreationTime::universal_data()
{
QTest::addColumn<QUrl>("url");
- addTestRowForEachControl(styleHelper.engine.data(), "universal", "QtQuick/Controls/Universal", QStringList() << "ApplicationWindow" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ addTestRowForEachControl(styleHelper.engine.data(), QQC2_IMPORT_PATH, "universal", "QtQuick/Controls/Universal",
+ QStringList() << "ApplicationWindow" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
}
QTEST_MAIN(tst_CreationTime)
diff --git a/tests/benchmarks/quickcontrols2/objectcount/CMakeLists.txt b/tests/benchmarks/quickcontrols2/objectcount/CMakeLists.txt
index 1d685fc7c6..8148e60fc4 100644
--- a/tests/benchmarks/quickcontrols2/objectcount/CMakeLists.txt
+++ b/tests/benchmarks/quickcontrols2/objectcount/CMakeLists.txt
@@ -6,9 +6,6 @@
qt_internal_add_test(tst_objectcount
SOURCES
- ../../../auto/quickcontrols2/shared/qtest_quickcontrols.h
- ../../../auto/quickcontrols2/shared/util.cpp ../../../auto/quickcontrols2/shared/util.h
- ../../../auto/quickcontrols2/shared/visualtestutil.cpp ../../../auto/quickcontrols2/shared/visualtestutil.h
tst_objectcount.cpp
DEFINES
QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
@@ -20,9 +17,11 @@ qt_internal_add_test(tst_objectcount
Qt::Quick
Qt::QuickControls2
Qt::QuickControls2Private
+ Qt::QuickControlsTestUtilsPrivate
Qt::QuickPrivate
Qt::QuickTemplates2Private
Qt::QuickTest
+ Qt::QuickTestUtilsPrivate
Qt::TestPrivate
)
diff --git a/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp b/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
index ea2a63dc52..14785a5a95 100644
--- a/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
@@ -38,9 +38,11 @@
#include <QtQuick>
#include <QtCore/private/qhooks_p.h>
#include <iostream>
-#include "../../../auto/quickcontrols2/shared/visualtestutil.h"
+#include <QtQuickTestUtils/private/visualtestutils_p.h>
+#include <QtQuickControlsTestUtils/private/controlstestutils_p.h>
-using namespace QQuickVisualTestUtil;
+using namespace QQuickVisualTestUtils;
+using namespace QQuickControlsTestUtils;
static int qt_verbose = qEnvironmentVariableIntValue("VERBOSE") != 0;
@@ -93,11 +95,15 @@ void tst_ObjectCount::cleanup()
static void initTestRows(QQmlEngine *engine)
{
- addTestRowForEachControl(engine, "basic", "QtQuick/Controls/Basic");
- addTestRowForEachControl(engine, "fusion", "QtQuick/Controls/Fusion", QStringList() << "ButtonPanel" << "CheckIndicator" << "RadioIndicator" << "SliderGroove" << "SliderHandle" << "SwitchIndicator");
- addTestRowForEachControl(engine, "imagine", "QtQuick/Controls/Imagine");
- addTestRowForEachControl(engine, "material", "QtQuick/Controls/Material", QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate");
- addTestRowForEachControl(engine, "universal", "QtQuick/Controls/Universal", QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
+ addTestRowForEachControl(engine, QQC2_IMPORT_PATH, "basic", "QtQuick/Controls/Basic");
+ addTestRowForEachControl(engine, QQC2_IMPORT_PATH, "fusion", "QtQuick/Controls/Fusion",
+ QStringList() << "ButtonPanel" << "CheckIndicator" << "RadioIndicator" << "SliderGroove" << "SliderHandle" << "SwitchIndicator");
+ addTestRowForEachControl(engine, QQC2_IMPORT_PATH, "imagine", "QtQuick/Controls/Imagine");
+ addTestRowForEachControl(engine, QQC2_IMPORT_PATH, "material", "QtQuick/Controls/Material",
+ QStringList() << "Ripple" << "SliderHandle" << "CheckIndicator" << "RadioIndicator"
+ << "SwitchIndicator" << "BoxShadow" << "ElevationEffect" << "CursorDelegate");
+ addTestRowForEachControl(engine, QQC2_IMPORT_PATH, "universal", "QtQuick/Controls/Universal",
+ QStringList() << "CheckIndicator" << "RadioIndicator" << "SwitchIndicator");
}
template <typename T>