Skip to content

Commit dab0e36

Browse files
committed
Merge #17015: qa: Explain QT_QPA_PLATFORM for gui tests
fa06bb6 qa: Do not force overwrite of QT_QPA_PLATFORM on windows for gui tests (MarcoFalke) faccf5f doc: Explain QT_QPA_PLATFORM for gui tests (MarcoFalke) Pull request description: Closes #17013 ACKs for top commit: promag: ACK fa06bb6. jonasschnelli: ACK fa06bb6 ryanofsky: utACK fa06bb6 fanquake: ACK fa06bb6 - tested on macOS using `QT_QPA_PLATFORM=cocoa src/qt/test/test_bitcoin-qt`. Tree-SHA512: f257159f6e66b2df7e870ac832ae9ef09eea173c8b7cd766458f87cf22f94681c81dcc54dea030dbc97eab5e3ae5132a4ffe8a343431a4e40f7ee29dc808dcb1
2 parents 6e4f655 + fa06bb6 commit dab0e36

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/qt/test/addressbooktests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void AddressBookTests::addressBookTests()
146146
// and fails to handle returned nulls
147147
// (https://bugreports.qt.io/browse/QTBUG-49686).
148148
QWARN("Skipping AddressBookTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
149-
"with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build.");
149+
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
150150
return;
151151
}
152152
#endif

src/qt/test/apptests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void AppTests::appTests()
5757
// and fails to handle returned nulls
5858
// (https://bugreports.qt.io/browse/QTBUG-49686).
5959
QWARN("Skipping AppTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
60-
"with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build.");
60+
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
6161
return;
6262
}
6363
#endif

src/qt/test/test_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ int main(int argc, char *argv[])
6161
// platform ("xcb", "windows", or "cocoa") so tests can't unintentionally
6262
// interfere with any background GUIs and don't require extra resources.
6363
#if defined(WIN32)
64-
_putenv_s("QT_QPA_PLATFORM", "minimal");
64+
if (getenv("QT_QPA_PLATFORM") == nullptr) _putenv_s("QT_QPA_PLATFORM", "minimal");
6565
#else
66-
setenv("QT_QPA_PLATFORM", "minimal", 0);
66+
setenv("QT_QPA_PLATFORM", "minimal", /* overwrite */ 0);
6767
#endif
6868

6969
// Don't remove this, it's needed to access

src/qt/test/wallettests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, st
123123
//
124124
// This also requires overriding the default minimal Qt platform:
125125
//
126-
// src/qt/test/test_bitcoin-qt -platform xcb # Linux
127-
// src/qt/test/test_bitcoin-qt -platform windows # Windows
128-
// src/qt/test/test_bitcoin-qt -platform cocoa # macOS
126+
// QT_QPA_PLATFORM=xcb src/qt/test/test_bitcoin-qt # Linux
127+
// QT_QPA_PLATFORM=windows src/qt/test/test_bitcoin-qt # Windows
128+
// QT_QPA_PLATFORM=cocoa src/qt/test/test_bitcoin-qt # macOS
129129
void TestGUI()
130130
{
131131
// Set up wallet and chain with 105 blocks (5 mature blocks for spending).
@@ -256,7 +256,7 @@ void WalletTests::walletTests()
256256
// and fails to handle returned nulls
257257
// (https://bugreports.qt.io/browse/QTBUG-49686).
258258
QWARN("Skipping WalletTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
259-
"with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build.");
259+
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
260260
return;
261261
}
262262
#endif

0 commit comments

Comments
 (0)