Skip to content

Commit

Permalink
fix test and more
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jun 23, 2021
1 parent e02d341 commit 152b766
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 12 deletions.
4 changes: 4 additions & 0 deletions src/auth/basic/CMakeLists.txt
Expand Up @@ -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()
Expand Down
5 changes: 4 additions & 1 deletion src/auth/esritoken/CMakeLists.txt
Expand Up @@ -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()

Expand All @@ -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()
Expand Down
5 changes: 4 additions & 1 deletion src/auth/identcert/CMakeLists.txt
Expand Up @@ -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()

Expand All @@ -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()
Expand Down
10 changes: 9 additions & 1 deletion src/auth/oauth2/CMakeLists.txt
Expand Up @@ -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()

Expand All @@ -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)

Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/auth/oauth2/core/qgsauthoauth2method.cpp
Expand Up @@ -660,6 +660,6 @@ void QgsAuthOAuth2Method::removeOAuth2Bundle( const QString &authcfg )
#ifndef HAVE_STATIC_PROVIDERS
QGISEXTERN QgsAuthMethodMetadata *authMethodMetadataFactory()
{
return new QgsAuthOAuth2cMethodMetadata();
return new QgsAuthOAuth2MethodMetadata();
}
#endif
5 changes: 4 additions & 1 deletion src/auth/pkipaths/CMakeLists.txt
Expand Up @@ -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()

Expand All @@ -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()
Expand Down
5 changes: 4 additions & 1 deletion src/auth/pkipkcs12/CMakeLists.txt
Expand Up @@ -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()

Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/src/auth/CMakeLists.txt
Expand Up @@ -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()
Expand Down
9 changes: 4 additions & 5 deletions tests/src/core/testqgsauthmanager.cpp
Expand Up @@ -26,6 +26,7 @@

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

Expand Down Expand Up @@ -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() );
}
Expand Down

0 comments on commit 152b766

Please sign in to comment.