Skip to content
Snippets Groups Projects

pv-wrap: Store more state in the PvWrapContext

Merged Simon McVittie requested to merge wip/task595-more-in-context into main

Further work towards steamrt/tasks#595. Based on !783 (merged), and I don't know would it will be possible to rebase it to be independent.

/cc @denittis @refi64


  • pv-wrap: Store the real or mock root directory in the PvWrapContext

    This makes no practical difference yet, but we can use this for more consistent handling of a mock root directory for unit-testing in future.

  • pv-wrap: Make it more obvious that we're using the environment read-only

    We're just looking at this, not altering it (not that we would be able to alter it with correct memory management under this calling convention, but that isn't necessarily immediately obvious to a reader).

  • tests: Store the mock environment in PvWrapContext instead of duplicating

    This makes the tests a little bit closer to reality.

  • pv-wrap: Use the PvWrapContext to inspect the original environment

    This keeps more of the things we have to mock for unit testing together, avoiding needing to thread a copy of the environment through the LD_PRELOAD setup code.

  • PvWrapContext: Store the PvRuntime in here

    This lets us pass it to various functions as one parameter rather than two.

  • pv-wrap: Take "remove game overlay" option from PvWrapContext

    It's slightly simpler without duplicating 1 bit of information like this.

  • pv-wrap: Store FlatpakExports in the PvWrapContext

    This means we don't have to thread it through so much of wrap-setup as an explicit function parameter.

  • pv-wrap: Store the home directory in the PvWrapContext

    This can be used to set a mock home directory for unit testing, which we now do in the wrap-setup test (although it isn't used for anything yet).

Edited by Simon McVittie

Merge request reports

Pipeline #116989 passed

Pipeline passed for 2ad3a246 on wip/task595-more-in-context

Merged by Simon McVittieSimon McVittie 2 months ago (Feb 12, 2025 3:04pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading