Skip to content

Commit a3197c5

Browse files
committed
Disable wallet and address book Qt tests on macOS minimal platform
macOS Qt minimal platform is frequently broken, and these are currently failing with Qt 5.11.1. The tests do pass when run on the full cocoa platform (with `test_bitcoin-qt -platform cocoa`).
1 parent 2a58340 commit a3197c5

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/qt/test/addressbooktests.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <key_io.h>
1818
#include <wallet/wallet.h>
1919

20+
#include <QApplication>
2021
#include <QTimer>
2122
#include <QMessageBox>
2223

@@ -139,5 +140,16 @@ void TestAddAddressesToSendBook()
139140

140141
void AddressBookTests::addressBookTests()
141142
{
143+
#ifdef Q_OS_MAC
144+
if (QApplication::platformName() == "minimal") {
145+
// Disable for mac on "minimal" platform to avoid crashes inside the Qt
146+
// framework when it tries to look up unimplemented cocoa functions,
147+
// and fails to handle returned nulls
148+
// (https://bugreports.qt.io/browse/QTBUG-49686).
149+
QWARN("Skipping AddressBookTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
150+
"with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build.");
151+
return;
152+
}
153+
#endif
142154
TestAddAddressesToSendBook();
143155
}

src/qt/test/wallettests.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,5 +243,16 @@ void TestGUI()
243243

244244
void WalletTests::walletTests()
245245
{
246+
#ifdef Q_OS_MAC
247+
if (QApplication::platformName() == "minimal") {
248+
// Disable for mac on "minimal" platform to avoid crashes inside the Qt
249+
// framework when it tries to look up unimplemented cocoa functions,
250+
// and fails to handle returned nulls
251+
// (https://bugreports.qt.io/browse/QTBUG-49686).
252+
QWARN("Skipping WalletTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
253+
"with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build.");
254+
return;
255+
}
256+
#endif
246257
TestGUI();
247258
}

0 commit comments

Comments
 (0)