Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RefCounted.unref() to manage lifetime of RefCounted objects #375

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Commits on Feb 16, 2024

  1. Add RefCounted.unref() to manage lifetime of RefCounted objects

    This calls new extension function mem_release() to decrement reference
    count and actually delete object when it goes to 0.
    pcbeard authored and pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    fca8210 View commit details
    Browse the repository at this point in the history
  2. Add libgodot system library for tests on non-macOS platforms

    pcbeard authored and pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    ba8815d View commit details
    Browse the repository at this point in the history
  3. Add resource leak tests

    pcbeard authored and pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    a512d32 View commit details
    Browse the repository at this point in the history
  4. Use object_destroy when reference count goes to 0

    This already existed in the extension functions.
    
    Rename system library to libgodot_system, for use by target
    SwiftGodotTestability.
    pcbeard authored and pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    951a729 View commit details
    Browse the repository at this point in the history
  5. Fix libgodot dependencies

    On macOS use .binaryTarget(name: "libgodot_binary") and reference with
    libgodot_dependency.
    
    On other platforms use .systemLibrary(name: "libgodot_system") and
    reference with libgodot_dependency.
    pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    30adc24 View commit details
    Browse the repository at this point in the history
  6. Remove use of autoreleasepool, which isn't cross platform

    Use local blocks instead to ensure memory is cleaned up.
    pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    3396852 View commit details
    Browse the repository at this point in the history
  7. macOS only test for now

    pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    f316ecf View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    463c15e View commit details
    Browse the repository at this point in the history
  9. Make SwiftGodotTestability available on all platforms

    Change libgodot target dependencies to "libgodot_tests" on macOS.
    pcbeard authored and pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    4050f34 View commit details
    Browse the repository at this point in the history
  10. Make .run() / .stop() public so callable from LinuxMain.swift

    Add --verbose flag to arguments array.
    pcbeard authored and pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    dfd9cb6 View commit details
    Browse the repository at this point in the history
  11. Add LinuxMain (disabled for now)

    pcbeard authored and pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    3c94928 View commit details
    Browse the repository at this point in the history
  12. Add additional extension functions

    displayserver_set_runloop sets up a callback to give time to the
    main runloop.
    
    main_iteration calls Main::iteration() to give time to the Godot
    main loop.
    pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    faf30f5 View commit details
    Browse the repository at this point in the history
  13. Add RunLoop extension to set up display server runloop callback

    Also starts a timer that calls Main::iteration() while runloop has
    control. This is needed for when XCTest blocks the runloop until
    test expectations are finished.
    pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    8154ef8 View commit details
    Browse the repository at this point in the history
  14. Call RunLoop.install() to install runloop callbacks

    Add additional runtime states.
    pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    d4863c4 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    60e49e2 View commit details
    Browse the repository at this point in the history
  16. Use _exp_unref()

    pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    90d5f9d View commit details
    Browse the repository at this point in the history
  17. Conform to the XCTRuntime protocol

    This ensures all tests are run from inside a live Godot engine.
    
    Simplify GodotTestCase
    
    Avoids the need to use platform-specific XCTest details to arrange
    for a GodotEngine to be running during tests.
    pcbeard committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    b6b0e08 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    c49b0f0 View commit details
    Browse the repository at this point in the history