Skip to content

Commit

Permalink
Switch integration test to qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthGandalf committed Sep 5, 2024
1 parent 0506e95 commit 330032e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
12 changes: 6 additions & 6 deletions cmake/use_homebrew.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ if(brew_python_f EQUAL 0)
"${brew_python}/Frameworks/Python.framework")
endif()

execute_process(COMMAND "${brew}" --prefix qt5
RESULT_VARIABLE brew_qt5_f
OUTPUT_VARIABLE brew_qt5 OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
if(brew_qt5_f EQUAL 0)
find_package_message(brew_qt5 "Qt5 via Homebrew: ${brew_qt5}"
"${brew_qt5}")
execute_process(COMMAND "${brew}" --prefix qt6
RESULT_VARIABLE brew_qt6_f
OUTPUT_VARIABLE brew_qt6 OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
if(brew_qt6_f EQUAL 0)
find_package_message(brew_qt6 "Qt6 via Homebrew: ${brew_qt6}"
"${brew_qt6}")
endif()

execute_process(COMMAND "${brew}" --prefix gettext
Expand Down
4 changes: 2 additions & 2 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set(CMAKE_THREAD_PREFER_PTHREAD true)
set(THREADS_PREFER_PTHREAD_FLAG true)
find_package(Threads REQUIRED)

find_package(Qt5Network 5.4 REQUIRED HINTS ${Qt5_HINTS})
find_package(Qt6Network REQUIRED HINTS ${Qt6_HINTS})

# Force the simple internal regex engine to get consistent behavior on all
# platforms. See
Expand All @@ -42,7 +42,7 @@ add_executable(inttest
"${GTEST_ROOT}/src/gtest-all.cc"
"${GMOCK_ROOT}/src/gmock-all.cc")

target_link_libraries(inttest Qt5::Network Threads::Threads)
target_link_libraries(inttest Qt6::Network Threads::Threads)
target_include_directories(inttest PUBLIC
"${PROJECT_SOURCE_DIR}/framework"
"${PROJECT_BINARY_DIR}"
Expand Down
14 changes: 6 additions & 8 deletions test/integration/framework/znctest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

#include <QRegularExpression>
#include "znctest.h"

#ifndef ZNC_BIN_DIR
Expand Down Expand Up @@ -119,13 +120,10 @@ std::unique_ptr<QNetworkReply> ZNCTest::HandleHttp(QNetworkReply* reply) {
std::cout << "Got HTTP reply" << std::endl;
loop.quit();
});
QObject::connect(
reply,
static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(
&QNetworkReply::error),
[&](QNetworkReply::NetworkError e) {
ADD_FAILURE() << reply->errorString().toStdString();
});
QObject::connect(reply, &QNetworkReply::errorOccurred,
[&](QNetworkReply::NetworkError e) {
ADD_FAILURE() << reply->errorString().toStdString();
});
QTimer::singleShot(30000 /* msec */, &loop, [&]() {
ADD_FAILURE() << "connection timeout";
loop.quit();
Expand Down Expand Up @@ -160,7 +158,7 @@ void ZNCTest::InstallModule(QString name, QString content) {
QStringList lines = content.split("\n");
int maxoffset = -1;
for (const QString& line : lines) {
int nonspace = line.indexOf(QRegExp("\\S"));
int nonspace = line.indexOf(QRegularExpression("\\S"));
if (nonspace == -1) continue;
if (nonspace < maxoffset || maxoffset == -1) maxoffset = nonspace;
}
Expand Down

0 comments on commit 330032e

Please sign in to comment.