mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-05 05:02:06 +02:00
qt, test: introduce FindInConsole function
Allows for regex searching into the console output.
This commit is contained in:
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QRegularExpression>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
@ -30,6 +31,13 @@
|
|||||||
#include <QtTest/QtTestGui>
|
#include <QtTest/QtTestGui>
|
||||||
|
|
||||||
namespace {
|
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.
|
//! Call getblockchaininfo RPC and check first field of JSON output.
|
||||||
void TestRpcCommand(RPCConsole* console)
|
void TestRpcCommand(RPCConsole* console)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user