Skip to content

Instantly share code, notes, and snippets.

@wooster
Last active December 10, 2015 06:18

Revisions

  1. wooster revised this gist Dec 28, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion coverage.md
    Original file line number Diff line number Diff line change
    @@ -13,4 +13,4 @@ It's best to create this in a new build configuration. Run your app in the simul

    Afterwards, the files will be in something like "build/$target/$project.build/Debug-iphonesimulator/$target.build/Objects-normal/i386/".

    You can open this directory in [Cover Story](http://code.google.com/p/coverstory/), but may need to apply the patch in [issue 39](http://code.google.com/p/coverstory/issues/detail?id=39).
    You can open this directory in [Cover Story](http://code.google.com/p/coverstory/), but if your project has a lot of files you may need to apply the patch in [issue 39](http://code.google.com/p/coverstory/issues/detail?id=39).
  2. wooster created this gist Dec 28, 2012.
    16 changes: 16 additions & 0 deletions coverage.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    In Xcode 4.5 with LLVM, to enable code coverage on a project:

    * Set "Instrument Program Flow" and "Generate Test Coverage Files" to Yes in the Build Settings.
    * You'll want to have the program properly exit in order to generate the files. A simple way is:

    ```objc
    - (void)applicationDidEnterBackground:(UIApplication *)application {
    exit(0);
    }
    ```

    It's best to create this in a new build configuration. Run your app in the simulator and hit the Home button to have the right files generated.

    Afterwards, the files will be in something like "build/$target/$project.build/Debug-iphonesimulator/$target.build/Objects-normal/i386/".

    You can open this directory in [Cover Story](http://code.google.com/p/coverstory/), but may need to apply the patch in [issue 39](http://code.google.com/p/coverstory/issues/detail?id=39).