Dynamically creates a launch agent to facilitate testing #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A launch agent running as a completely separate process is now created, registered (load) with
launchd
, and can be communicated with. This allows for testing shared memory functionality in a separate process.Cleanup logic also exists to unload the agent and delete all of the created files. However, the paths and service name are all randomly generated, so nothing bad ought to happen if cleanup fails (for example because a test fails).
Building SecureXPC from scratch takes a long time, so the code has been written in such a way that people using this framework can provide a path to the pre-built module - this will speed things up about 25x.
For reference, these were helpful resources in figuring out how to use
swiftc
: