From 052a247133fe98a5941a570134b48a7b97853092 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Wed, 27 Oct 2021 17:55:30 +0200 Subject: Build minimal subset of QtLocation with unit-tests Build src/location/maps and src/location/places with a minimum subset of required src/location/declarativemaps files. Also build all plugins except mapbox-gl. Enable all non-QML unit-tests. Task-number: QTBUG-97769 Change-Id: I7c70584376c688efd2e1d046186732a7399e12d9 Reviewed-by: Qt CI Bot Reviewed-by: Alex Blasche --- CMakeLists.txt | 13 +- coin/module_config.yaml | 3 +- examples/examples.pro | 3 +- src/CMakeLists.txt | 4 +- src/location/CMakeLists.txt | 132 +++++++++++++++++ src/plugins/geoservices/CMakeLists.txt | 5 + src/plugins/geoservices/esri/CMakeLists.txt | 32 +++++ .../geoservices/itemsoverlay/CMakeLists.txt | 13 ++ src/plugins/geoservices/mapbox/CMakeLists.txt | 32 +++++ src/plugins/geoservices/nokia/CMakeLists.txt | 46 ++++++ src/plugins/geoservices/osm/CMakeLists.txt | 25 ++++ tests/auto/CMakeLists.txt | 102 ++++++------- tests/auto/geotestplugin/CMakeLists.txt | 33 +++++ .../geotestplugin/qgeocodingmanagerengine_test.h | 8 +- .../geotestplugin/qgeoroutingmanagerengine_test.h | 4 +- .../geotestplugin/qgeoserviceproviderplugin_test.h | 24 ++-- tests/auto/geotestplugin/qgeotilefetcher_test.h | 6 +- .../auto/geotestplugin/qplacemanagerengine_test.h | 2 +- tests/auto/maptype/CMakeLists.txt | 7 + tests/auto/nokia_services/CMakeLists.txt | 2 + .../nokia_services/places_semiauto/CMakeLists.txt | 10 ++ tests/auto/nokia_services/routing/CMakeLists.txt | 14 ++ tests/auto/nokia_services/routing/tst_routing.cpp | 10 +- tests/auto/placesplugin_unsupported/CMakeLists.txt | 12 ++ .../qgeoserviceproviderplugin_test.h | 2 +- tests/auto/qgeocameracapabilities/CMakeLists.txt | 8 ++ tests/auto/qgeocameradata/CMakeLists.txt | 8 ++ tests/auto/qgeocameradata/tst_qgeocameradata.cpp | 2 +- tests/auto/qgeocameratiles/CMakeLists.txt | 8 ++ tests/auto/qgeocodereply/CMakeLists.txt | 8 ++ tests/auto/qgeocodingmanager/CMakeLists.txt | 8 ++ tests/auto/qgeocodingmanagerplugins/CMakeLists.txt | 14 ++ .../qgeocodingmanagerengine_test.h | 8 +- .../qgeoserviceproviderplugin_test.h | 6 +- tests/auto/qgeojson/CMakeLists.txt | 8 ++ tests/auto/qgeomaneuver/CMakeLists.txt | 7 + tests/auto/qgeoroute/CMakeLists.txt | 7 + tests/auto/qgeoroutereply/CMakeLists.txt | 8 ++ tests/auto/qgeorouterequest/CMakeLists.txt | 8 ++ tests/auto/qgeoroutesegment/CMakeLists.txt | 8 ++ tests/auto/qgeoroutexmlparser/CMakeLists.txt | 20 +++ tests/auto/qgeoroutingmanager/CMakeLists.txt | 8 ++ .../auto/qgeoroutingmanagerplugins/CMakeLists.txt | 14 ++ .../qgeoroutingmanagerengine_test.h | 4 +- .../qgeoserviceproviderplugin_test.h | 3 +- tests/auto/qgeoserviceprovider/CMakeLists.txt | 7 + tests/auto/qgeotiledmap/CMakeLists.txt | 10 ++ tests/auto/qgeotiledmapscene/CMakeLists.txt | 8 ++ .../qgeotiledmapscene/tst_qgeotiledmapscene.cpp | 10 +- tests/auto/qgeotilespec/CMakeLists.txt | 7 + tests/auto/qgeotilespec/tst_qgeotilespec.cpp | 2 +- tests/auto/qplace/CMakeLists.txt | 8 ++ tests/auto/qplaceattribute/CMakeLists.txt | 7 + tests/auto/qplacecategory/CMakeLists.txt | 7 + tests/auto/qplacecontactdetail/CMakeLists.txt | 7 + tests/auto/qplacecontentrequest/CMakeLists.txt | 7 + tests/auto/qplacedetailsreply/CMakeLists.txt | 7 + tests/auto/qplaceeditorial/CMakeLists.txt | 7 + tests/auto/qplaceimage/CMakeLists.txt | 7 + tests/auto/qplacemanager/CMakeLists.txt | 7 + tests/auto/qplacemanager_nokia/CMakeLists.txt | 7 + .../auto/qplacemanager_unsupported/CMakeLists.txt | 7 + tests/auto/qplacematchreply/CMakeLists.txt | 7 + tests/auto/qplacematchrequest/CMakeLists.txt | 7 + tests/auto/qplaceratings/CMakeLists.txt | 7 + tests/auto/qplacereply/CMakeLists.txt | 7 + tests/auto/qplaceresult/CMakeLists.txt | 7 + tests/auto/qplacereview/CMakeLists.txt | 7 + tests/auto/qplacesearchreply/CMakeLists.txt | 8 ++ tests/auto/qplacesearchrequest/CMakeLists.txt | 8 ++ tests/auto/qplacesearchresult/CMakeLists.txt | 7 + .../qplacesearchsuggestionreply/CMakeLists.txt | 7 + tests/auto/qplacesupplier/CMakeLists.txt | 7 + tests/auto/qplaceuser/CMakeLists.txt | 7 + tests/auto/qproposedsearchresult/CMakeLists.txt | 7 + tests/auto/utils/qlocationtestutils_p.h | 158 +++++++++++++++++++++ 76 files changed, 982 insertions(+), 100 deletions(-) create mode 100644 src/location/CMakeLists.txt create mode 100644 src/plugins/geoservices/CMakeLists.txt create mode 100644 src/plugins/geoservices/esri/CMakeLists.txt create mode 100644 src/plugins/geoservices/itemsoverlay/CMakeLists.txt create mode 100644 src/plugins/geoservices/mapbox/CMakeLists.txt create mode 100644 src/plugins/geoservices/nokia/CMakeLists.txt create mode 100644 src/plugins/geoservices/osm/CMakeLists.txt create mode 100644 tests/auto/geotestplugin/CMakeLists.txt create mode 100644 tests/auto/maptype/CMakeLists.txt create mode 100644 tests/auto/nokia_services/CMakeLists.txt create mode 100644 tests/auto/nokia_services/places_semiauto/CMakeLists.txt create mode 100644 tests/auto/nokia_services/routing/CMakeLists.txt create mode 100644 tests/auto/placesplugin_unsupported/CMakeLists.txt create mode 100644 tests/auto/qgeocameracapabilities/CMakeLists.txt create mode 100644 tests/auto/qgeocameradata/CMakeLists.txt create mode 100644 tests/auto/qgeocameratiles/CMakeLists.txt create mode 100644 tests/auto/qgeocodereply/CMakeLists.txt create mode 100644 tests/auto/qgeocodingmanager/CMakeLists.txt create mode 100644 tests/auto/qgeocodingmanagerplugins/CMakeLists.txt create mode 100644 tests/auto/qgeojson/CMakeLists.txt create mode 100644 tests/auto/qgeomaneuver/CMakeLists.txt create mode 100644 tests/auto/qgeoroute/CMakeLists.txt create mode 100644 tests/auto/qgeoroutereply/CMakeLists.txt create mode 100644 tests/auto/qgeorouterequest/CMakeLists.txt create mode 100644 tests/auto/qgeoroutesegment/CMakeLists.txt create mode 100644 tests/auto/qgeoroutexmlparser/CMakeLists.txt create mode 100644 tests/auto/qgeoroutingmanager/CMakeLists.txt create mode 100644 tests/auto/qgeoroutingmanagerplugins/CMakeLists.txt create mode 100644 tests/auto/qgeoserviceprovider/CMakeLists.txt create mode 100644 tests/auto/qgeotiledmap/CMakeLists.txt create mode 100644 tests/auto/qgeotiledmapscene/CMakeLists.txt create mode 100644 tests/auto/qgeotilespec/CMakeLists.txt create mode 100644 tests/auto/qplace/CMakeLists.txt create mode 100644 tests/auto/qplaceattribute/CMakeLists.txt create mode 100644 tests/auto/qplacecategory/CMakeLists.txt create mode 100644 tests/auto/qplacecontactdetail/CMakeLists.txt create mode 100644 tests/auto/qplacecontentrequest/CMakeLists.txt create mode 100644 tests/auto/qplacedetailsreply/CMakeLists.txt create mode 100644 tests/auto/qplaceeditorial/CMakeLists.txt create mode 100644 tests/auto/qplaceimage/CMakeLists.txt create mode 100644 tests/auto/qplacemanager/CMakeLists.txt create mode 100644 tests/auto/qplacemanager_nokia/CMakeLists.txt create mode 100644 tests/auto/qplacemanager_unsupported/CMakeLists.txt create mode 100644 tests/auto/qplacematchreply/CMakeLists.txt create mode 100644 tests/auto/qplacematchrequest/CMakeLists.txt create mode 100644 tests/auto/qplaceratings/CMakeLists.txt create mode 100644 tests/auto/qplacereply/CMakeLists.txt create mode 100644 tests/auto/qplaceresult/CMakeLists.txt create mode 100644 tests/auto/qplacereview/CMakeLists.txt create mode 100644 tests/auto/qplacesearchreply/CMakeLists.txt create mode 100644 tests/auto/qplacesearchrequest/CMakeLists.txt create mode 100644 tests/auto/qplacesearchresult/CMakeLists.txt create mode 100644 tests/auto/qplacesearchsuggestionreply/CMakeLists.txt create mode 100644 tests/auto/qplacesupplier/CMakeLists.txt create mode 100644 tests/auto/qplaceuser/CMakeLists.txt create mode 100644 tests/auto/qproposedsearchresult/CMakeLists.txt create mode 100644 tests/auto/utils/qlocationtestutils_p.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 60a37ba6..ead9a48e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,17 @@ endif() # Need to search for positioning only after we make sure that it's not WASM. # Otherwise we'll get an "QtPositioning not found" error in WASM build. find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Positioning) # special case -find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Quick Qml Gui Widgets Network Test QuickTest PositioningQuick) # special case +find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Quick Qml Network Test QuickTest PositioningQuick) # special case + +macro(assertTargets) + foreach(qtTarget IN ITEMS ${ARGN}) + if(NOT TARGET Qt::${qtTarget}) + message(NOTICE "Skipping the build as the condition \"TARGET Qt::${qtTarget}\" is not met.") + return() + endif() + endforeach() +endmacro() + +assertTargets(Quick PositioningQuick) qt_build_repo() diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 6c1ee3f7..16d158c6 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -8,4 +8,5 @@ instructions: Build: - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" - Test: [] + Test: + - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" diff --git a/examples/examples.pro b/examples/examples.pro index 10d97e1b..c2bfdf11 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,3 +1,4 @@ TEMPLATE = subdirs -qtHaveModule(location): SUBDIRS += location +# TODO - enable examples later +# qtHaveModule(location): SUBDIRS += location diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d8516848..cf7eec09 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ # special case begin -#add_subdirectory(location) -#add_subdirectory(plugins) +add_subdirectory(location) +add_subdirectory(plugins) # special case end diff --git a/src/location/CMakeLists.txt b/src/location/CMakeLists.txt new file mode 100644 index 00000000..312c6211 --- /dev/null +++ b/src/location/CMakeLists.txt @@ -0,0 +1,132 @@ +qt_internal_add_module(Location + PLUGIN_TYPES geoservices + SOURCES + qlocation.h qlocation.cpp qlocationglobal_p.h qlocationglobal.h + maps/qgeotiledmapscene.cpp maps/qgeotilerequestmanager.cpp + maps/qgeoroute.cpp maps/qgeoroutesegment.cpp maps/qgeocameradata.cpp + maps/qgeotilespec.cpp maps/qgeomappingmanagerengine.cpp + maps/qnavigationmanagerengine.cpp maps/qgeocameratiles.cpp + maps/qgeotilefetcher.cpp maps/qgeocodingmanagerengine.cpp + maps/qgeocodingmanager.cpp maps/qgeorouteparserosrmv5.cpp + maps/qgeoroutingmanager.cpp maps/qgeofiletilecache.cpp + maps/qgeoserviceproviderfactory.cpp maps/qgeomapparameter.cpp + maps/qgeomappingmanager.cpp maps/qgeotiledmap.cpp + maps/qgeoprojection.cpp maps/qnavigationmanager.cpp + maps/qgeotiledmapreply.cpp maps/qgeotiledmappingmanagerengine.cpp + maps/qgeomaptype.cpp maps/qgeoserviceprovider.cpp + maps/qgeoroutereply.cpp maps/qgeorouteparser.cpp + maps/qgeorouterequest.cpp maps/qgeomap.cpp + maps/qgeoroutingmanagerengine.cpp maps/qgeorouteparserosrmv4.cpp + maps/qgeomaneuver.cpp maps/qgeocameracapabilities.cpp + maps/qabstractgeotilecache.cpp maps/qgeocodereply.cpp + maps/qgeotilerequestmanager_p.h + maps/qgeomaneuver.h maps/qgeotiledmapscene_p_p.h + maps/qgeoroutingmanagerengine.h maps/qgeorouterequest.h + maps/qgeocodingmanagerengine.h maps/qgeotiledmapreply_p.h + maps/qgeorouteparser_p.h maps/qgeocameracapabilities_p.h + maps/qgeocameratiles_p.h maps/qgeoroutesegment_p.h + maps/qgeocodingmanager_p.h maps/qgeoprojection_p.h + maps/qgeotiledmapscene_p.h maps/qgeotilefetcher_p_p.h + maps/qgeocodereply_p.h maps/qgeorouteparserosrmv5_p.h + maps/qgeorouterequest_p.h maps/qgeocodingmanagerengine_p.h + maps/qgeomaptype_p.h maps/qgeorouteparserosrmv4_p.h + maps/qgeotilespec_p_p.h maps/qgeocodingmanager.h + maps/qgeoroutesegment.h maps/qgeoroutingmanager.h + maps/qgeotiledmappingmanagerengine_p.h maps/qgeotilefetcher_p.h + maps/qgeomaptype_p_p.h maps/qgeocameratiles_p_p.h + maps/qgeoserviceprovider.h maps/qgeotiledmap_p_p.h + maps/qgeorouteparser_p_p.h maps/qgeomaneuver_p.h + maps/qgeocameradata_p.h maps/qgeomappingmanagerengine_p.h + maps/qabstractgeotilecache_p.h maps/qgeofiletilecache_p.h + maps/qcache3q_p.h maps/qgeomappingmanagerengine_p_p.h + maps/qgeotilespec_p.h maps/qgeomappingmanager_p_p.h + maps/qgeotiledmap_p.h maps/qnavigationmanagerengine_p.h + maps/qgeoroute.h maps/qgeoroutingmanager_p.h + maps/qgeomapparameter_p.h maps/qgeoroutereply.h + maps/qgeoroute_p.h maps/qgeoserviceproviderfactory.h + maps/qgeomappingmanager_p.h maps/qgeotiledmappingmanagerengine_p_p.h + maps/qgeoserviceprovider_p.h maps/qnavigationmanager_p.h + maps/qgeotiledmapreply_p_p.h maps/qgeoroutereply_p.h + maps/qgeocodereply.h maps/qgeomap_p_p.h + maps/qgeoroutingmanagerengine_p.h maps/qgeomap_p.h + places/qplacesearchrequest.cpp places/qplaceicon.cpp + places/qplacematchrequest.cpp places/qplacemanager.cpp + places/qplacecategory.cpp places/qplaceuser.cpp + places/qplacesearchresult.cpp places/qplacemanagerengine.cpp + places/qplacereview.cpp places/qplacecontentreply.cpp + places/qplacecontentrequest.cpp places/qplacesearchreply.cpp + places/qplacereply.cpp places/qplacedetailsreply.cpp + places/qplaceratings.cpp places/qplacecontactdetail.cpp + places/qplaceproposedsearchresult.cpp places/qplaceeditorial.cpp + places/qplace.cpp places/qplacesupplier.cpp + places/qplaceattribute.cpp places/qplaceimage.cpp + places/qplacesearchsuggestionreply.cpp places/qplaceresult.cpp + places/qplacematchreply.cpp places/qplacecontent.cpp + places/qplaceidreply.cpp + places/placemacro.h places/qplaceicon.h places/qplaceuser.h + places/qplaceattribute_p.h places/qplacematchrequest.h + places/qplacecontentreply.h places/qplacereview.h + places/qplacecategory.h places/qplacesearchrequest.h + places/qplacecategory_p.h places/qplaceeditorial_p.h + places/qplaceproposedsearchresult.h places/qplacemanagerengine.h + places/qplacecontentrequest.h places/qplacemanagerengine_p.h + places/qplace.h places/qplacecontentrequest_p.h + places/qplaceeditorial.h places/qplaceattribute.h + places/qplacedetailsreply.h places/qplaceimage_p.h + places/qplaceratings_p.h places/unsupportedreplies_p.h + places/qplacereply.h places/qplace_p.h places/qplaceresult_p.h + places/qplacemanager.h places/qplacereply_p.h + places/qplacesearchresult_p.h places/qplaceresult.h + places/qplacereview_p.h places/qplacematchreply.h + places/qplacecontent.h places/qplacesearchreply.h + places/qplacesupplier_p.h places/qplaceratings.h + places/qplaceimage.h places/qplacesearchresult.h + places/qplaceidreply.h places/qplaceuser_p.h places/qplaceicon_p.h + places/qplacecontactdetail.h places/qplacesearchsuggestionreply.h + places/qplacecontent_p.h places/qplacesearchrequest_p.h + places/qplaceproposedsearchresult_p.h places/qplacesupplier.h + places/qplacecontactdetail_p.h + declarativemaps/qdeclarativegeomapitembase_p.h + declarativemaps/qdeclarativegeomapitembase.cpp + declarativemaps/qdeclarativegeomap_p.h declarativemaps/qdeclarativegeomap.cpp + declarativemaps/qdeclarativegeomapitemtransitionmanager_p.h + declarativemaps/qdeclarativegeomapitemtransitionmanager.cpp + declarativemaps/qquickgeomapgesturearea_p.h declarativemaps/qquickgeomapgesturearea.cpp + declarativemaps/qdeclarativegeomapitemgroup_p.h + declarativemaps/qdeclarativegeomapitemgroup.cpp + declarativemaps/qdeclarativegeomapquickitem_p.h + declarativemaps/qdeclarativegeomapquickitem.cpp + declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h + declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp + declarativemaps/qdeclarativegeoserviceprovider_p.h + declarativemaps/qdeclarativegeoserviceprovider.cpp + declarativemaps/qdeclarativegeomaptype_p.h declarativemaps/qdeclarativegeomaptype.cpp + declarativemaps/qdeclarativegeomapparameter_p.h + declarativemaps/qdeclarativegeomapparameter.cpp + declarativemaps/qdeclarativegeomapitemview_p.h + declarativemaps/qdeclarativegeomapitemview.cpp + declarativemaps/qgeomapobject_p.h declarativemaps/qgeomapobject_p_p.h + declarativemaps/qgeomapobject.cpp + declarativemaps/qparameterizableobject_p.h declarativemaps/qparameterizableobject.cpp + labs/qgeojson_p.h labs/qgeojson.cpp + INCLUDE_DIRECTORIES + maps + places + declarativemaps + LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QuickPrivate + Qt::PositioningPrivate + Qt::PositioningQuickPrivate + PUBLIC_LIBRARIES + Qt::Core + PRIVATE_MODULE_INTERFACE + Qt::CorePrivate + Qt::QuickPrivate + Qt::PositioningPrivate + Qt::PositioningQuickPrivate +) + +# TODO - add QML stuff +# TODO - add docs diff --git a/src/plugins/geoservices/CMakeLists.txt b/src/plugins/geoservices/CMakeLists.txt new file mode 100644 index 00000000..b240732a --- /dev/null +++ b/src/plugins/geoservices/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(esri) +add_subdirectory(itemsoverlay) +add_subdirectory(mapbox) +add_subdirectory(nokia) +add_subdirectory(osm) diff --git a/src/plugins/geoservices/esri/CMakeLists.txt b/src/plugins/geoservices/esri/CMakeLists.txt new file mode 100644 index 00000000..faae9b50 --- /dev/null +++ b/src/plugins/geoservices/esri/CMakeLists.txt @@ -0,0 +1,32 @@ +qt_internal_add_plugin(GeoServiceProviderFactoryEsriPlugin + OUTPUT_NAME qtgeoservices_esri + CLASS_NAME GeoServiceProviderFactoryEsri + PLUGIN_TYPE geoservices + SOURCES + geocodereply_esri.h geocodereply_esri.cpp + geocodingmanagerengine_esri.h geocodingmanagerengine_esri.cpp + geomapsource.h geomapsource.cpp + georoutejsonparser_esri.h georoutejsonparser_esri.cpp + georoutereply_esri.h georoutereply_esri.cpp + georoutingmanagerengine_esri.h georoutingmanagerengine_esri.cpp + geoserviceproviderfactory_esri.h geoserviceproviderfactory_esri.cpp + geotiledmap_esri.h geotiledmap_esri.cpp + geotiledmappingmanagerengine_esri.h geotiledmappingmanagerengine_esri.cpp + geotiledmapreply_esri.h geotiledmapreply_esri.cpp + geotilefetcher_esri.h geotilefetcher_esri.cpp + placemanagerengine_esri.h placemanagerengine_esri.cpp + placesearchreply_esri.h placesearchreply_esri.cpp + placecategoriesreply_esri.h placecategoriesreply_esri.cpp + LIBRARIES + Qt::Core + Qt::Network + Qt::LocationPrivate + Qt::PositioningPrivate +) + +qt_add_resources(plugin_resource_files esri.qrc) + +qt_internal_extend_target(GeoServiceProviderFactoryEsriPlugin + SOURCES + ${plugin_resource_files} +) diff --git a/src/plugins/geoservices/itemsoverlay/CMakeLists.txt b/src/plugins/geoservices/itemsoverlay/CMakeLists.txt new file mode 100644 index 00000000..7de50b93 --- /dev/null +++ b/src/plugins/geoservices/itemsoverlay/CMakeLists.txt @@ -0,0 +1,13 @@ +qt_internal_add_plugin(QGeoServiceProviderFactoryItemsOverlayPlugin + OUTPUT_NAME qtgeoservices_itemsoverlay + CLASS_NAME QGeoServiceProviderFactoryItemsOverlay + PLUGIN_TYPE geoservices + SOURCES + qgeomapitemsoverlay.h qgeomapitemsoverlay.cpp + qgeomappingmanagerengineitemsoverlay.h qgeomappingmanagerengineitemsoverlay.cpp + qgeoserviceproviderpluginitemsoverlay.h qgeoserviceproviderpluginitemsoverlay.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate + Qt::PositioningPrivate +) diff --git a/src/plugins/geoservices/mapbox/CMakeLists.txt b/src/plugins/geoservices/mapbox/CMakeLists.txt new file mode 100644 index 00000000..d005fd3c --- /dev/null +++ b/src/plugins/geoservices/mapbox/CMakeLists.txt @@ -0,0 +1,32 @@ +qt_internal_add_plugin(QGeoServiceProviderFactoryMapboxPlugin + OUTPUT_NAME qtgeoservices_mapbox + CLASS_NAME QGeoServiceProviderFactoryMapbox + PLUGIN_TYPE geoservices + SOURCES + qgeoserviceproviderpluginmapbox.cpp qgeoserviceproviderpluginmapbox.h + qgeotiledmappingmanagerenginemapbox.cpp qgeotiledmappingmanagerenginemapbox.h + qgeotilefetchermapbox.cpp qgeotilefetchermapbox.h + qgeomapreplymapbox.cpp qgeomapreplymapbox.h + qgeofiletilecachemapbox.cpp qgeofiletilecachemapbox.h + qgeoroutingmanagerenginemapbox.cpp qgeoroutingmanagerenginemapbox.h + qgeoroutereplymapbox.cpp qgeoroutereplymapbox.h + qplacecategoriesreplymapbox.cpp qplacecategoriesreplymapbox.h + qplacemanagerenginemapbox.cpp qplacemanagerenginemapbox.h + qplacesearchsuggestionreplymapbox.cpp qplacesearchsuggestionreplymapbox.h + qplacesearchreplymapbox.cpp qplacesearchreplymapbox.h + qgeocodingmanagerenginemapbox.cpp qgeocodingmanagerenginemapbox.h + qgeocodereplymapbox.cpp qgeocodereplymapbox.h + qmapboxcommon.cpp qmapboxcommon.h + LIBRARIES + Qt::Core + Qt::Network + Qt::LocationPrivate + Qt::PositioningPrivate +) + +qt_add_resources(plugin_resource_files mapbox.qrc) + +qt_internal_extend_target(QGeoServiceProviderFactoryMapboxPlugin + SOURCES + ${plugin_resource_files} +) diff --git a/src/plugins/geoservices/nokia/CMakeLists.txt b/src/plugins/geoservices/nokia/CMakeLists.txt new file mode 100644 index 00000000..c7d23304 --- /dev/null +++ b/src/plugins/geoservices/nokia/CMakeLists.txt @@ -0,0 +1,46 @@ +qt_internal_add_plugin(QGeoServiceProviderFactoryNokiaPlugin + OUTPUT_NAME qtgeoservices_nokia + CLASS_NAME QGeoServiceProviderFactoryNokia + PLUGIN_TYPE geoservices + SOURCES + qgeocodereply_nokia.h qgeocodereply_nokia.cpp + qgeocodejsonparser.h qgeocodejsonparser.cpp + qgeocodingmanagerengine_nokia.h qgeocodingmanagerengine_nokia.cpp + qgeotiledmappingmanagerengine_nokia.h qgeotiledmappingmanagerengine_nokia.cpp + qgeotilefetcher_nokia.h qgeotilefetcher_nokia.cpp + qgeomapreply_nokia.h qgeomapreply_nokia.cpp + qgeoroutereply_nokia.h qgeoroutereply_nokia.cpp + qgeoroutexmlparser.h qgeoroutexmlparser.cpp + qgeoroutingmanagerengine_nokia.h qgeoroutingmanagerengine_nokia.cpp + qgeoserviceproviderplugin_nokia.h qgeoserviceproviderplugin_nokia.cpp + marclanguagecodes.h qgeonetworkaccessmanager.h + qgeointrinsicnetworkaccessmanager.h qgeointrinsicnetworkaccessmanager.cpp + qgeouriprovider.h qgeouriprovider.cpp + uri_constants.h uri_constants.cpp + qgeoerror_messages.h qgeoerror_messages.cpp + qgeomapversion.h qgeomapversion.cpp + qgeotiledmap_nokia.h qgeotiledmap_nokia.cpp + qgeofiletilecachenokia.h qgeofiletilecachenokia.cpp + qplacemanagerengine_nokiav2.h qplacemanagerengine_nokiav2.cpp + placesv2/qplacecategoriesreplyhere.h placesv2/qplacecategoriesreplyhere.cpp + placesv2/qplacecontentreplyimpl.h placesv2/qplacecontentreplyimpl.cpp + placesv2/qplacedetailsreplyimpl.h placesv2/qplacedetailsreplyimpl.cpp + placesv2/qplaceidreplyimpl.h placesv2/qplaceidreplyimpl.cpp + placesv2/qplacesearchreplyhere.h placesv2/qplacesearchreplyhere.cpp + placesv2/qplacesearchsuggestionreplyimpl.h placesv2/qplacesearchsuggestionreplyimpl.cpp + placesv2/jsonparserhelpers.h placesv2/jsonparserhelpers.cpp + INCLUDE_DIRECTORIES + ../../../location/maps + LIBRARIES + Qt::Core + Qt::Network + Qt::LocationPrivate + Qt::PositioningPrivate +) + +qt_add_resources(plugin_resource_files nokia.qrc) + +qt_internal_extend_target(QGeoServiceProviderFactoryNokiaPlugin + SOURCES + ${plugin_resource_files} +) diff --git a/src/plugins/geoservices/osm/CMakeLists.txt b/src/plugins/geoservices/osm/CMakeLists.txt new file mode 100644 index 00000000..276af536 --- /dev/null +++ b/src/plugins/geoservices/osm/CMakeLists.txt @@ -0,0 +1,25 @@ +qt_internal_add_plugin(QGeoServiceProviderFactoryOsmPlugin + OUTPUT_NAME qtgeoservices_osm + CLASS_NAME QGeoServiceProviderFactoryOsm + PLUGIN_TYPE geoservices + SOURCES + qgeoserviceproviderpluginosm.h qgeoserviceproviderpluginosm.cpp + qgeotiledmappingmanagerengineosm.h qgeotiledmappingmanagerengineosm.cpp + qgeotilefetcherosm.h qgeotilefetcherosm.cpp + qgeomapreplyosm.h qgeomapreplyosm.cpp + qgeocodingmanagerengineosm.h qgeocodingmanagerengineosm.cpp + qgeocodereplyosm.h qgeocodereplyosm.cpp + qgeoroutingmanagerengineosm.h qgeoroutingmanagerengineosm.cpp + qgeoroutereplyosm.h qgeoroutereplyosm.cpp + qplacemanagerengineosm.h qplacemanagerengineosm.cpp + qplacesearchreplyosm.h qplacesearchreplyosm.cpp + qplacecategoriesreplyosm.h qplacecategoriesreplyosm.cpp + qgeotiledmaposm.h qgeotiledmaposm.cpp + qgeofiletilecacheosm.h qgeofiletilecacheosm.cpp + qgeotileproviderosm.h qgeotileproviderosm.cpp + LIBRARIES + Qt::Core + Qt::Network + Qt::LocationPrivate + Qt::PositioningPrivate +) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 742afe97..b30de04e 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -1,59 +1,59 @@ # Generated from auto.pro. # TODO: enable location tests later! -# if(TARGET Qt::Location) -# add_subdirectory(geotestplugin) -# add_subdirectory(qplace) -# add_subdirectory(qplaceattribute) -# add_subdirectory(qplacecategory) -# add_subdirectory(qplacecontactdetail) -# add_subdirectory(qplacecontentrequest) -# add_subdirectory(qplacedetailsreply) -# add_subdirectory(qplaceeditorial) -# add_subdirectory(qplacematchreply) -# add_subdirectory(qplacematchrequest) -# add_subdirectory(qplaceimage) -# add_subdirectory(qplaceratings) -# add_subdirectory(qplaceresult) -# add_subdirectory(qproposedsearchresult) -# add_subdirectory(qplacereply) -# add_subdirectory(qplacereview) -# add_subdirectory(qplacesearchrequest) -# add_subdirectory(qplacesupplier) -# add_subdirectory(qplacesearchresult) -# add_subdirectory(qplacesearchreply) -# add_subdirectory(qplacesearchsuggestionreply) -# add_subdirectory(qplaceuser) -# add_subdirectory(qgeocodingmanagerplugins) -# add_subdirectory(qgeocameracapabilities) -# add_subdirectory(qgeocameradata) -# add_subdirectory(qgeocodereply) -# add_subdirectory(qgeomaneuver) -# add_subdirectory(qgeotiledmapscene) -# add_subdirectory(qgeoroute) -# add_subdirectory(qgeoroutereply) -# add_subdirectory(qgeorouterequest) -# add_subdirectory(qgeoroutesegment) -# add_subdirectory(qgeoroutingmanagerplugins) -# add_subdirectory(qgeotilespec) -# add_subdirectory(qgeoroutexmlparser) -# add_subdirectory(maptype) -# add_subdirectory(qgeocameratiles) -# add_subdirectory(qgeojson) -# endif() -# if(TARGET Qt::Location AND NOT ANDROID) -# add_subdirectory(qplacemanager) -# add_subdirectory(qplacemanager_nokia) -# add_subdirectory(qplacemanager_unsupported) -# add_subdirectory(placesplugin_unsupported) +if(TARGET Qt::Location) + add_subdirectory(geotestplugin) + add_subdirectory(qplace) + add_subdirectory(qplaceattribute) + add_subdirectory(qplacecategory) + add_subdirectory(qplacecontactdetail) + add_subdirectory(qplacecontentrequest) + add_subdirectory(qplacedetailsreply) + add_subdirectory(qplaceeditorial) + add_subdirectory(qplacematchreply) + add_subdirectory(qplacematchrequest) + add_subdirectory(qplaceimage) + add_subdirectory(qplaceratings) + add_subdirectory(qplaceresult) + add_subdirectory(qproposedsearchresult) + add_subdirectory(qplacereply) + add_subdirectory(qplacereview) + add_subdirectory(qplacesearchrequest) + add_subdirectory(qplacesupplier) + add_subdirectory(qplacesearchresult) + add_subdirectory(qplacesearchreply) + add_subdirectory(qplacesearchsuggestionreply) + add_subdirectory(qplaceuser) + add_subdirectory(qgeocodingmanagerplugins) + add_subdirectory(qgeocameracapabilities) + add_subdirectory(qgeocameradata) + add_subdirectory(qgeocodereply) + add_subdirectory(qgeomaneuver) + add_subdirectory(qgeotiledmapscene) + add_subdirectory(qgeoroute) + add_subdirectory(qgeoroutereply) + add_subdirectory(qgeorouterequest) + add_subdirectory(qgeoroutesegment) + add_subdirectory(qgeoroutingmanagerplugins) + add_subdirectory(qgeotilespec) + add_subdirectory(qgeoroutexmlparser) + add_subdirectory(maptype) + add_subdirectory(qgeocameratiles) + add_subdirectory(qgeojson) +endif() +if(TARGET Qt::Location AND NOT ANDROID) + add_subdirectory(qplacemanager) + add_subdirectory(qplacemanager_nokia) + add_subdirectory(qplacemanager_unsupported) + add_subdirectory(placesplugin_unsupported) # add_subdirectory(cmake) # add_subdirectory(qmlinterface) -# add_subdirectory(qgeoserviceprovider) -# add_subdirectory(qgeoroutingmanager) -# add_subdirectory(nokia_services) -# add_subdirectory(qgeocodingmanager) -# add_subdirectory(qgeotiledmap) -# endif() + add_subdirectory(qgeoserviceprovider) + add_subdirectory(qgeoroutingmanager) + add_subdirectory(nokia_services) + add_subdirectory(qgeocodingmanager) + add_subdirectory(qgeotiledmap) +endif() # if(TARGET Qt::Location AND TARGET Qt::Quick AND NOT ANDROID) # add_subdirectory(declarative_mappolyline) # add_subdirectory(declarative_location_core) diff --git a/tests/auto/geotestplugin/CMakeLists.txt b/tests/auto/geotestplugin/CMakeLists.txt new file mode 100644 index 00000000..4c014bd1 --- /dev/null +++ b/tests/auto/geotestplugin/CMakeLists.txt @@ -0,0 +1,33 @@ +qt_internal_add_plugin(TestGeoServicePlugin + OUTPUT_NAME qtgeoservices_qmltestplugin + CLASS_NAME QGeoServiceProviderFactoryTest + PLUGIN_TYPE geoservices + DEFAULT_IF FALSE + SOURCES + qgeocodingmanagerengine_test.h + qgeoserviceproviderplugin_test.h + qgeoroutingmanagerengine_test.h + qplacemanagerengine_test.h + qgeotiledmappingmanagerengine_test.h + qgeotiledmap_test.h + qgeotilefetcher_test.h + qgeoserviceproviderplugin_test.cpp + qgeotiledmap_test.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate + Qt::PositioningPrivate + Qt::Test +) + +set(plugin_resource_files + "geotestplugin.json" + "place_data.json" +) + +qt_internal_add_resource(TestGeoServicePlugin "testdata" + PREFIX + "/" + FILES + ${plugin_resource_files} +) diff --git a/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h b/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h index fd92f6e3..23bcb292 100644 --- a/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h @@ -113,7 +113,7 @@ public: QGeoCodeReply* geocode(const QString &searchString, int limit = -1, int offset = 0, - const QGeoShape &bounds = QGeoShape()) + const QGeoShape &bounds = QGeoShape()) override { geocodeReply_ = new GeocodeReplyTest(); connect(geocodeReply_, SIGNAL(aborted()), this, SLOT(requestAborted())); @@ -147,7 +147,7 @@ public: return static_cast(geocodeReply_); } - QGeoCodeReply* geocode(const QGeoAddress & address, const QGeoShape &bounds) + QGeoCodeReply* geocode(const QGeoAddress & address, const QGeoShape &bounds) override { geocodeReply_ = new GeocodeReplyTest(); connect(geocodeReply_, SIGNAL(aborted()), this, SLOT(requestAborted())); @@ -242,7 +242,7 @@ public: } } - QGeoCodeReply* reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds) + QGeoCodeReply* reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds) override { geocodeReply_ = new GeocodeReplyTest(); connect(geocodeReply_, SIGNAL(aborted()), this, SLOT(requestAborted())); @@ -275,7 +275,7 @@ public: } protected: - void timerEvent(QTimerEvent *event) + void timerEvent(QTimerEvent *event) override { Q_UNUSED(event); Q_ASSERT(timerId_ == event->timerId()); diff --git a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h index daf7a87d..712c5d89 100644 --- a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h @@ -136,7 +136,7 @@ public: QGeoRouteRequest::TruckTravel ); } - virtual QGeoRouteReply* calculateRoute(const QGeoRouteRequest& request) + virtual QGeoRouteReply* calculateRoute(const QGeoRouteRequest& request) override { routeReply_ = new RouteReplyTest(); connect(routeReply_, SIGNAL(aborted()), this, SLOT(requestAborted())); @@ -210,7 +210,7 @@ public Q_SLOTS: } protected: - void timerEvent(QTimerEvent *event) + void timerEvent(QTimerEvent *event) override { Q_UNUSED(event); Q_ASSERT(timerId_ == event->timerId()); diff --git a/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h b/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h index ac195d69..d5d5599a 100644 --- a/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h +++ b/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h @@ -45,18 +45,18 @@ public: QGeoServiceProviderFactoryTest(); ~QGeoServiceProviderFactoryTest(); - QGeoMappingManagerEngine* createMappingManagerEngine( - const QVariantMap ¶meters, - QGeoServiceProvider::Error *error, QString *errorString) const; - QGeoRoutingManagerEngine* createRoutingManagerEngine( - const QVariantMap ¶meters, - QGeoServiceProvider::Error *error, QString *errorString ) const; - QGeoCodingManagerEngine* createGeocodingManagerEngine( - const QVariantMap ¶meters, - QGeoServiceProvider::Error *error, QString *errorString) const; - QPlaceManagerEngine* createPlaceManagerEngine( - const QVariantMap ¶meters, - QGeoServiceProvider::Error *error, QString *errorString) const; + QGeoMappingManagerEngine* createMappingManagerEngine(const QVariantMap ¶meters, + QGeoServiceProvider::Error *error, + QString *errorString) const override; + QGeoRoutingManagerEngine* createRoutingManagerEngine(const QVariantMap ¶meters, + QGeoServiceProvider::Error *error, + QString *errorString ) const override; + QGeoCodingManagerEngine* createGeocodingManagerEngine(const QVariantMap ¶meters, + QGeoServiceProvider::Error *error, + QString *errorString) const override; + QPlaceManagerEngine* createPlaceManagerEngine(const QVariantMap ¶meters, + QGeoServiceProvider::Error *error, + QString *errorString) const override; }; #endif diff --git a/tests/auto/geotestplugin/qgeotilefetcher_test.h b/tests/auto/geotestplugin/qgeotilefetcher_test.h index e108f484..2782ea64 100644 --- a/tests/auto/geotestplugin/qgeotilefetcher_test.h +++ b/tests/auto/geotestplugin/qgeotilefetcher_test.h @@ -56,7 +56,7 @@ public: void callSetCached(bool cached) { setFinished(cached);} void callSetMapImageData(const QByteArray &data) { setMapImageData(data); } void callSetMapImageFormat(const QString &format) { setMapImageFormat(format); } - void abort() { emit aborted(); } + void abort() override { emit aborted(); } Q_SIGNALS: void aborted(); @@ -76,7 +76,7 @@ public: return true; } - QGeoTiledMapReply* getTileImage(const QGeoTileSpec &spec) + QGeoTiledMapReply* getTileImage(const QGeoTileSpec &spec) override { TiledMapReplyTest* mappingReply = new TiledMapReplyTest(spec, this); @@ -155,7 +155,7 @@ protected: } } - void timerEvent(QTimerEvent *event) + void timerEvent(QTimerEvent *event) override { if (event->timerId() != timer_.timerId()) { QGeoTileFetcher::timerEvent(event); diff --git a/tests/auto/geotestplugin/qplacemanagerengine_test.h b/tests/auto/geotestplugin/qplacemanagerengine_test.h index 0c707b65..45f52a2c 100644 --- a/tests/auto/geotestplugin/qplacemanagerengine_test.h +++ b/tests/auto/geotestplugin/qplacemanagerengine_test.h @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE -inline uint qHash(const QPlaceCategory &category) +inline size_t qHash(const QPlaceCategory &category) { return qHash(QUuid(category.categoryId().toLatin1())); } diff --git a/tests/auto/maptype/CMakeLists.txt b/tests/auto/maptype/CMakeLists.txt new file mode 100644 index 00000000..868cd769 --- /dev/null +++ b/tests/auto/maptype/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_maptype + SOURCES + tst_maptype.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate +) diff --git a/tests/auto/nokia_services/CMakeLists.txt b/tests/auto/nokia_services/CMakeLists.txt new file mode 100644 index 00000000..5e3187b0 --- /dev/null +++ b/tests/auto/nokia_services/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(places_semiauto) +add_subdirectory(routing) diff --git a/tests/auto/nokia_services/places_semiauto/CMakeLists.txt b/tests/auto/nokia_services/places_semiauto/CMakeLists.txt new file mode 100644 index 00000000..f266d019 --- /dev/null +++ b/tests/auto/nokia_services/places_semiauto/CMakeLists.txt @@ -0,0 +1,10 @@ +qt_internal_add_test(tst_qplaces + SOURCES + ../../placemanager_utils/placemanager_utils.h + ../../placemanager_utils/placemanager_utils.cpp + tst_places.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/nokia_services/routing/CMakeLists.txt b/tests/auto/nokia_services/routing/CMakeLists.txt new file mode 100644 index 00000000..0787398f --- /dev/null +++ b/tests/auto/nokia_services/routing/CMakeLists.txt @@ -0,0 +1,14 @@ +set(plugin_path "../../../../src/plugins/geoservices/nokia") + +qt_internal_add_test(tst_nokia_routing + SOURCES + ${plugin_path}/qgeonetworkaccessmanager.h + tst_routing.cpp + INCLUDE_DIRECTORIES + ${plugin_path} + LIBRARIES + Qt::Core + Qt::Network + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/nokia_services/routing/tst_routing.cpp b/tests/auto/nokia_services/routing/tst_routing.cpp index fdfdfe0a..f2279f26 100644 --- a/tests/auto/nokia_services/routing/tst_routing.cpp +++ b/tests/auto/nokia_services/routing/tst_routing.cpp @@ -48,7 +48,7 @@ class MockGeoNetworkReply : public QNetworkReply { public: MockGeoNetworkReply( QObject* parent = 0); - virtual void abort(); + virtual void abort() override; void setFile(QFile* file); void complete(); @@ -57,8 +57,8 @@ public: using QNetworkReply::setError; protected: - virtual qint64 readData(char *data, qint64 maxlen); - virtual qint64 writeData(const char *data, qint64 len); + virtual qint64 readData(char *data, qint64 maxlen) override; + virtual qint64 writeData(const char *data, qint64 len) override; private: QFile* m_file; @@ -112,8 +112,8 @@ class MockGeoNetworkAccessManager : public QGeoNetworkAccessManager { public: MockGeoNetworkAccessManager(QObject* parent = 0); - QNetworkReply* get(const QNetworkRequest& request); - QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data); + QNetworkReply *get(const QNetworkRequest& request) override; + QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data) override; void setReply(MockGeoNetworkReply* reply); diff --git a/tests/auto/placesplugin_unsupported/CMakeLists.txt b/tests/auto/placesplugin_unsupported/CMakeLists.txt new file mode 100644 index 00000000..08401d01 --- /dev/null +++ b/tests/auto/placesplugin_unsupported/CMakeLists.txt @@ -0,0 +1,12 @@ +qt_internal_add_plugin(UnsupportedPlacesGeoServicePlugin + OUTPUT_NAME qtgeoservices_placesplugin_unsupported + CLASS_NAME QGeoServiceProviderFactoryTest + PLUGIN_TYPE geoservices + DEFAULT_IF FALSE + SOURCES + qgeoserviceproviderplugin_test.h + qgeoserviceproviderplugin_test.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h b/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h index 11c30d26..49a3816c 100644 --- a/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h +++ b/tests/auto/placesplugin_unsupported/qgeoserviceproviderplugin_test.h @@ -46,7 +46,7 @@ public: QPlaceManagerEngine *createPlaceManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, - QString *errorString) const; + QString *errorString) const override; }; #endif diff --git a/tests/auto/qgeocameracapabilities/CMakeLists.txt b/tests/auto/qgeocameracapabilities/CMakeLists.txt new file mode 100644 index 00000000..94f22fda --- /dev/null +++ b/tests/auto/qgeocameracapabilities/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeocameracapabilities + SOURCES + tst_qgeocameracapabilities.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate + Qt::PositioningPrivate +) diff --git a/tests/auto/qgeocameradata/CMakeLists.txt b/tests/auto/qgeocameradata/CMakeLists.txt new file mode 100644 index 00000000..60efd593 --- /dev/null +++ b/tests/auto/qgeocameradata/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeocameradata + SOURCES + tst_qgeocameradata.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate + Qt::PositioningPrivate +) diff --git a/tests/auto/qgeocameradata/tst_qgeocameradata.cpp b/tests/auto/qgeocameradata/tst_qgeocameradata.cpp index be75acfa..1ad3637c 100644 --- a/tests/auto/qgeocameradata/tst_qgeocameradata.cpp +++ b/tests/auto/qgeocameradata/tst_qgeocameradata.cpp @@ -29,7 +29,7 @@ #include #include -#include "qgeocameradata_p.h" +#include QT_USE_NAMESPACE diff --git a/tests/auto/qgeocameratiles/CMakeLists.txt b/tests/auto/qgeocameratiles/CMakeLists.txt new file mode 100644 index 00000000..b8da4a92 --- /dev/null +++ b/tests/auto/qgeocameratiles/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeocameratiles + SOURCES + tst_qgeocameratiles.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate + Qt::PositioningPrivate +) diff --git a/tests/auto/qgeocodereply/CMakeLists.txt b/tests/auto/qgeocodereply/CMakeLists.txt new file mode 100644 index 00000000..84cb4a2b --- /dev/null +++ b/tests/auto/qgeocodereply/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeocodereply + SOURCES + tst_qgeocodereply.h tst_qgeocodereply.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qgeocodingmanager/CMakeLists.txt b/tests/auto/qgeocodingmanager/CMakeLists.txt new file mode 100644 index 00000000..acf75042 --- /dev/null +++ b/tests/auto/qgeocodingmanager/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeocodingmanager + SOURCES + tst_qgeocodingmanager.h tst_qgeocodingmanager.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qgeocodingmanagerplugins/CMakeLists.txt b/tests/auto/qgeocodingmanagerplugins/CMakeLists.txt new file mode 100644 index 00000000..7521f9eb --- /dev/null +++ b/tests/auto/qgeocodingmanagerplugins/CMakeLists.txt @@ -0,0 +1,14 @@ +qt_internal_add_plugin(GeocodingTestGeoServicePlugin + OUTPUT_NAME qtgeoservices_geocodingplugin + CLASS_NAME QGeoServiceProviderFactoryTest + PLUGIN_TYPE geoservices + DEFAULT_IF FALSE + SOURCES + qgeocodingmanagerengine_test.h + qgeoserviceproviderplugin_test.h + qgeoserviceproviderplugin_test.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerengine_test.h b/tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerengine_test.h index 0f505f77..c9fe8349 100644 --- a/tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerengine_test.h +++ b/tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerengine_test.h @@ -69,7 +69,8 @@ public: setLocale(QLocale(QLocale::German, QLocale::Germany)); } - QGeoCodeReply* geocode(const QString &searchString, int limit, int offset, const QGeoShape &bounds) + QGeoCodeReply* geocode(const QString &searchString, int limit, int offset, + const QGeoShape &bounds) override { GeocodeReplyTest *geocodereply = new GeocodeReplyTest(); geocodereply->callSetLimit(limit); @@ -82,7 +83,7 @@ public: return static_cast(geocodereply); } - QGeoCodeReply* geocode (const QGeoAddress &address, const QGeoShape &bounds) + QGeoCodeReply* geocode (const QGeoAddress &address, const QGeoShape &bounds) override { GeocodeReplyTest *geocodereply = new GeocodeReplyTest(); geocodereply->callSetViewport(bounds); @@ -93,7 +94,8 @@ public: return static_cast(geocodereply); } - QGeoCodeReply* reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds) + QGeoCodeReply* reverseGeocode(const QGeoCoordinate &coordinate, + const QGeoShape &bounds) override { GeocodeReplyTest *geocodereply = new GeocodeReplyTest(); geocodereply->callSetViewport(bounds); diff --git a/tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.h b/tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.h index 53d2961e..a864a93e 100644 --- a/tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.h +++ b/tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.h @@ -45,9 +45,9 @@ public: QGeoServiceProviderFactoryTest(); ~QGeoServiceProviderFactoryTest(); - QGeoCodingManagerEngine* createGeocodingManagerEngine( - const QVariantMap ¶meters, - QGeoServiceProvider::Error *error, QString *errorString) const; + QGeoCodingManagerEngine* createGeocodingManagerEngine(const QVariantMap ¶meters, + QGeoServiceProvider::Error *error, + QString *errorString) const override; }; #endif diff --git a/tests/auto/qgeojson/CMakeLists.txt b/tests/auto/qgeojson/CMakeLists.txt new file mode 100644 index 00000000..a2876d05 --- /dev/null +++ b/tests/auto/qgeojson/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeojson + SOURCES + tst_qgeojson.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate + Qt::Positioning +) diff --git a/tests/auto/qgeomaneuver/CMakeLists.txt b/tests/auto/qgeomaneuver/CMakeLists.txt new file mode 100644 index 00000000..49c1a5a2 --- /dev/null +++ b/tests/auto/qgeomaneuver/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qgeomaneuver + SOURCES + tst_qgeomaneuver.h tst_qgeomaneuver.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate +) diff --git a/tests/auto/qgeoroute/CMakeLists.txt b/tests/auto/qgeoroute/CMakeLists.txt new file mode 100644 index 00000000..0b1e1d79 --- /dev/null +++ b/tests/auto/qgeoroute/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qgeoroute + SOURCES + tst_qgeoroute.h tst_qgeoroute.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate +) diff --git a/tests/auto/qgeoroutereply/CMakeLists.txt b/tests/auto/qgeoroutereply/CMakeLists.txt new file mode 100644 index 00000000..1fd7211b --- /dev/null +++ b/tests/auto/qgeoroutereply/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeoroutereply + SOURCES + tst_qgeoroutereply.h tst_qgeoroutereply.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qgeorouterequest/CMakeLists.txt b/tests/auto/qgeorouterequest/CMakeLists.txt new file mode 100644 index 00000000..afd6ba11 --- /dev/null +++ b/tests/auto/qgeorouterequest/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeorouterequest + SOURCES + tst_qgeorouterequest.h tst_qgeorouterequest.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qgeoroutesegment/CMakeLists.txt b/tests/auto/qgeoroutesegment/CMakeLists.txt new file mode 100644 index 00000000..6e069f1d --- /dev/null +++ b/tests/auto/qgeoroutesegment/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeoroutesegment + SOURCES + tst_qgeoroutesegment.h tst_qgeoroutesegment.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qgeoroutexmlparser/CMakeLists.txt b/tests/auto/qgeoroutexmlparser/CMakeLists.txt new file mode 100644 index 00000000..22e61713 --- /dev/null +++ b/tests/auto/qgeoroutexmlparser/CMakeLists.txt @@ -0,0 +1,20 @@ +set(plugin_path "../../../src/plugins/geoservices/nokia") + +qt_internal_add_test(tst_qgeoroutexmlparser + SOURCES + ${plugin_path}/qgeoroutexmlparser.cpp + ${plugin_path}/qgeoroutexmlparser.h + tst_qgeoroutexmlparser.cpp + INCLUDE_DIRECTORIES + ${plugin_path} + LIBRARIES + Qt::Core + Qt::LocationPrivate +) + +qt_add_resources(resources_file fixtures.qrc) + +qt_internal_extend_target(tst_qgeoroutexmlparser + SOURCES + ${resources_file} +) diff --git a/tests/auto/qgeoroutingmanager/CMakeLists.txt b/tests/auto/qgeoroutingmanager/CMakeLists.txt new file mode 100644 index 00000000..ed02e2f9 --- /dev/null +++ b/tests/auto/qgeoroutingmanager/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeoroutingmanager + SOURCES + tst_qgeoroutingmanager.h tst_qgeoroutingmanager.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qgeoroutingmanagerplugins/CMakeLists.txt b/tests/auto/qgeoroutingmanagerplugins/CMakeLists.txt new file mode 100644 index 00000000..10f1b1a9 --- /dev/null +++ b/tests/auto/qgeoroutingmanagerplugins/CMakeLists.txt @@ -0,0 +1,14 @@ +qt_internal_add_plugin(RoutingTestGeoServicePlugin + OUTPUT_NAME qtgeoservices_routingplugin + CLASS_NAME QGeoServiceProviderFactoryTest + PLUGIN_TYPE geoservices + DEFAULT_IF FALSE + SOURCES + qgeoroutingmanagerengine_test.h + qgeoserviceproviderplugin_test.h + qgeoserviceproviderplugin_test.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h b/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h index 67c8f651..51c2ff6c 100644 --- a/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h +++ b/tests/auto/qgeoroutingmanagerplugins/qgeoroutingmanagerengine_test.h @@ -56,13 +56,13 @@ public: setSupportedManeuverDetails(QGeoRouteRequest::BasicManeuvers); } - QGeoRouteReply* calculateRoute(const QGeoRouteRequest& request) + QGeoRouteReply* calculateRoute(const QGeoRouteRequest& request) override { Q_UNUSED(request); return new QGeoRouteReply(QGeoRouteReply::NoError,"no error"); } - QGeoRouteReply* updateRoute(const QGeoRoute &route, const QGeoCoordinate &position) + QGeoRouteReply* updateRoute(const QGeoRoute &route, const QGeoCoordinate &position) override { Q_UNUSED(route); Q_UNUSED(position); diff --git a/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h b/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h index e909b647..0883c7be 100644 --- a/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h +++ b/tests/auto/qgeoroutingmanagerplugins/qgeoserviceproviderplugin_test.h @@ -46,7 +46,8 @@ public: ~QGeoServiceProviderFactoryTest(); QGeoRoutingManagerEngine* createRoutingManagerEngine(const QVariantMap ¶meters, - QGeoServiceProvider::Error *error, QString *errorString) const; + QGeoServiceProvider::Error *error, + QString *errorString) const override; }; diff --git a/tests/auto/qgeoserviceprovider/CMakeLists.txt b/tests/auto/qgeoserviceprovider/CMakeLists.txt new file mode 100644 index 00000000..6ff1a994 --- /dev/null +++ b/tests/auto/qgeoserviceprovider/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qgeoserviceprovider + SOURCES + tst_qgeoserviceprovider.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qgeotiledmap/CMakeLists.txt b/tests/auto/qgeotiledmap/CMakeLists.txt new file mode 100644 index 00000000..7c5c7c97 --- /dev/null +++ b/tests/auto/qgeotiledmap/CMakeLists.txt @@ -0,0 +1,10 @@ +qt_internal_add_test(tst_qgeotiledmap + SOURCES + tst_qgeotiledmap.cpp + INCLUDE_DIRECTORIES + ../geotestplugin + LIBRARIES + Qt::Core + Qt::LocationPrivate + Qt::PositioningPrivate +) diff --git a/tests/auto/qgeotiledmapscene/CMakeLists.txt b/tests/auto/qgeotiledmapscene/CMakeLists.txt new file mode 100644 index 00000000..7a5fc157 --- /dev/null +++ b/tests/auto/qgeotiledmapscene/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qgeotiledmapscene + SOURCES + tst_qgeotiledmapscene.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate + Qt::PositioningPrivate +) diff --git a/tests/auto/qgeotiledmapscene/tst_qgeotiledmapscene.cpp b/tests/auto/qgeotiledmapscene/tst_qgeotiledmapscene.cpp index 6b3dc1f6..86c800ca 100644 --- a/tests/auto/qgeotiledmapscene/tst_qgeotiledmapscene.cpp +++ b/tests/auto/qgeotiledmapscene/tst_qgeotiledmapscene.cpp @@ -28,11 +28,11 @@ //TESTED_COMPONENT=src/location/maps -#include "qgeotilespec_p.h" -#include "qgeotiledmapscene_p.h" -#include "qgeocameratiles_p.h" -#include "qgeocameradata_p.h" -#include "qabstractgeotilecache_p.h" +#include +#include +#include +#include +#include #include #include #include diff --git a/tests/auto/qgeotilespec/CMakeLists.txt b/tests/auto/qgeotilespec/CMakeLists.txt new file mode 100644 index 00000000..a268247f --- /dev/null +++ b/tests/auto/qgeotilespec/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qgeotilespec + SOURCES + tst_qgeotilespec.cpp + LIBRARIES + Qt::Core + Qt::LocationPrivate +) diff --git a/tests/auto/qgeotilespec/tst_qgeotilespec.cpp b/tests/auto/qgeotilespec/tst_qgeotilespec.cpp index 84df2683..9be2d899 100644 --- a/tests/auto/qgeotilespec/tst_qgeotilespec.cpp +++ b/tests/auto/qgeotilespec/tst_qgeotilespec.cpp @@ -29,7 +29,7 @@ #include #include -#include "qgeotilespec_p.h" +#include QT_USE_NAMESPACE diff --git a/tests/auto/qplace/CMakeLists.txt b/tests/auto/qplace/CMakeLists.txt new file mode 100644 index 00000000..281f28db --- /dev/null +++ b/tests/auto/qplace/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qplace + SOURCES + tst_qplace.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qplaceattribute/CMakeLists.txt b/tests/auto/qplaceattribute/CMakeLists.txt new file mode 100644 index 00000000..2f98bab5 --- /dev/null +++ b/tests/auto/qplaceattribute/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplaceattribute + SOURCES + tst_qplaceattribute.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacecategory/CMakeLists.txt b/tests/auto/qplacecategory/CMakeLists.txt new file mode 100644 index 00000000..14ae235d --- /dev/null +++ b/tests/auto/qplacecategory/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacecategory + SOURCES + tst_qplacecategory.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacecontactdetail/CMakeLists.txt b/tests/auto/qplacecontactdetail/CMakeLists.txt new file mode 100644 index 00000000..96477487 --- /dev/null +++ b/tests/auto/qplacecontactdetail/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacecontactdetail + SOURCES + tst_qplacecontactdetail.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacecontentrequest/CMakeLists.txt b/tests/auto/qplacecontentrequest/CMakeLists.txt new file mode 100644 index 00000000..2a30b93f --- /dev/null +++ b/tests/auto/qplacecontentrequest/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacecontentrequest + SOURCES + tst_qplacecontentrequest.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacedetailsreply/CMakeLists.txt b/tests/auto/qplacedetailsreply/CMakeLists.txt new file mode 100644 index 00000000..2bcb4dcf --- /dev/null +++ b/tests/auto/qplacedetailsreply/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacedetailsreply + SOURCES + tst_qplacedetailsreply.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplaceeditorial/CMakeLists.txt b/tests/auto/qplaceeditorial/CMakeLists.txt new file mode 100644 index 00000000..53e82744 --- /dev/null +++ b/tests/auto/qplaceeditorial/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplaceeditorial + SOURCES + tst_qplaceeditorial.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplaceimage/CMakeLists.txt b/tests/auto/qplaceimage/CMakeLists.txt new file mode 100644 index 00000000..e88f0621 --- /dev/null +++ b/tests/auto/qplaceimage/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplaceimage + SOURCES + tst_qplaceimage.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacemanager/CMakeLists.txt b/tests/auto/qplacemanager/CMakeLists.txt new file mode 100644 index 00000000..d847badf --- /dev/null +++ b/tests/auto/qplacemanager/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacemanager + SOURCES + tst_qplacemanager.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacemanager_nokia/CMakeLists.txt b/tests/auto/qplacemanager_nokia/CMakeLists.txt new file mode 100644 index 00000000..a5334c14 --- /dev/null +++ b/tests/auto/qplacemanager_nokia/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacemanager_nokia + SOURCES + tst_qplacemanager_nokia.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacemanager_unsupported/CMakeLists.txt b/tests/auto/qplacemanager_unsupported/CMakeLists.txt new file mode 100644 index 00000000..8ebad462 --- /dev/null +++ b/tests/auto/qplacemanager_unsupported/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacemanager_unsupported + SOURCES + tst_qplacemanager_unsupported.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacematchreply/CMakeLists.txt b/tests/auto/qplacematchreply/CMakeLists.txt new file mode 100644 index 00000000..fd2152be --- /dev/null +++ b/tests/auto/qplacematchreply/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacematchreply + SOURCES + tst_qplacematchreply.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacematchrequest/CMakeLists.txt b/tests/auto/qplacematchrequest/CMakeLists.txt new file mode 100644 index 00000000..47d4b319 --- /dev/null +++ b/tests/auto/qplacematchrequest/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacematchrequest + SOURCES + tst_qplacematchrequest.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplaceratings/CMakeLists.txt b/tests/auto/qplaceratings/CMakeLists.txt new file mode 100644 index 00000000..29aee1f7 --- /dev/null +++ b/tests/auto/qplaceratings/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplaceratings + SOURCES + tst_qplaceratings.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacereply/CMakeLists.txt b/tests/auto/qplacereply/CMakeLists.txt new file mode 100644 index 00000000..b5d68afa --- /dev/null +++ b/tests/auto/qplacereply/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacereply + SOURCES + tst_qplacereply.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplaceresult/CMakeLists.txt b/tests/auto/qplaceresult/CMakeLists.txt new file mode 100644 index 00000000..ef83565e --- /dev/null +++ b/tests/auto/qplaceresult/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplaceresult + SOURCES + tst_qplaceresult.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacereview/CMakeLists.txt b/tests/auto/qplacereview/CMakeLists.txt new file mode 100644 index 00000000..dfc485bd --- /dev/null +++ b/tests/auto/qplacereview/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacereview + SOURCES + tst_qplacereview.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacesearchreply/CMakeLists.txt b/tests/auto/qplacesearchreply/CMakeLists.txt new file mode 100644 index 00000000..86b8b973 --- /dev/null +++ b/tests/auto/qplacesearchreply/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qplacesearchreply + SOURCES + tst_qplacesearchreply.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qplacesearchrequest/CMakeLists.txt b/tests/auto/qplacesearchrequest/CMakeLists.txt new file mode 100644 index 00000000..bad66172 --- /dev/null +++ b/tests/auto/qplacesearchrequest/CMakeLists.txt @@ -0,0 +1,8 @@ +qt_internal_add_test(tst_qplacesearchrequest + SOURCES + tst_qplacesearchrequest.cpp + LIBRARIES + Qt::Core + Qt::Location + Qt::Positioning +) diff --git a/tests/auto/qplacesearchresult/CMakeLists.txt b/tests/auto/qplacesearchresult/CMakeLists.txt new file mode 100644 index 00000000..f76a610f --- /dev/null +++ b/tests/auto/qplacesearchresult/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacesearchresult + SOURCES + tst_qplacesearchresult.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacesearchsuggestionreply/CMakeLists.txt b/tests/auto/qplacesearchsuggestionreply/CMakeLists.txt new file mode 100644 index 00000000..609d6063 --- /dev/null +++ b/tests/auto/qplacesearchsuggestionreply/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacesearchsuggestionreply + SOURCES + tst_qplacesearchsuggestionreply.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplacesupplier/CMakeLists.txt b/tests/auto/qplacesupplier/CMakeLists.txt new file mode 100644 index 00000000..24bb07c9 --- /dev/null +++ b/tests/auto/qplacesupplier/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplacesupplier + SOURCES + tst_qplacesupplier.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qplaceuser/CMakeLists.txt b/tests/auto/qplaceuser/CMakeLists.txt new file mode 100644 index 00000000..10aac890 --- /dev/null +++ b/tests/auto/qplaceuser/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qplaceuser + SOURCES + tst_qplaceuser.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/qproposedsearchresult/CMakeLists.txt b/tests/auto/qproposedsearchresult/CMakeLists.txt new file mode 100644 index 00000000..d70bfdd9 --- /dev/null +++ b/tests/auto/qproposedsearchresult/CMakeLists.txt @@ -0,0 +1,7 @@ +qt_internal_add_test(tst_qproposedsearchresult + SOURCES + tst_qproposedsearchresult.cpp + LIBRARIES + Qt::Core + Qt::Location +) diff --git a/tests/auto/utils/qlocationtestutils_p.h b/tests/auto/utils/qlocationtestutils_p.h new file mode 100644 index 00000000..e82f7379 --- /dev/null +++ b/tests/auto/utils/qlocationtestutils_p.h @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#ifndef QLOCATIONTESTUTILS_P_H +#define QLOCATIONTESTUTILS_P_H + +#include +#include + +namespace QLocationTestUtils +{ + //The purpose of compareEquality() is to test equality + //operators where it is expected that A == B. + template + bool compareEquality(const A &first, const B &second) { + if (first != second) { + qWarning() << "compareEquality() failed: first != second"; + return false; + } + + if (second != first) { + qWarning() << "compareEquality() failed: second != first"; + return false; + } + + if (!(first == second)) { + qWarning() << "compareEquality() failed: !(first == second)"; + return false; + } + + if (!(second == first)) { + qWarning() << "compareEquality() failed: !(second == first)"; + return false; + } + + return true; + } + + //The purpose of compareInequality() is to test equality + //operators where it is expected that A != B. + //Using !compareEquality(...) is not sufficient because + //only the first operator checked would end up being tested. + template + bool compareInequality(const A &first, const B &second) { + if (!(first != second)){ + qWarning() << "compareInequality() failed: !(first != second)"; + return false; + } + + if (!(second != first)) { + qWarning() << "compareInequality() failed: !(second != first)"; + return false; + } + + if (first == second) { + qWarning() << "compareInequality() failed: first == second)"; + return false; + } + + if (second == first) { + qWarning() << "compareInequality() failed: second == first"; + return false; + } + return true; + } + + // Tests conversions between sub and base classes + // TC (test case) must implement: + // SubClass initialSubObject(); + // bool checkType(const BaseClass &) + // void detach(BaseClass *) - calls a mutator method, but doesn't actually modify the + // property to something different. + // void setSubClassProperty(SubClass *) - sets a property in the subclass instance + template + void testConversion(TC *tc) { + SubClass sub = tc->initialSubObject(); + //check conversion from SubClass -> BaseClass + //using assignment operator + BaseClass base; + base = sub; + QVERIFY(QLocationTestUtils::compareEquality(base, sub)); + QVERIFY(tc->checkType(base)); + + //check comparing base classes + BaseClass base2; + base2 = sub; + QVERIFY(QLocationTestUtils::compareEquality(base, base2)); + + //check conversion from BaseClass -> SubClass + //using assignment operator + SubClass sub2; + sub2 = base; + QVERIFY(QLocationTestUtils::compareEquality(sub, sub2)); + QVERIFY(tc->checkType(sub2)); + + //check that equality still holds with detachment of underlying data pointer + tc->detach(&base); + sub2 = base; + QVERIFY(QLocationTestUtils::compareEquality(sub, sub2)); + QVERIFY(QLocationTestUtils::compareEquality(sub, base)); + QVERIFY(QLocationTestUtils::compareEquality(base, base2)); + + //check that comparing objects are not the same + //when an underlying subclass field has been modified + tc->setSubClassProperty(&sub2); + base2 = sub2; + QVERIFY(QLocationTestUtils::compareInequality(sub, sub2)); + QVERIFY(QLocationTestUtils::compareInequality(sub, base2)); + QVERIFY(QLocationTestUtils::compareInequality(base, base2)); + + //check conversion from SubClass -> BaseClass + //using copy constructor + BaseClass base3(sub); + QVERIFY(QLocationTestUtils::compareEquality(sub, base3)); + QVERIFY(QLocationTestUtils::compareEquality(base, base3)); + + //check conversion from BaseClass -> SubClass + //using copy constructor + SubClass sub3(base3); + QVERIFY(QLocationTestUtils::compareEquality(sub, sub3)); + + //check conversion to subclass using a default base class instance + BaseClass baseDefault; + SubClass subDefault; + SubClass sub4(baseDefault); + QVERIFY(QLocationTestUtils::compareEquality(sub4, subDefault)); + + SubClass sub5 = baseDefault; + QVERIFY(QLocationTestUtils::compareEquality(sub5, subDefault)); + } +}; + +#endif -- cgit v1.2.1