From d09d1cf1a267b1c5563d8876aa55c4e8f70f0562 Mon Sep 17 00:00:00 2001 From: Jarol Rodriguez Date: Sun, 16 May 2021 20:36:59 -0400 Subject: qt, test: introduce FindInConsole function Allows for regex searching into the console output. --- src/qt/test/apptests.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp index cb3dbd2267..c5f9b570a1 100644 --- a/src/qt/test/apptests.cpp +++ b/src/qt/test/apptests.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -30,6 +31,13 @@ #include namespace { +//! Regex find a string group inside of the console output +QString FindInConsole(const QString& output, const QString& pattern) +{ + const QRegularExpression re(pattern); + return re.match(output).captured(1); +} + //! Call getblockchaininfo RPC and check first field of JSON output. void TestRpcCommand(RPCConsole* console) { -- cgit v1.2.3