Add test to check the libs are working properly

It's a simple check at runtime to see if ssl is supported using the included libs.
This commit is contained in:
Assam Boudjelthia
2025-02-17 15:07:49 +02:00
committed by Assam Boudjelthia
parent 7ccc0bcede
commit 970e2742b0
4 changed files with 44 additions and 0 deletions
+1
View File
@@ -1,2 +1,3 @@
build/
.DS_Store
*.user
+17
View File
@@ -0,0 +1,17 @@
if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
cmake_minimum_required(VERSION 3.16)
project(tst_openssl LANGUAGES CXX)
find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
endif()
qt_internal_add_test(tst_openssl
SOURCES
tst_openssl.cpp
LIBRARIES
Qt::Network
)
if (ANDROID)
include(../android_openssl.cmake)
add_android_openssl_libraries(tst_openssl)
endif()
+17
View File
@@ -0,0 +1,17 @@
#include <QtTest>
#include <QSslSocket>
class tst_OpenSsl : public QObject
{
Q_OBJECT
private slots:
void supportsSsl();
};
void tst_OpenSsl::supportsSsl() {
QVERIFY(QSslSocket::supportsSsl());
}
QTEST_MAIN(tst_OpenSsl)
#include "tst_openssl.moc"
+9
View File
@@ -0,0 +1,9 @@
QT += testlib gui network
CONFIG += qt warn_on depend_includepath testcase
TEMPLATE = app
SOURCES += tst_openssl.cpp
android: include(../openssl.pri)