Bitcoin Core  27.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
void expectCallback(std::string callback)
Add expected callback name to list of pending callbacks.
Definition: apptests.h:30
AppTests(BitcoinApplication &app)
Definition: apptests.h:21
void guiTests(BitcoinGUI *window)
Entry point for BitcoinGUI tests.
Definition: apptests.cpp:88
BitcoinApplication & m_app
Bitcoin application.
Definition: apptests.h:41
std::multiset< std::string > m_callbacks
Set of pending callback names.
Definition: apptests.h:47
void appTests()
Entry point for BitcoinApplication tests.
Definition: apptests.cpp:55
void consoleTests(RPCConsole *console)
Entry point for RPCConsole tests.
Definition: apptests.cpp:98
Main Bitcoin application object.
Definition: bitcoin.h:37
Bitcoin GUI main class.
Definition: bitcoingui.h:70
Local Bitcoin RPC console.
Definition: rpcconsole.h:44
RAII helper to remove no-longer-pending callback.
Definition: apptests.h:34
~HandleCallback()
Destructor to shut down after the last expected callback completes.
Definition: apptests.cpp:105
std::string m_callback
Definition: apptests.h:35
AppTests & m_app_tests
Definition: apptests.h:36