Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fixed GHUNIT_AUTOEXIT supprot for iPhone #67

wants to merge 1 commit into from

2 participants


exit() does not seem to work for me.
Switched to exceptions for better continuous integration experience.

oleksandr dodatko Used exceptions approach to GHUNIT_AUTOEXIT handling.
exit() does not seem to work for me.

Like to merge to
Why is exit not working for you?


During no activity i close this issue now.
If this issue still exists - feel free to reopen this issue.

@x2on x2on closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 26, 2011
  1. Used exceptions approach to GHUNIT_AUTOEXIT handling.

    oleksandr dodatko committed
    exit() does not seem to work for me.
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 3 deletions.
  1. +11 −3 Classes-IPhone/GHUnitIPhoneViewController.m
14 Classes-IPhone/GHUnitIPhoneViewController.m
@@ -275,9 +275,17 @@ - (void)testRunnerDidEnd:(GHTestRunner *)runner {
// Save defaults after test run
[self saveDefaults];
- if (getenv("GHUNIT_AUTOEXIT")) {
- NSLog(@"Exiting (GHUNIT_AUTOEXIT)");
- exit(runner.test.stats.failureCount);
+ if (getenv("GHUNIT_AUTOEXIT"))
+ {
+ NSNumber* failures_count_ = [ NSNumber numberWithInt: runner.test.stats.failureCount ];
+ NSDictionary* user_info_ = [ NSDictionary dictionaryWithObject: failures_count_
+ forKey: @"failed tests count" ];
+ NSLog(@"Exiting (GHUNIT_AUTOEXIT)");
+ NSException* exception_ = [ NSException exceptionWithName: @"autoexit exception"
+ reason: @"tests launched successfully"
+ userInfo: user_info_ ];
+ @throw exception_;
Something went wrong with that request. Please try again.