Bitcoin Core  22.99.0
P2P Digital Currency
apptests.h
Go to the documentation of this file.
1 // Copyright (c) 2018-2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_TEST_APPTESTS_H
6 #define BITCOIN_QT_TEST_APPTESTS_H
7 
8 #include <QObject>
9 #include <set>
10 #include <string>
11 #include <utility>
12 
13 class BitcoinApplication;
14 class BitcoinGUI;
15 class RPCConsole;
16 
17 class AppTests : public QObject
18 {
19  Q_OBJECT
20 public:
21  explicit AppTests(BitcoinApplication& app) : m_app(app) {}
22 
23 private Q_SLOTS:
24  void appTests();
25  void guiTests(BitcoinGUI* window);
26  void consoleTests(RPCConsole* console);
27 
28 private:
30  void expectCallback(std::string callback) { m_callbacks.emplace(std::move(callback)); }
31 
34  {
35  std::string m_callback;
38  };
39 
42 
47  std::multiset<std::string> m_callbacks;
48 };
49 
50 #endif // BITCOIN_QT_TEST_APPTESTS_H
AppTests::m_callbacks
std::multiset< std::string > m_callbacks
Set of pending callback names.
Definition: apptests.h:47
AppTests::consoleTests
void consoleTests(RPCConsole *console)
Entry point for RPCConsole tests.
Definition: apptests.cpp:108
AppTests
Definition: apptests.h:17
AppTests::m_app
BitcoinApplication & m_app
Bitcoin application.
Definition: apptests.h:41
RPCConsole
Local Bitcoin RPC console.
Definition: rpcconsole.h:38
AppTests::AppTests
AppTests(BitcoinApplication &app)
Definition: apptests.h:21
AppTests::expectCallback
void expectCallback(std::string callback)
Add expected callback name to list of pending callbacks.
Definition: apptests.h:30
AppTests::HandleCallback::~HandleCallback
~HandleCallback()
Destructor to shut down after the last expected callback completes.
Definition: apptests.cpp:115
AppTests::HandleCallback::m_app_tests
AppTests & m_app_tests
Definition: apptests.h:36
AppTests::guiTests
void guiTests(BitcoinGUI *window)
Entry point for BitcoinGUI tests.
Definition: apptests.cpp:98
AppTests::HandleCallback
RAII helper to remove no-longer-pending callback.
Definition: apptests.h:33
BitcoinGUI
Bitcoin GUI main class.
Definition: bitcoingui.h:68
BitcoinApplication
Main Bitcoin application object.
Definition: bitcoin.h:36
AppTests::appTests
void appTests()
Entry point for BitcoinApplication tests.
Definition: apptests.cpp:59
AppTests::HandleCallback::m_callback
std::string m_callback
Definition: apptests.h:35