qt, test: Enable tests on macOS with `minimal` QPA plugin
What changed, and why it matters
This commit removes workarounds that skipped three Bitcoin Core Qt test suites on macOS when using the 'minimal' Qt platform plugin. The previous commit fixed the underlying crash cause, so these tests can now run. It is a test-infrastructure cleanup, not a security patch for end-user software.
No security action required. Treat as normal test-maintenance cleanup. Review the preceding commit if verifying the actual crash fix is desired.
Security signals we found
No security-relevant code change in the diff itself
References a prior crash fix, but this commit only removes test skips
No input handling, cryptography, networking, consensus, or wallet logic modified
Evidence from the diff
The diff deletes macOS-specific early-return guards in src/qt/test/addressbooktests.cpp, apptests.cpp, and wallettests.cpp. Those guards skipped tests when QApplication::platformName() == ‘minimal’ to avoid Qt crashes from implicit NSApplication instantiation with a non-Cocoa QPA plugin (QTBUG-49686). The commit message states the crash source was fixed in the immediately preceding commit, making these guards unnecessary.
Changed components
src/qt/test/addressbooktests.cppsrc/qt/test/apptests.cppsrc/qt/test/wallettests.cppInspect captured patch +0 / −34
diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp
index 58b8a6d2..fae94ef0 100644
--- a/src/qt/test/addressbooktests.cpp
+++ b/src/qt/test/addressbooktests.cpp
@@ -212,16 +212,5 @@ void TestAddAddressesToSendBook(interfaces::Node& node)
void AddressBookTests::addressBookTests()
{
-#ifdef Q_OS_MACOS
- if (QApplication::platformName() == "minimal") {
- // Disable for mac on "minimal" platform to avoid crashes inside the Qt
- // framework when it tries to look up unimplemented cocoa functions,
- // and fails to handle returned nulls
- // (https://bugreports.qt.io/browse/QTBUG-49686).
- qWarning() << "Skipping AddressBookTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
- "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.";
- return;
- }
-#endif
TestAddAddressesToSendBook(m_node);
}
diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp
index 752c8773..7802696d 100644
--- a/src/qt/test/apptests.cpp
+++ b/src/qt/test/apptests.cpp
@@ -54,18 +54,6 @@ void TestRpcCommand(RPCConsole* console)
//! Entry point for BitcoinApplication tests.
void AppTests::appTests()
{
-#ifdef Q_OS_MACOS
- if (QApplication::platformName() == "minimal") {
- // Disable for mac on "minimal" platform to avoid crashes inside the Qt
- // framework when it tries to look up unimplemented cocoa functions,
- // and fails to handle returned nulls
- // (https://bugreports.qt.io/browse/QTBUG-49686).
- qWarning() << "Skipping AppTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
- "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.";
- return;
- }
-#endif
-
qRegisterMetaType<interfaces::BlockAndHeaderTipInfo>("interfaces::BlockAndHeaderTipInfo");
m_app.parameterSetup();
QVERIFY(m_app.createOptionsModel(/*resetSettings=*/true));
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp
index a2983c23..af620b67 100644
--- a/src/qt/test/wallettests.cpp
+++ b/src/qt/test/wallettests.cpp
@@ -455,16 +455,5 @@ void TestGUI(interfaces::Node& node)
void WalletTests::walletTests()
{
-#ifdef Q_OS_MACOS
- if (QApplication::platformName() == "minimal") {
- // Disable for mac on "minimal" platform to avoid crashes inside the Qt
- // framework when it tries to look up unimplemented cocoa functions,
- // and fails to handle returned nulls
- // (https://bugreports.qt.io/browse/QTBUG-49686).
- qWarning() << "Skipping WalletTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
- "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.";
- return;
- }
-#endif
TestGUI(m_node);
}
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.