Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Code coverage does not work with GHUNIT_AUTOEXIT #148

Open
dodikk opened this issue Jan 23, 2014 · 4 comments
Open

Code coverage does not work with GHUNIT_AUTOEXIT #148

dodikk opened this issue Jan 23, 2014 · 4 comments

Comments

@dodikk
Copy link

dodikk commented Jan 23, 2014

Steps :
  1. Set up coverage flags as described in https://github.com/farcaller/ios-tdd/tree/master/Coverage
  2. Apply the flush() patch https://github.com/leroymattingly/XCode5gcovPatch
  3. Set ghunit environment as shown below and run the application
    setenv("GHUNIT_AUTORUN" , "YES", 1);
    setenv("WRITE_JUNIT_XML", "YES", 1);
    setenv("GHUNIT_AUTOEXIT", "YES", 1);
Acutal result :

Coverage files not generated (CoverStory.app shows nothing)

Expected result :
Coverage files generated successfully in the "build intermediates" directory
@dodikk
Copy link
Author

dodikk commented Jan 23, 2014

When disabling GHUNIT_AUTOEXIT flag and closing the simulator using the "home button" coverage files are generated just fine

@dodikk
Copy link
Author

dodikk commented Jan 23, 2014

The patch uses a UIApplicationDidEnterBackgroundNotification notification. https://github.com/leroymattingly/XCode5gcovPatch/blob/master/UIApplication%2BGCovFlush.m

Either the notification should be fired or __gcov_flush() should be invoked on GHUNIT_AUTOEXIT condition.
Implementation approach : https://github.com/pivotal/cedar/search?q=gcov&ref=cmdform

@dodikk
Copy link
Author

dodikk commented Jan 24, 2014

Fixed in #149
Please merge

@wilsolutions
Copy link

Hi, pls, I am wondering to know when it will be merged.

tkx

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants