Entry point for BitcoinApplication tests.
| 58 | |
| 59 | //! Entry point for BitcoinApplication tests. |
| 60 | void 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. |
| 99 | void AppTests::guiTests(BitcoinGUI* window) |
nothing calls this directly
no test coverage detected