qt, test: Run GUI tests on macOS with `minimal` QPA plugin #950

pull hebasto wants to merge 2 commits into bitcoin-core:master from hebasto:260720-macos-minimal changing 4 files +4 −36
  1. hebasto commented at 2:32 PM on July 20, 2026: member

    On macOS, test_bitcoin-qt has skipped AppTests, WalletTests, and AddressBookTests under the minimal QPA plugin since https://github.com/bitcoin/bitcoin/commit/a3197c5294df4711bab0ff6dcdd061ceab115c7d (2018, Qt 5.11), pointing to QTBUG-49686.

    The recent re-evaluation of the Bitcoin Core codebase showed that the Qt bug report is no longer relevant. The remaining causes were in our own code, and they are fixed in the first commit.

  2. qt: Avoid implicit `NSApplication` instantiation
    `[NSApplication sharedApplication]` creates the shared application
    object if it does not yet exist. When running with the `minimal` or
    `offscreen` QPA plugins, which is common for testing purposes, the Cocoa
    platform plugin never creates it, so these call sites were instantiating
    `NSApplication` as a side effect.
    
    Use the `NSApp` global instead and return early when it is `nil`.
    c8b2aeb226
  3. qt, test: Enable tests on macOS with `minimal` QPA plugin
    The crash source, implicit `NSApplication` instantiation with a
    non-Cocoa QPA plugin, was fixed in the previous commit.
    fd59d68c26
  4. DrahtBot commented at 2:32 PM on July 20, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK maflcko, pablomartin4btc

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. maflcko commented at 3:00 PM on July 20, 2026: contributor

    lgtm ACK fd59d68c2629440e544ffa6c9a96b4252ebf45c3

  6. pablomartin4btc commented at 7:15 PM on July 20, 2026: contributor

    tACK fd59d68c2629440e544ffa6c9a96b4252ebf45c3

    I recently ran into this when writing tests for addressbooktests.cpp in #945 — they had to be run on Linux because they were skipped on macOS.

    Tested locally — AppTests, WalletTests, and AddressBookTests now run with QT_QPA_PLATFORM=minimal on macOS.

    From the macOS native CI logs, test_bitcoin-qt runs and passes but it's unclear whether those three test classes were previously being skipped or actually executing.

  7. hebasto commented at 8:18 PM on July 20, 2026: member

    From the macOS native CI logs, test_bitcoin-qt runs and passes but it's unclear whether those three test classes were previously being skipped or actually executing.

    For the tests run by the ctest driver, you can use the --verbose option:

    ctest --test-dir build_dev_mode -R bitcoin-qt --verbose
    
  8. hebasto merged this on Jul 20, 2026
  9. hebasto closed this on Jul 20, 2026

  10. fanquake commented at 10:58 AM on July 22, 2026: member

    After this change the tests segfault if you build using depends: https://github.com/bitcoin/bitcoin/issues/35771.

  11. maflcko commented at 12:02 PM on July 22, 2026: contributor

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-26 01:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me