diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp --- a/src/qt/test/addressbooktests.cpp +++ b/src/qt/test/addressbooktests.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -142,5 +143,18 @@ } // namespace void AddressBookTests::addressBookTests() { +#ifdef Q_OS_MAC + 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). + QWARN( + "Skipping AddressBookTests on mac build with 'minimal' platform " + "set due to Qt bugs. To run AppTests, invoke with 'test_bitcoin-qt " + "-platform cocoa' on mac, or else use a linux or windows build."); + return; + } +#endif TestAddAddressesToSendBook(); } diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -101,20 +101,6 @@ // src/qt/test/test_bitcoin-qt -platform windows # Windows // src/qt/test/test_bitcoin-qt -platform cocoa # macOS void TestGUI() { -#ifdef Q_OS_MAC - 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). - QWARN("Skipping WalletTests on mac build with 'minimal' platform set " - "due to Qt bugs. To run AppTests, invoke " - "with 'test_bitcoin-qt -platform cocoa' on mac, or else use a " - "linux or windows build."); - return; - } -#endif - // Set up wallet and chain with 105 blocks (5 mature blocks for spending). TestChain100Setup test; for (int i = 0; i < 5; ++i) { @@ -244,5 +230,17 @@ } // namespace void WalletTests::walletTests() { +#ifdef Q_OS_MAC + 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). + QWARN("Skipping WalletTests on mac build with 'minimal' platform set " + "due to Qt bugs. To run AppTests, invoke with 'test_bitcoin-qt " + "-platform cocoa' on mac, or else use a linux or windows build."); + return; + } +#endif TestGUI(); }