Skip to content

Code coverage does not work with GHUNIT_AUTOEXIT #148

dodikk opened this Issue Jan 23, 2014 · 4 comments

2 participants

dodikk commented Jan 23, 2014
Steps :
  1. Set up coverage flags as described in
  2. Apply the flush() patch
  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 ( shows nothing)

Expected result :
Coverage files generated successfully in the "build intermediates" directory
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 commented Jan 23, 2014

The patch uses a UIApplicationDidEnterBackgroundNotification notification.

Either the notification should be fired or __gcov_flush() should be invoked on GHUNIT_AUTOEXIT condition.
Implementation approach :

dodikk commented Jan 24, 2014

Fixed in #149
Please merge


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


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.