Skip to content
Permalink
Browse files
fix test and more
  • Loading branch information
3nids committed Jun 23, 2021
1 parent e02d341 commit 152b766516556cb51fdceb84e35cdd91eff077e8
@@ -56,6 +56,10 @@ else()
target_link_libraries(authmethod_basic qgis_core)

if (WITH_GUI)
target_include_directories(authmethod_basic PRIVATE
${CMAKE_SOURCE_DIR}/src/auth/basic/gui
${CMAKE_BINARY_DIR}/src/auth/basic
)
target_link_libraries (authmethod_basic qgis_gui)
add_dependencies(authmethod_basic ui)
endif()
@@ -35,7 +35,6 @@ if (WITH_GUI)
${CMAKE_SOURCE_DIR}/src/auth/esritoken/gui
${CMAKE_BINARY_DIR}/src/auth/esritoken
)

target_link_libraries (authmethod_esritoken_a qgis_gui)
endif()

@@ -54,6 +53,10 @@ else()
target_link_libraries(authmethod_esritoken qgis_core)

if (WITH_GUI)
target_include_directories(authmethod_esritoken PRIVATE
${CMAKE_SOURCE_DIR}/src/auth/esritoken/gui
${CMAKE_BINARY_DIR}/src/auth/esritoken
)
target_link_libraries (authmethod_esritoken qgis_gui)
add_dependencies(authmethod_esritoken ui)
endif()
@@ -35,7 +35,6 @@ if (WITH_GUI)
${CMAKE_SOURCE_DIR}/src/auth/identcert/gui
${CMAKE_BINARY_DIR}/src/auth/identcert
)

target_link_libraries (authmethod_identcert_a qgis_gui)
endif()

@@ -56,6 +55,10 @@ else()
target_link_libraries(authmethod_identcert qgis_core)

if (WITH_GUI)
target_include_directories(authmethod_identcert PRIVATE
${CMAKE_SOURCE_DIR}/src/auth/identcert/gui
${CMAKE_BINARY_DIR}/src/auth/identcert
)
target_link_libraries (authmethod_identcert qgis_gui)
add_dependencies(authmethod_identcert ui)
endif()
@@ -126,7 +126,6 @@ if (WITH_GUI)
${CMAKE_SOURCE_DIR}/src/auth/oauth2/gui
${CMAKE_BINARY_DIR}/src/auth/oauth2
)

target_link_libraries (authmethod_oauth2_a qgis_gui)
endif()

@@ -139,6 +138,11 @@ else()
# dynamically loaded module
add_library(authmethod_oauth2 MODULE ${AUTH_OAUTH2_SRCS} ${AUTH_OAUTH2_HDRS} ${AUTH_OAUTH2_UIS_H})

target_include_directories(authmethod_oauth2 PRIVATE
${CMAKE_SOURCE_DIR}/external/qjsonwrapper
${CMAKE_SOURCE_DIR}/src/auth/oauth2/core
)

# require c++17
target_compile_features(authmethod_oauth2 PRIVATE cxx_std_17)

@@ -156,6 +160,10 @@ else()
endif()

if (WITH_GUI)
target_include_directories(authmethod_oauth2 PRIVATE
${CMAKE_SOURCE_DIR}/src/auth/oauth2/gui
${CMAKE_BINARY_DIR}/src/auth/oauth2
)
target_link_libraries (authmethod_oauth2 qgis_gui)
add_dependencies(authmethod_oauth2 ui)
endif()
@@ -660,6 +660,6 @@ void QgsAuthOAuth2Method::removeOAuth2Bundle( const QString &authcfg )
#ifndef HAVE_STATIC_PROVIDERS
QGISEXTERN QgsAuthMethodMetadata *authMethodMetadataFactory()
{
return new QgsAuthOAuth2cMethodMetadata();
return new QgsAuthOAuth2MethodMetadata();
}
#endif
@@ -34,7 +34,6 @@ if (WITH_GUI)
${CMAKE_SOURCE_DIR}/src/auth/pkipaths/gui
${CMAKE_BINARY_DIR}/src/auth/pkipaths
)

target_link_libraries (authmethod_pkipaths_a qgis_gui)
endif()

@@ -55,6 +54,10 @@ else()
target_link_libraries(authmethod_pkipaths qgis_core)

if (WITH_GUI)
target_include_directories(authmethod_pkipaths PRIVATE
${CMAKE_SOURCE_DIR}/src/auth/pkipaths/gui
${CMAKE_BINARY_DIR}/src/auth/pkipaths
)
target_link_libraries (authmethod_pkipaths qgis_gui)
add_dependencies(authmethod_pkipaths ui)
endif()
@@ -34,7 +34,6 @@ if (WITH_GUI)
${CMAKE_SOURCE_DIR}/src/auth/pkipkcs12/gui
${CMAKE_BINARY_DIR}/src/auth/pkipkcs12
)

target_link_libraries (authmethod_pkcs12_a qgis_gui)
endif()

@@ -55,6 +54,10 @@ else()
target_link_libraries(authmethod_pkcs12 qgis_core)

if (WITH_GUI)
target_include_directories(authmethod_pkcs12 PRIVATE
${CMAKE_SOURCE_DIR}/src/auth/pkipkcs12/gui
${CMAKE_BINARY_DIR}/src/auth/pkipkcs12
)
target_link_libraries (authmethod_pkcs12 qgis_gui)
add_dependencies(authmethod_pkcs12 ui)
endif()
@@ -24,7 +24,7 @@ endif()
#############################################################
# Tests:

set(LINKEDLIBRARIES qgis_core authmethod_oauth2_static)
set(LINKEDLIBRARIES qgis_core authmethod_oauth2_a)
if(WITH_GUI)
set(LINKEDLIBRARIES ${LINKEDLIBRARIES} qgis_gui)
endif()
@@ -26,6 +26,7 @@

#include "qgsapplication.h"
#include "qgsauthmanager.h"
#include "qgsauthmethodmetadata.h"
#include "qgsauthconfig.h"
#include "qgssettings.h"

@@ -376,11 +377,9 @@ void TestQgsAuthManager::testAuthMethods()
QString configid( config.id() );

// correct method, loaded from core auth method plugin registry, should be returned
QgsAuthMethod *authmethod = authm->configAuthMethod( configid );
QVERIFY( authmethod );
QCOMPARE( authmethod->key(), config.method() );


const QgsAuthMethodMetadata *meta = authm->authMethodMetadata( configid );
QVERIFY( meta );
QCOMPARE( meta->key(), config.method() );
}
QVERIFY( authm->removeAllAuthenticationConfigs() );
}

0 comments on commit 152b766

Please sign in to comment.