mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
qt, test: introduce FindInConsole function
Allows for regex searching into the console output.
This commit is contained in:
parent
62d9ff9e6e
commit
d09d1cf1a2
1 changed files with 8 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <QAction>
|
||||
#include <QLineEdit>
|
||||
#include <QRegularExpression>
|
||||
#include <QScopedPointer>
|
||||
#include <QSignalSpy>
|
||||
#include <QTest>
|
||||
|
@ -30,6 +31,13 @@
|
|||
#include <QtTest/QtTestGui>
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue