From 15cdea912b45d28c4d38c8a9f3cde8aab031e321 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 2 Mar 2017 11:50:00 +0100 Subject: Make tst_places compile with -no-feature-process We already had a guard for QT_NO_PROCESS in place. Change that to the safe form QT_CONFIG(process) and also guard the header inclusion. Change-Id: I9c62024bd315a91da44e0492f0c8aa095de76dab Reviewed-by: Alex Blasche --- tests/auto/nokia_services/places_semiauto/tst_places.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/nokia_services/places_semiauto/tst_places.cpp b/tests/auto/nokia_services/places_semiauto/tst_places.cpp index 8e5289d4..2f68ab44 100644 --- a/tests/auto/nokia_services/places_semiauto/tst_places.cpp +++ b/tests/auto/nokia_services/places_semiauto/tst_places.cpp @@ -30,7 +30,9 @@ #include #include +#if QT_CONFIG(process) #include +#endif #include #include #include @@ -105,7 +107,7 @@ void tst_QPlaceManagerNokia::initTestCase() QVariantMap params; QStringList providers = QGeoServiceProvider::availableServiceProviders(); QVERIFY(providers.contains("here")); -#ifndef QT_NO_PROCESS +#if QT_CONFIG(process) QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); if (!(env.contains(AppIdEnv) && env.contains(TokenEnv))) -- cgit v1.2.1 From 31ff679359172dfa068014ab0537418f5b852eac Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 6 Mar 2017 15:24:57 +0100 Subject: Don't try to set library paths if !QT_CONFIG(library) Change-Id: I1774d2b4c637f5057691f43275e10f19b986c722 Reviewed-by: Oswald Buddenhagen Reviewed-by: Alex Blasche --- tests/auto/declarative_core/main.cpp | 2 ++ tests/auto/declarative_ui/main.cpp | 2 ++ tests/auto/positionplugintest/tst_positionplugin.cpp | 2 ++ tests/auto/qgeoareamonitor/tst_qgeoareamonitor.cpp | 2 ++ tests/auto/qgeocodingmanager/tst_qgeocodingmanager.cpp | 2 ++ tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp | 2 ++ tests/auto/qgeoroutingmanager/tst_qgeoroutingmanager.cpp | 2 ++ tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp | 2 ++ tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp | 2 ++ .../tst_qnmeapositioninfosource_realtime_generic.cpp | 2 ++ .../tst_qnmeapositioninfosource_simulation_generic.cpp | 2 ++ tests/auto/qplacemanager/tst_qplacemanager.cpp | 2 ++ tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp | 2 ++ 13 files changed, 26 insertions(+) (limited to 'tests') diff --git a/tests/auto/declarative_core/main.cpp b/tests/auto/declarative_core/main.cpp index 041dbb7e..b380a231 100644 --- a/tests/auto/declarative_core/main.cpp +++ b/tests/auto/declarative_core/main.cpp @@ -31,6 +31,7 @@ static void initializeLibraryPath() { +#if QT_CONFIG(library) // Set custom path since CI doesn't install test plugins #ifdef Q_OS_WIN QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + @@ -39,6 +40,7 @@ static void initializeLibraryPath() QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); #endif +#endif } Q_COREAPP_STARTUP_FUNCTION(initializeLibraryPath) diff --git a/tests/auto/declarative_ui/main.cpp b/tests/auto/declarative_ui/main.cpp index 8a12f411..49e64bc0 100644 --- a/tests/auto/declarative_ui/main.cpp +++ b/tests/auto/declarative_ui/main.cpp @@ -31,6 +31,7 @@ static void initializeLibraryPath() { +#if QT_CONFIG(library) // Set custom path since CI doesn't install test plugins #ifdef Q_OS_WIN QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + @@ -39,6 +40,7 @@ static void initializeLibraryPath() QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); #endif +#endif } Q_COREAPP_STARTUP_FUNCTION(initializeLibraryPath) diff --git a/tests/auto/positionplugintest/tst_positionplugin.cpp b/tests/auto/positionplugintest/tst_positionplugin.cpp index 34d05094..6e8847b8 100644 --- a/tests/auto/positionplugintest/tst_positionplugin.cpp +++ b/tests/auto/positionplugintest/tst_positionplugin.cpp @@ -53,6 +53,7 @@ private slots: void tst_PositionPlugin::initTestCase() { +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -62,6 +63,7 @@ void tst_PositionPlugin::initTestCase() #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); +#endif #endif qRegisterMetaType(); } diff --git a/tests/auto/qgeoareamonitor/tst_qgeoareamonitor.cpp b/tests/auto/qgeoareamonitor/tst_qgeoareamonitor.cpp index 55261984..75c1eecb 100644 --- a/tests/auto/qgeoareamonitor/tst_qgeoareamonitor.cpp +++ b/tests/auto/qgeoareamonitor/tst_qgeoareamonitor.cpp @@ -77,6 +77,7 @@ class tst_QGeoAreaMonitorSource : public QObject private slots: void initTestCase() { +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install plugins */ @@ -86,6 +87,7 @@ private slots: #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); +#endif #endif qRegisterMetaType(); qRegisterMetaType(); diff --git a/tests/auto/qgeocodingmanager/tst_qgeocodingmanager.cpp b/tests/auto/qgeocodingmanager/tst_qgeocodingmanager.cpp index 581b3c4e..9647c0d6 100644 --- a/tests/auto/qgeocodingmanager/tst_qgeocodingmanager.cpp +++ b/tests/auto/qgeocodingmanager/tst_qgeocodingmanager.cpp @@ -35,6 +35,7 @@ QT_USE_NAMESPACE void tst_QGeoCodingManager::initTestCase() { +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -44,6 +45,7 @@ void tst_QGeoCodingManager::initTestCase() #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); +#endif #endif tst_QGeoCodingManager::loadGeocodingManager(); } diff --git a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp index 31ab86f3..0fc8f492 100644 --- a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp +++ b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp @@ -109,6 +109,7 @@ TestQGeoPositionInfoSource::TestQGeoPositionInfoSource(QObject *parent) : QObject(parent) { m_testingDefaultSource = false; +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -119,6 +120,7 @@ TestQGeoPositionInfoSource::TestQGeoPositionInfoSource(QObject *parent) QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); #endif +#endif } TestQGeoPositionInfoSource *TestQGeoPositionInfoSource::createDefaultSourceTest() diff --git a/tests/auto/qgeoroutingmanager/tst_qgeoroutingmanager.cpp b/tests/auto/qgeoroutingmanager/tst_qgeoroutingmanager.cpp index 4dbeea55..dc519b48 100644 --- a/tests/auto/qgeoroutingmanager/tst_qgeoroutingmanager.cpp +++ b/tests/auto/qgeoroutingmanager/tst_qgeoroutingmanager.cpp @@ -35,6 +35,7 @@ QT_USE_NAMESPACE void tst_QGeoRoutingManager::initTestCase() { +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -44,6 +45,7 @@ void tst_QGeoRoutingManager::initTestCase() #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); +#endif #endif tst_QGeoRoutingManager::loadRoutingManager(); } diff --git a/tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp b/tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp index 121253fa..7303e431 100644 --- a/tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp +++ b/tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp @@ -48,6 +48,7 @@ private slots: void tst_QGeoServiceProvider::initTestCase() { +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -58,6 +59,7 @@ void tst_QGeoServiceProvider::initTestCase() QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); #endif +#endif } void tst_QGeoServiceProvider::tst_availableServiceProvider() diff --git a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp index cc2672b2..480e7d60 100644 --- a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp +++ b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp @@ -91,6 +91,7 @@ tst_QGeoTiledMap::~tst_QGeoTiledMap() void tst_QGeoTiledMap::initTestCase() { +#if QT_CONFIG(library) // Set custom path since CI doesn't install test plugins #ifdef Q_OS_WIN QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + @@ -98,6 +99,7 @@ void tst_QGeoTiledMap::initTestCase() #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); +#endif #endif QVariantMap parameters; parameters["tileSize"] = 16; diff --git a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp index cedcd56a..d3f03c0d 100644 --- a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp +++ b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/tst_qnmeapositioninfosource_realtime_generic.cpp @@ -38,6 +38,7 @@ public: tst_QNmeaPositionInfoSource_RealTime_Generic() { m_factory = new QNmeaPositionInfoSourceProxyFactory; +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -47,6 +48,7 @@ public: #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../../plugins")); +#endif #endif } diff --git a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp index 0d8f03c9..adc55f64 100644 --- a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp +++ b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/tst_qnmeapositioninfosource_simulation_generic.cpp @@ -36,6 +36,7 @@ class tst_QNmeaPositionInfoSource_Simulation_Generic : public TestQGeoPositionIn public: tst_QNmeaPositionInfoSource_Simulation_Generic() { +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -45,6 +46,7 @@ public: #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../../plugins")); +#endif #endif } diff --git a/tests/auto/qplacemanager/tst_qplacemanager.cpp b/tests/auto/qplacemanager/tst_qplacemanager.cpp index fe97b37c..2cb035cd 100644 --- a/tests/auto/qplacemanager/tst_qplacemanager.cpp +++ b/tests/auto/qplacemanager/tst_qplacemanager.cpp @@ -72,6 +72,7 @@ private: void tst_QPlaceManager::initTestCase() { +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -81,6 +82,7 @@ void tst_QPlaceManager::initTestCase() #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); +#endif #endif provider = 0; diff --git a/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp b/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp index 41716103..98a9dd31 100644 --- a/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp +++ b/tests/auto/qplacemanager_unsupported/tst_qplacemanager_unsupported.cpp @@ -75,6 +75,7 @@ private: void tst_QPlaceManagerUnsupported::initTestCase() { +#if QT_CONFIG(library) /* * Set custom path since CI doesn't install test plugins */ @@ -84,6 +85,7 @@ void tst_QPlaceManagerUnsupported::initTestCase() #else QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../../../plugins")); +#endif #endif m_provider = 0; -- cgit v1.2.1