Latest 0.8.0
Homepage https://github.com/haifengkao/LeakCanaryiOS
License MIT
Platforms ios 7.0, requires ARC
Authors

CI Status
Coverage Status
Version
License
Platform

Do you want to know if there is a memory leak in your XCTest?
This is the tool for you.

Motivated by Leak Canary and HeapInspector.

Usage

Add the follow codes to your test case

- (void)setUp
{
    [LeakCanary beginSnapShot:@[@"UIView"]];
}

- (void)tearDown
{
    NSSet* leakedObjects = [LeakCanary endSnapShot];
    XCTAssertTrue(leakedObjects.count == 0, @"should not have leaked UIView and UIViewController objects");
}

If you use Kiwi

#import <LeakCanary/LeakCanary.h>
#import <Kiwi/Kiwi.h>

beforeEach(^{
    [LeakCanary beginSnapShot:@[@"UIView"]];
});
afterEach(^{
    NSSet* leakedObjects = [LeakCanary endSnapShot];
    [[@(leakedObjects.count) should] equal:@(0)];
});

Requirements

Installation

LeakCanaryiOS is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "LeakCanaryiOS"

Author

Hai Feng Kao, [email protected]

License

LeakCanaryiOS is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LeakCanaryiOS",
    "version": "0.8.0",
    "summary": "Memory leak detection in iOS unit test cases",
    "description": "Memory leak detection in XCTest, no problem!",
    "homepage": "https://github.com/haifengkao/LeakCanaryiOS",
    "license": "MIT",
    "authors": {
        "Hai Feng Kao": "[email protected]"
    },
    "source": {
        "git": "https://github.com/haifengkao/LeakCanaryiOS.git",
        "tag": "0.8.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "exclude_files": "Pod/Classes/NSObject+HeapInspector.{h,m}",
    "subspecs": [
        {
            "name": "no-arc",
            "requires_arc": false,
            "source_files": "Pod/Classes/NSObject+HeapInspector.{h,m}"
        }
    ]
}

Pin It on Pinterest

Share This