Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed GHUNIT_AUTOEXIT supprot for iPhone #67

Closed
wants to merge 1 commit into from

2 participants

@dodikk

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.
aad58b2
@x2on
Owner

Like to merge to https://github.com/gh-unit/gh-unit
Why is exit not working for you?

@x2on
Owner

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 authored
    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
View
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.