Entry point for BitcoinApplication tests.
| 53 | |
| 54 | //! Entry point for BitcoinApplication tests. |
| 55 | void AppTests::appTests() |
| 56 | { |
| 57 | #ifdef Q_OS_MACOS |
| 58 | if (QApplication::platformName() == "minimal") { |
| 59 | // Disable for mac on "minimal" platform to avoid crashes inside the Qt |
| 60 | // framework when it tries to look up unimplemented cocoa functions, |
| 61 | // and fails to handle returned nulls |
| 62 | // (https://bugreports.qt.io/browse/QTBUG-49686). |
| 63 | qWarning() << "Skipping AppTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke " |
| 64 | "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build."; |
| 65 | return; |
| 66 | } |
| 67 | #endif |
| 68 | |
| 69 | qRegisterMetaType<interfaces::BlockAndHeaderTipInfo>("interfaces::BlockAndHeaderTipInfo"); |
| 70 | m_app.parameterSetup(); |
| 71 | QVERIFY(m_app.createOptionsModel(/*resetSettings=*/true)); |
| 72 | QScopedPointer<const NetworkStyle> style(NetworkStyle::instantiate(Params().GetChainType())); |
| 73 | m_app.setupPlatformStyle(); |
| 74 | m_app.createWindow(style.data()); |
| 75 | connect(&m_app, &BitcoinApplication::windowShown, this, &AppTests::guiTests); |
| 76 | expectCallback("guiTests"); |
| 77 | m_app.baseInitialize(); |
| 78 | m_app.requestInitialize(); |
| 79 | m_app.exec(); |
| 80 | m_app.requestShutdown(); |
| 81 | m_app.exec(); |
| 82 | |
| 83 | // Reset global state to avoid interfering with later tests. |
| 84 | LogInstance().DisconnectTestLogger(); |
| 85 | } |
| 86 | |
| 87 | //! Entry point for BitcoinGUI tests. |
| 88 | void AppTests::guiTests(BitcoinGUI* window) |
nothing calls this directly
no test coverage detected