This is a simple tool to help you checking for leaks in your program automatically in the most accurate way, then it will send the report directly to your development workflow (Pull request/Slack/...). And even better, you can easily integrate this tool to your CI workflow.
- Installation
- Usage
- Current supported testing frameworks
- How?
- How to support your testing framework
- Publication
You can go to GitHub Releases page to download release executable program.
The most simple way to run the leaks checking process is:
leaksdetector $subcommand -p $YOUR_APP_NAMECheck out this document for how to use specific subcommands
Check out this document for how to customize the process to send the result to your workflow
- I need a testing tool which doesn't kill the program after the testing finished execution. And Maestro support that. Also Maestro is very easy to integrate & use.
- XCUITest can not preserve running program after test execution on Simulator. Read more at here. However, Xcode support generate memgraph file for XCUITest when running test on real device => XCUITest is a great match for company uses real device farm for testing.
-
Use a testing tool to simulate the UI flow in your app.
-
Generate
memgraphusingleakstool provided by Apple.
Find more aboutleakstool andmemgraphhere -
Use
leaksdetectorprogram to proceed thememgraphfile. If any leaks founded, it will use Danger to post a message to your PR/slack, ...
If you're using another UI testing framework which also support preserve the execution of the program after finish testing, you can create another PR to update the leaksdetector.
It's easy to do that, just need to follow these steps:
- Open
Executor.swift, create a new instance of your testing frameworks. Your new instance needs to conform toExecutorprotocol.
struct XCUITestExecutor: Executor {
func simulateUI() throws {
// Custom logic to start simulating UI
}
func generateMemgraph(for processName: String) throws {
// Custom logic to start generating memgraph for a `processName`
}
func memgraphPaths() -> [String]
// return the path to the generated memgraphs
}
}
- Go to
Commandsfolder to create a new command for your testing framework. Please refer toMaestroCommand.
I've published an article about this on Medium. You can take a look at here
