macOs: "test_bitcoin-qt -platform cocoa" no longer works #17013

issue Sjors opened this issue on October 1, 2019
  1. Sjors commented at 5:05 PM on October 1, 2019: member

    As of v0.18.1 I can use test_bitcoin-qt -platform cocoa to run GUI tests; this opens and closes a regtest GUI a bunch of times.

    As of master (6e4f6553913978fcdddba30e0bb6f97edcb12e80) it seems to ignore the -platform cocoa and just run the test as with minimal.

    As seen on macOS 10.14.6. Git bisect blames a2714a5c69f0b0506689af04c3e785f71ee0915d in #16578 Do not pass in command line arguments to QApplication (@achow101, @ryanofsky)

  2. Sjors added the label Bug on Oct 1, 2019
  3. Sjors cross-referenced this on Oct 1, 2019 from issue Do not pass in command line arguments to QApplication by achow101
  4. achow101 commented at 5:56 PM on October 1, 2019: member

    You can use the QT_QPA_PLATFORM environment variable to set that instead.

  5. MarcoFalke commented at 5:59 PM on October 1, 2019: member

    I use QT_QPA_PLATFORM=wayland and it still works just like before

  6. MarcoFalke added the label GUI on Oct 1, 2019
  7. MarcoFalke removed the label Bug on Oct 1, 2019
  8. MarcoFalke added the label Questions and Help on Oct 1, 2019
  9. MarcoFalke removed the label Questions and Help on Oct 1, 2019
  10. MarcoFalke commented at 6:00 PM on October 1, 2019: member

    Should this workaround be mentioned in the release notes?

  11. MarcoFalke added the label Needs release note on Oct 1, 2019
  12. ryanofsky commented at 6:00 PM on October 1, 2019: contributor

    For reference my earlier comment is: #16578 (comment).

    I think the easiest fix would be to update the instructions to use environment variables instead of command line arguments.

    QT_QPA_PLATFORM=xcb src/qt/test/test_bitcoin-qt
    QT_QPA_PLATFORM=windows src/qt/test/test_bitcoin-qt
    QT_QPA_PLATFORM=cocoa src/qt/test/test_bitcoin-qt
    

    I think this will just require replacing setenv with:

    if (getenv("QT_QPA_PLATFORM") == nullptr) setenv("QT_QPA_PLATFORM", "minimal", 0);
    
  13. MarcoFalke added this to the milestone 0.19.0 on Oct 1, 2019
  14. Sjors commented at 7:46 PM on October 1, 2019: member

    Using QT_QPA_PLATFORM=cocoa works for me as well. Changing the instructions (also those printed by the test_bitcoin-qt command) seems like a good solution.

  15. ryanofsky commented at 8:00 PM on October 1, 2019: contributor

    Oh, I guess checking getenv("QT_QPA_PLATFORM") == nullptr is not necessary because the setenv override argument is 0. This might be needed for the windows _putenv_s call above, though

  16. MarcoFalke cross-referenced this on Oct 1, 2019 from issue qa: Explain QT_QPA_PLATFORM for gui tests by MarcoFalke
  17. MarcoFalke removed the label Needs release note on Oct 1, 2019
  18. fanquake closed this on Oct 1, 2019

  19. laanwj cross-referenced this on Oct 18, 2019 from issue Replace #16578 with a more specific solution by laanwj
  20. humbleDasher referenced this in commit dd37d5f947 on Dec 5, 2021
  21. bitcoin locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC