MCPcopy Create free account
hub / github.com/ElementsProject/elements / appTests

Method appTests

src/qt/test/apptests.cpp:60–96  ·  view source on GitHub ↗

Entry point for BitcoinApplication tests.

Source from the content-addressed store, hash-verified

58
59//! Entry point for BitcoinApplication tests.
60void AppTests::appTests()
61{
62#ifdef Q_OS_MAC
63 if (QApplication::platformName() == "minimal") {
64 // Disable for mac on "minimal" platform to avoid crashes inside the Qt
65 // framework when it tries to look up unimplemented cocoa functions,
66 // and fails to handle returned nulls
67 // (https://bugreports.qt.io/browse/QTBUG-49686).
68 QWARN("Skipping AppTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
69 "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
70 return;
71 }
72#endif
73 fs::create_directories([] {
74 BasicTestingSetup test{CBaseChainParams::REGTEST}; // Create a temp data directory to backup the gui settings to
75 return gArgs.GetDataDirNet() / "blocks";
76 }());
77
78 qRegisterMetaType<interfaces::BlockAndHeaderTipInfo>("interfaces::BlockAndHeaderTipInfo");
79 m_app.parameterSetup();
80 m_app.createOptionsModel(true /* reset settings */);
81 QScopedPointer<const NetworkStyle> style(NetworkStyle::instantiate(Params().NetworkIDString()));
82 m_app.setupPlatformStyle();
83 m_app.createWindow(style.data());
84 connect(&m_app, &BitcoinApplication::windowShown, this, &AppTests::guiTests);
85 expectCallback("guiTests");
86 m_app.baseInitialize();
87 m_app.requestInitialize();
88 m_app.exec();
89 m_app.requestShutdown();
90 m_app.exec();
91
92 // Reset global state to avoid interfering with later tests.
93 ClearGlobalAssetDir();
94 LogInstance().DisconnectTestLogger();
95 AbortShutdown();
96}
97
98//! Entry point for BitcoinGUI tests.
99void AppTests::guiTests(BitcoinGUI* window)

Callers

nothing calls this directly

Calls 15

create_directoriesFunction · 0.85
ClearGlobalAssetDirFunction · 0.85
AbortShutdownFunction · 0.85
parameterSetupMethod · 0.80
createOptionsModelMethod · 0.80
NetworkIDStringMethod · 0.80
setupPlatformStyleMethod · 0.80
createWindowMethod · 0.80
requestInitializeMethod · 0.80
execMethod · 0.80
requestShutdownMethod · 0.80
DisconnectTestLoggerMethod · 0.80

Tested by

no test coverage detected