Permalink
Browse files

Updating project files. Using a new setup that mirror how RestKit wor…

…ks. Updating some docs.
  • Loading branch information...
1 parent f8622f0 commit 12cec0760206a01d73bf3376ce554c03ab95c14a @gabriel committed Apr 29, 2012
Showing with 3,197 additions and 8,630 deletions.
  1. +1 −0 Classes/GHKitIOS.h
  2. BIN Frameworks/GHUnit.framework/Versions/A/GHUnit
  3. +0 −47 Frameworks/GHUnit.framework/Versions/A/Headers/BWSplitView.h
  4. +15 −6 Frameworks/GHUnit.framework/Versions/A/Headers/GHAsyncTestCase.h
  5. +4 −0 Frameworks/GHUnit.framework/Versions/A/Headers/GHMockNSHTTPURLResponse.h
  6. +11 −0 Frameworks/GHUnit.framework/Versions/A/Headers/GHMockNSURLConnection.h
  7. +0 −132 Frameworks/GHUnit.framework/Versions/A/Headers/GHNSInvocation+Utils.h
  8. +0 −133 Frameworks/GHUnit.framework/Versions/A/Headers/GHNSInvocationProxy.h
  9. +7 −1 Frameworks/GHUnit.framework/Versions/A/Headers/GHNSLocale+Mock.h
  10. +0 −100 Frameworks/GHUnit.framework/Versions/A/Headers/GHNSObject+Invocation.h
  11. +5 −1 Frameworks/GHUnit.framework/Versions/A/Headers/GHTest+JUnitXML.h
  12. +7 −1 Frameworks/GHUnit.framework/Versions/A/Headers/GHTest.h
  13. +7 −2 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestCase.h
  14. +5 −1 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestGroup+JUnitXML.h
  15. +25 −0 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestGroup.h
  16. +228 −227 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestMacros.h
  17. +5 −1 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestOperation.h
  18. +2 −0 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestOutlineViewModel.h
  19. +3 −0 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestRunner.h
  20. +4 −0 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestSuite.h
  21. +6 −3 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestViewController.h
  22. +7 −1 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestViewModel.h
  23. +7 −0 Frameworks/GHUnit.framework/Versions/A/Headers/GHTesting.h
  24. +0 −36 Frameworks/GHUnit.framework/Versions/A/Headers/GHUNSObject+Swizzle.h
  25. +579 −1 Frameworks/GHUnit.framework/Versions/A/Headers/GHUnit.h
  26. +0 −105 Frameworks/GHUnit.framework/Versions/A/Headers/GTMStackTrace.h
  27. +11 −2 Frameworks/GHUnit.framework/Versions/A/Headers/NSException+GHTestFailureExceptions.h
  28. +5 −1 Frameworks/GHUnit.framework/Versions/A/Headers/NSValue+GHValueFormatter.h
  29. BIN Frameworks/GHUnit.framework/Versions/A/Resources/English.lproj/InfoPlist.strings
  30. BIN Frameworks/GHUnit.framework/Versions/A/Resources/GHTestApp.nib
  31. BIN Frameworks/GHUnit.framework/Versions/A/Resources/GHTestView.nib
  32. BIN Frameworks/GHUnit.framework/Versions/A/Resources/GHTestWindow.nib
  33. +0 −4 Frameworks/GHUnit.framework/Versions/A/Resources/GHUnit-Debug.xcconfig
  34. +0 −15 Frameworks/GHUnit.framework/Versions/A/Resources/GHUnit.xcconfig
  35. BIN Frameworks/GHUnit.framework/Versions/A/Resources/GradientSplitViewDimpleBitmap.tif
  36. BIN Frameworks/GHUnit.framework/Versions/A/Resources/GradientSplitViewDimpleVector.pdf
  37. +22 −2 Frameworks/GHUnit.framework/Versions/A/Resources/Info.plist
  38. 0 ...cOSX/English.lproj → Frameworks/GHUnit.framework/Versions/A/Resources/en.lproj}/InfoPlist.strings
  39. BIN Frameworks/GHUnitIOS.framework/Versions/A/GHUnitIOS
  40. +52 −44 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHAsyncTestCase.h
  41. +16 −8 ...nitIOSTableViewDataSource.h → Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHImageDiffView.h
  42. +1 −1 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTest+JUnitXML.h
  43. +100 −13 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTest.h
  44. +49 −43 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTestCase.h
  45. +23 −12 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup.h
  46. +54 −19 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTestMacros.h
  47. +5 −4 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTestOperation.h
  48. +77 −18 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTestRunner.h
  49. +3 −3 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTestSuite.h
  50. +58 −9 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTestViewModel.h
  51. +14 −7 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHTesting.h
  52. +1 −574 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHUnit.h
  53. +3 −0 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSAppDelegate.h
  54. +3 −0 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTableViewDataSource.h
  55. +25 −21 ...A/Headers/GHUnitIOSView.h → Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTestView.h
  56. +8 −2 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTestViewController.h
  57. +3 −1 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSView.h
  58. +5 −3 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSViewController.h
  59. +124 −0 Frameworks/GHUnitIOS.framework/Versions/A/Headers/GHViewTestCase.h
  60. +1,533 −0 GHKit.xcodeproj/project.pbxproj
  61. 0 {Project-MacOSX → }/GHKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  62. +7 −5 Project-MacOSX/Info.plist → GHKitFramework-Info.plist
  63. +0 −77 Libraries/GTM/Foundation/GTMGarbageCollection.h
  64. +0 −51 Libraries/GTM/Foundation/GTMNSString+XML.h
  65. +0 −182 Libraries/GTM/Foundation/GTMNSString+XML.m
  66. +0 −105 Libraries/GTM/Foundation/GTMObjC2Runtime.h
  67. +0 −156 Libraries/GTM/Foundation/GTMObjC2Runtime.m
  68. +0 −105 Libraries/GTM/Foundation/GTMStackTrace.h
  69. +0 −379 Libraries/GTM/Foundation/GTMStackTrace.m
  70. +2 −3 Makefile
  71. BIN Project-MacOSX/GHKit.xcodeproj/TemplateIcon.icns
  72. +0 −1,037 Project-MacOSX/GHKit.xcodeproj/project.pbxproj
  73. +0 −10 Project-MacOSX/GHKitTests_Prefix.pch
  74. +0 −7 Project-MacOSX/GHKit_Prefix.pch
  75. +0 −12 Project-MacOSX/Makefile
  76. +0 −18 Project-iOS/FrameworkIOS.plist
  77. +0 −7 Project-iOS/GHKitIOS-Prefix.pch
  78. +0 −1,218 Project-iOS/GHKitIOS.xcodeproj/project.pbxproj
  79. +0 −7 Project-iOS/GHKitIOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  80. +0 −1 Project-iOS/GHUnitIOS.framework/GHUnitIOS
  81. +0 −1 Project-iOS/GHUnitIOS.framework/Headers
  82. +0 −1 Project-iOS/GHUnitIOS.framework/Resources
  83. BIN Project-iOS/GHUnitIOS.framework/Versions/A/GHUnitIOS
  84. +0 −155 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHAsyncTestCase.h
  85. +0 −44 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTest+JUnitXML.h
  86. +0 −187 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTest.h
  87. +0 −146 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTestCase.h
  88. +0 −42 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup+JUnitXML.h
  89. +0 −176 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup.h
  90. +0 −1,014 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTestMacros.h
  91. +0 −46 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTestOperation.h
  92. +0 −162 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTestRunner.h
  93. +0 −118 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTestSuite.h
  94. +0 −169 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTestViewModel.h
  95. +0 −151 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHTesting.h
  96. +0 −629 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHUnit.h
  97. +0 −39 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSAppDelegate.h
  98. +0 −43 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTestViewController.h
  99. +0 −71 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSViewController.h
  100. +0 −36 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneAppDelegate.h
  101. +0 −97 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/NSException+GHTestFailureExceptions.h
  102. +0 −71 Project-iOS/GHUnitIOS.framework/Versions/A/Headers/NSValue+GHValueFormatter.h
  103. +0 −18 Project-iOS/GHUnitIOS.framework/Versions/A/Resources/Info.plist
  104. +0 −1 Project-iOS/GHUnitIOS.framework/Versions/Current
  105. +0 −15 Project-iOS/Makefile
  106. +0 −30 Project-iOS/Scripts/CombineLibs.sh
  107. +0 −75 Project-iOS/Scripts/iOSFramework.sh
  108. +0 −2 Project-iOS/Tests/en.lproj/InfoPlist.strings
  109. +0 −17 Project-iOS/Tests/main.m
  110. +23 −29 README.md
  111. 0 {Libraries/GTM/Foundation → Tests/GTM}/GTMBase64.h
  112. 0 {Libraries/GTM/Foundation → Tests/GTM}/GTMBase64.m
  113. 0 {Libraries → Tests}/GTM/GTMDefines.h
  114. 0 {Libraries/GTM/Foundation → Tests/GTM}/GTMRegex.h
  115. 0 {Libraries/GTM/Foundation → Tests/GTM}/GTMRegex.m
  116. +0 −20 Tests/NSString+Base64Test.m
  117. 0 {Libraries → Tests}/SFHF/SFHFKeychainUtils.h
  118. 0 {Libraries → Tests}/SFHF/SFHFKeychainUtils.m
  119. +4 −2 {Project-iOS → }/Tests/Tests-Info.plist
  120. +1 −1 {Project-iOS → }/Tests/Tests-Prefix.pch
  121. +16 −0 Tests/main.m
  122. 0 {Libraries → TestsFramework}/ExtendMac/EMKeychainItem.h
  123. 0 {Libraries → TestsFramework}/ExtendMac/EMKeychainItem.m
  124. 0 {Libraries → TestsFramework}/ExtendMac/EMKeychainProxy.h
  125. 0 {Libraries → TestsFramework}/ExtendMac/EMKeychainProxy.m
  126. 0 {Tests/MacOSX → TestsFramework}/GHNSAttributedStringTest.m
  127. +13 −5 Project-MacOSX/GHKitTests-Info.plist → TestsFramework/TestsFramework-Info.plist
  128. +8 −0 TestsFramework/TestsFramework-Prefix.pch
  129. 0 Tests/MacOSX/GHUnitTestMain.m → TestsFramework/main.m
  130. +0 −4 XCConfig/Debug-MacOSX.xcconfig
  131. +0 −4 XCConfig/Debug-iOS.xcconfig
  132. +0 −9 XCConfig/Shared-MacOSX.xcconfig
  133. +0 −8 XCConfig/Shared-iOS.xcconfig
  134. +0 −8 XCConfig/Shared.xcconfig
View
1 Classes/GHKitIOS.h
@@ -1,2 +1,3 @@
+// Deprecated; Just imports "GHKit.h"
#import "GHKit.h"
View
BIN Frameworks/GHUnit.framework/Versions/A/GHUnit
Binary file not shown.
View
47 Frameworks/GHUnit.framework/Versions/A/Headers/BWSplitView.h
@@ -1,47 +0,0 @@
-//
-// BWSplitView.h
-// BWToolkit
-//
-// Created by Brandon Walkin (www.brandonwalkin.com) and Fraser Kuyvenhoven.
-// All code is provided under the New BSD license.
-//
-
-#import <Cocoa/Cocoa.h>
-
-@interface BWSplitView : NSSplitView
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 // on lines like this to not confuse IB
- <NSSplitViewDelegate>
-#endif
-{
- NSColor *color;
- BOOL colorIsEnabled, checkboxIsEnabled, dividerCanCollapse, collapsibleSubviewCollapsed;
- id secondaryDelegate;
- NSMutableDictionary *minValues, *maxValues, *minUnits, *maxUnits;
- NSMutableDictionary *resizableSubviewPreferredProportion, *nonresizableSubviewPreferredSize;
- NSArray *stateForLastPreferredCalculations;
- int collapsiblePopupSelection;
- float uncollapsedSize;
-
- // Collapse button
- NSButton *toggleCollapseButton;
- BOOL isAnimating;
-}
-
-@property (retain) NSMutableDictionary *minValues, *maxValues, *minUnits, *maxUnits;
-@property (retain) NSMutableDictionary *resizableSubviewPreferredProportion, *nonresizableSubviewPreferredSize;
-@property (retain) NSArray *stateForLastPreferredCalculations;
-@property (retain) NSButton *toggleCollapseButton;
-@property BOOL collapsibleSubviewCollapsed;
-@property int collapsiblePopupSelection;
-@property BOOL dividerCanCollapse;
-
-// The split view divider color
-@property (copy) NSColor *color;
-
-// Flag for whether a custom divider color is enabled. If not, the standard divider color is used.
-@property BOOL colorIsEnabled;
-
-// Call this method to collapse or expand a subview configured as collapsible in the IB inspector.
-- (IBAction)toggleCollapse:(id)sender;
-
-@end
View
21 Frameworks/GHUnit.framework/Versions/A/Headers/GHAsyncTestCase.h
@@ -31,10 +31,10 @@
// Some default statuses to use; Or define and use your own
enum {
- kGHUnitWaitStatusUnknown = 0,
- kGHUnitWaitStatusSuccess,
- kGHUnitWaitStatusFailure,
- kGHUnitWaitStatusCancelled
+ kGHUnitWaitStatusUnknown = 0, //!< Unknown wait status
+ kGHUnitWaitStatusSuccess, //!< Wait status success
+ kGHUnitWaitStatusFailure, //!< Wait status failure
+ kGHUnitWaitStatusCancelled //!< Wait status cancelled
};
/*!
@@ -46,6 +46,12 @@ enum {
Be sure to call prepare before the asynchronous method (otherwise an exception will raise).
@code
+
+ @interface MyAsyncTest : GHAsyncTestCase { }
+ @end
+
+ @implementation MyAsyncTest
+
- (void)testSuccess {
[self prepare];
@@ -61,6 +67,8 @@ enum {
// To ignore the check, forSelector can be NULL.
[self notify:kGHUnitWaitStatusSuccess forSelector:@selector(testSuccess)];
}
+
+ @end
@endcode
*/
@interface GHAsyncTestCase : GHTestCase {
@@ -88,7 +96,6 @@ enum {
/*!
Prepare and specify the selector we will use in notify.
-
@param selector
*/
- (void)prepare:(SEL)selector;
@@ -112,7 +119,9 @@ enum {
*/
- (void)waitForStatus:(NSInteger)status timeout:(NSTimeInterval)timeout;
-// Deprecated
+/*!
+ @deprecated
+ */
- (void)waitFor:(NSInteger)status timeout:(NSTimeInterval)timeout;
/*!
View
4 Frameworks/GHUnit.framework/Versions/A/Headers/GHMockNSHTTPURLResponse.h
@@ -27,6 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
#import <Foundation/Foundation.h>
/*!
@@ -44,3 +46,5 @@
- (void)setHeaders:(NSDictionary *)headers;
@end
+
+//! @endcond
View
11 Frameworks/GHUnit.framework/Versions/A/Headers/GHMockNSURLConnection.h
@@ -27,6 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
#import <Foundation/Foundation.h>
extern NSString *const GHMockNSURLConnectionException;
@@ -115,6 +117,13 @@ extern NSString *const GHMockNSURLConnectionException;
*/
- (void)receiveData:(NSData *)data afterDelay:(NSTimeInterval)delay;
+/*!
+ Send data to connection delegate.
+ @param data Data to send
+ @param statusCode HTTP status code
+ @param MIMEType Mime type
+ @param afterDelay Delay
+ */
- (void)receiveData:(NSData *)data statusCode:(NSInteger)statusCode MIMEType:(NSString *)MIMEType afterDelay:(NSTimeInterval)delay;
/*!
@@ -160,3 +169,5 @@ extern NSString *const GHMockNSURLConnectionException;
- (void)failWithError:(NSError *)error afterDelay:(NSTimeInterval)delay;
@end
+
+//! @endcond
View
132 Frameworks/GHUnit.framework/Versions/A/Headers/GHNSInvocation+Utils.h
@@ -1,132 +0,0 @@
-//
-// GHNSInvocation+Utils.h
-// GHKit
-//
-// Created by Gabriel Handford on 1/17/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <Foundation/Foundation.h>
-
-//
-// Creates arguments NSArray from var args, with first object named 'object'
-// - (void)methodName:(id)arg1 withObjects:object, ...
-//
-#define GHConvertVarArgs(object) \
-NSMutableArray *arguments = [NSMutableArray array]; \
-do { \
-id arg; \
-va_list args; \
-if (object) { \
-[arguments addObject:object]; \
-va_start(args, object); \
-while ((arg = va_arg(args, id))) \
-[arguments addObject:arg]; \
-va_end(args); \
-} \
-} while(0);
-
-@interface NSInvocation (GHUtils_GHUNIT)
-
-/*!
- Invoke on main thread.
- @param waitUntilDone Whether to join on the call
- */
-- (void)ghu_invokeOnMainThread:(BOOL)waitUntilDone;
-
-/*!
- Invoke target selector with multiple arguments.
- @param target Invocation target
- @param selector Method
- @param withObjects (Variable) Arguments list
- */
-+ (id)ghu_invokeWithTarget:(id)target selector:(SEL)selector withObjects:object, ...;
-
-/*!
- Invoke target selector with multiple arguments.
- @param target Invocation target
- @param selector Method
- @param arguments Arguments list
- */
-+ (id)ghu_invokeWithTarget:(id)target selector:(SEL)selector arguments:(NSArray *)arguments;
-
-/*!
- Invoke target selector with multiple arguments.
- @param target Invocation target
- @param selector Method
- @param afterDelay Time interval for delay (in seconds)
- @param arguments Arguments list
- */
-+ (id)ghu_invokeWithTarget:(id)target selector:(SEL)selector afterDelay:(NSTimeInterval)delay arguments:(NSArray *)arguments;
-
-/*!
- Invoke target selector on main thread with multiple arguments.
- Use [NSNull null] for nil arguments.
- @param target Target
- @param selector Action
- @param waitUntilDone Whether to wait for call to finish
- @param withObjects Nil terminated list of (object) arguments; Use [NSNull null] for nil arguments
- */
-+ (void)ghu_invokeTargetOnMainThread:(id)target selector:(SEL)selector waitUntilDone:(BOOL)waitUntilDone withObjects:object, ...;
-
-/*!
- Invoke target selector on main thread with multiple arguments.
- @param target Target
- @param selector Action
- @param waitUntilDone Whether to wait for call to finish
- @param arguments Arguments list
- */
-+ (void)ghu_invokeTargetOnMainThread:(id)target selector:(SEL)selector waitUntilDone:(BOOL)waitUntilDone arguments:(NSArray *)arguments;
-
-/*!
-Invoke target selector on main thread with multiple arguments.
- @param target Target
- @param selector Action
- @param waitUntilDone Whether to wait for call to finish
- @param afterDelay Time interval for delay (in seconds)
- @param arguments Arguments list
- */
-+ (void)ghu_invokeTargetOnMainThread:(id)target selector:(SEL)selector waitUntilDone:(BOOL)waitUntilDone afterDelay:(NSTimeInterval)delay arguments:(NSArray *)arguments;
-
-/*!
- Create invocation with variable arguments.
- Use [NSNull null] for nil arguments.
- @param target Invocation target
- @param selector Method
- @param hasReturnValue Will be set to YES, if there is a return value
- @param withObjects (Variable) Arguments list
- */
-+ (NSInvocation *)ghu_invocationWithTarget:(id)target selector:(SEL)selector hasReturnValue:(BOOL *)hasReturnValue withObjects:object, ...;
-
-/*!
- Create invocation with variable arguments.
- Use [NSNull null] for nil arguments.
- @param target Invocation target
- @param selector Method
- @param hasReturnValue Will be set to YES, if there is a return value
- @param arguments Arguments array
- */
-+ (NSInvocation *)ghu_invocationWithTarget:target selector:(SEL)selector hasReturnValue:(BOOL *)hasReturnValue arguments:(NSArray *)arguments;
-
-@end
View
133 Frameworks/GHUnit.framework/Versions/A/Headers/GHNSInvocationProxy.h
@@ -1,133 +0,0 @@
-//
-// GHNSInvocationProxy_GHUNIT.h
-// GHKit
-//
-// Modified by Gabriel Handford on 5/9/09.
-// This class is based on DDInvocationGrabber.
-//
-
-/*
- * Copyright (c) 2007-2009 Dave Dribin
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-
-/*
- * This class is based on CInvocationGrabber:
- *
- * Copyright (c) 2007, Toxic Software
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of the Toxic Software nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/*!
- Proxy that allows invocation on a separate thread, or with a delay.
-
- Use with the GHNSObject+Invocation category:
-
- @code
- NSMutableArray *array = ...;
- // Adds object to array after 5 seconds
- [[array ghu_proxyAfterDelay:5.0] addObject:@"test"];
-
-
- NSThread *thread = ...
- // Remove all objects from another thread
- [[array ghu_proxyOnThread:thread waitUntilDone:NO] removeAllObjects];
- @endcode
-
- Create invocation proxy for a NSMutableArray.
-
- @code
- NSMutableArray *array = ...;
- NSThread *thread = ...
-
- GHNSInvocationProxy_GHUNIT *arrayProxy = [GHNSInvocationProxy_GHUNIT invocation];
- arrayProxy.target = array;
- arrayProxy.thread = thread;
- arrayProxy.waitUntilDone = NO;
-
- // Performs method on thread and doesn't wait for return
- [arrayProxy addObject:@"test"];
- @endcode
- */
-@interface GHNSInvocationProxy_GHUNIT : NSProxy {
-
- id target_;
-
- NSThread *thread_;
- BOOL waitUntilDone_;
- NSTimeInterval delay_;
-
- // If debuging time to set
- NSTimeInterval *time_;
-
- NSInvocation *invocation_;
-}
-
-@property (retain, nonatomic) id target;
-@property (retain, nonatomic) NSInvocation *invocation;
-@property (retain, nonatomic) NSThread *thread;
-@property (assign, nonatomic) BOOL waitUntilDone;
-@property (assign, nonatomic) NSTimeInterval delay;
-@property (assign, nonatomic) NSTimeInterval *time;
-
-/*!
- Create autoreleased empty invocation proxy.
- @result Invocation proxy
- */
-+ (id)invocation;
-
-/*!
- Create invocation proxy with target.
- @param target
- @result Invocation proxy
- */
-- (id)prepareWithInvocationTarget:(id)target;
-
-@end
View
8 Frameworks/GHUnit.framework/Versions/A/Headers/GHNSLocale+Mock.h
@@ -27,6 +27,10 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
+#import <Foundation/Foundation.h>
+
/*!
Category for overriding the current locale at runtime.
@@ -38,7 +42,7 @@
[[NSLocale currentLocale] localeIdentifier] == "en_GB"
@endcode
*/
-@interface NSLocale (GHMock)
+@interface NSLocale(GHMock)
+ (void)gh_setLocaleIdentifier:(NSString *)localeIdentifier;
@@ -57,3 +61,5 @@
+ (NSArray *)gh_preferredLanguages;
@end
+
+//! @endcond
View
100 Frameworks/GHUnit.framework/Versions/A/Headers/GHNSObject+Invocation.h
@@ -1,100 +0,0 @@
-//
-// GHNSObject+Invocation.h
-// GHKit
-//
-// Created by Gabriel Handford on 1/18/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "GHNSInvocation+Utils.h"
-#import "GHNSInvocationProxy.h"
-
-/*!
- Adds performSelector methods that take a nil-terminated variable argument list,
- for when you need to pass more arguments to performSelector.
- */
-@interface NSObject (GHInvocation_GHUNIT)
-
-/*!
- Perform selector if responds.
- @param selector
- @result nil if we don't respond to the selector, otherwise the selector result
- */
-- (id)ghu_performIfRespondsToSelector:(SEL)selector;
-
-/*!
- Perform selector if responds with multiple arguments.
- @param selector
- @param withObjects nil terminated variable argument list
- @result nil if we don't respond to the selector, otherwise the selector result
- */
-- (id)ghu_performIfRespondsToSelector:(SEL)selector withObjects:object, ...;
-
-/*!
- Invoke selector with arguments.
- @param selector
- @param withObjects nil terminated variable argument list
- */
-- (id)ghu_performSelector:(SEL)selector withObjects:object, ...;
-
-- (id)ghu_performSelector:(SEL)selector afterDelay:(NSTimeInterval)delay withObjects:object, ...;
-
-/*!
- Invoke selector with arguments on main thread.
- Does not wait until selector is finished.
- @param selector
- @param withObjects nil terminated variable argument list
- */
-- (void)ghu_performSelectorOnMainThread:(SEL)selector withObjects:object, ...;
-
-/*!
- Invoke selector with arguments on main thread.
- @param selector
- @param waitUntilDone Whether to join on selector and wait for it to finish.
- @param withObjects nil terminated variable argument list
- */
-- (void)ghu_performSelectorOnMainThread:(SEL)selector waitUntilDone:(BOOL)waitUntilDone withObjects:object, ...;
-
-
-- (void)ghu_performSelector:(SEL)selector onMainThread:(BOOL)onMainThread waitUntilDone:(BOOL)waitUntilDone withObjects:object, ...;
-
-- (void)ghu_performSelector:(SEL)selector onMainThread:(BOOL)onMainThread waitUntilDone:(BOOL)waitUntilDone arguments:(NSArray *)arguments;
-
-- (void)ghu_performSelector:(SEL)selector onMainThread:(BOOL)onMainThread waitUntilDone:(BOOL)waitUntilDone
- afterDelay:(NSTimeInterval)delay arguments:(NSArray *)arguments;
-
-
-// Invocation proxies
-
-- (id)ghu_proxyOnMainThread;
-- (id)ghu_proxyOnMainThread:(BOOL)waitUntilDone;
-- (id)ghu_proxyOnThread:(NSThread *)thread;
-- (id)ghu_proxyOnThread:(NSThread *)thread waitUntilDone:(BOOL)waitUntilDone;
-- (id)ghu_proxyAfterDelay:(NSTimeInterval)delay;
-
-// Debug proxies
-- (id)ghu_timedProxy:(NSTimeInterval *)time;
-- (id)ghu_debugProxy:(NSTimeInterval *)time proxy:(GHNSInvocationProxy_GHUNIT **)proxy;
-
-@end
View
6 Frameworks/GHUnit.framework/Versions/A/Headers/GHTest+JUnitXML.h
@@ -27,9 +27,11 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
#import "GHTest.h"
-@interface GHTest (JUnitXML)
+@interface GHTest(JUnitXML)
/*!
Return test results in JUnit XML format for external parsing use
@@ -38,3 +40,5 @@
- (NSString *)JUnitXML;
@end
+
+//! @endcond
View
8 Frameworks/GHUnit.framework/Versions/A/Headers/GHTest.h
@@ -1,6 +1,6 @@
//
// GHTest.h
-// GHKit
+// GHUnit
//
// Created by Gabriel Handford on 1/18/09.
// Copyright 2009. All rights reserved.
@@ -27,6 +27,11 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
+#import <Foundation/Foundation.h>
+
+
/*!
Test status.
*/
@@ -179,3 +184,4 @@ extern NSString *NSStringFromGHTestStats(GHTestStats stats);
@end
+//! @endcond
View
9 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestCase.h
@@ -49,8 +49,13 @@
#import "GHTestMacros.h"
#import "GHTest.h"
-// Log to your test case logger.
-// For example, GHTestLog(@"Some debug info, %@", obj)
+/*!
+ Log to your test case logger.
+ For example,
+ @code
+ GHTestLog(@"Some debug info, %@", obj);
+ @endcode
+ */
#define GHTestLog(...) [self log:[NSString stringWithFormat:__VA_ARGS__, nil]]
/*!
View
6 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestGroup+JUnitXML.h
@@ -27,12 +27,16 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
#import "GHTestGroup.h"
-@interface GHTestGroup (JUnitXML)
+@interface GHTestGroup(JUnitXML)
- (NSString *)JUnitXML;
- (BOOL)writeJUnitXMLAtPath:(NSString *)documentsPath error:(NSError **)error;
@end
+
+//! @endcond
View
25 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestGroup.h
@@ -26,6 +26,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
#import "GHTest.h"
#import "GHTestCase.h"
@@ -126,15 +128,36 @@
*/
- (void)addTestCase:(id)testCase;
+/*!
+ Add a test group to this test group.
+ @param testGroup Test group to add
+ */
- (void)addTestGroup:(GHTestGroup *)testGroup;
+/*!
+ Add tests to this group.
+ @param tests Tests to add
+ */
- (void)addTests:(NSArray */*of id<GHTest>*/)tests;
+/*!
+ Add test to this group.
+ @param test Test to add
+ */
- (void)addTest:(id<GHTest>)test;
+/*!
+ Whether the test group should run on the main thread.
+ Call passes to test case instance if enabled.
+ */
- (BOOL)shouldRunOnMainThread;
/*!
+ @result YES if we have any enabled chilren, NO if all children have been disabled.
+ */
+- (BOOL)hasEnabledChildren;
+
+/*!
Get list of failed tests.
@result Failed tests
*/
@@ -149,3 +172,5 @@
- (void)runInOperationQueue:(NSOperationQueue *)operationQueue options:(GHTestOptions)options;
@end
+
+//! @endcond
View
455 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestMacros.h
@@ -77,6 +77,13 @@
// the License.
//
+/*!
+ @file GHTestMacros.h
+ @brief Assert macros for testing.
+ */
+
+#import <Foundation/Foundation.h>
+
#import "NSException+GHTestFailureExceptions.h"
#import "NSValue+GHValueFormatter.h"
@@ -89,14 +96,16 @@ extern NSString *const GHTestFailureException;
#if defined(__cplusplus)
extern "C"
#endif
+
NSString *GHComposeString(NSString *, ...);
-// Generates a failure when a1 != noErr
-// Args:
-// a1: should be either an OSErr or an OSStatus
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+
+/*!
+ Generates a failure when a1 != noErr
+ @param a1 Should be either an OSErr or an OSStatus
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ...: A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertNoErr(a1, description, ...) \
do { \
@try {\
@@ -120,13 +129,13 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when a1 != a2
-// Args:
-// a1: received value. Should be either an OSErr or an OSStatus
-// a2: expected value. Should be either an OSErr or an OSStatus
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 != a2
+ @param a1 Rreceived value. Should be either an OSErr or an OSStatus
+ @param a2 Expected value. Should be either an OSErr or an OSStatus
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertErr(a1, a2, description, ...) \
do { \
@try {\
@@ -152,12 +161,12 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
} while(0)
-// Generates a failure when a1 is NULL
-// Args:
-// a1: should be a pointer (use GHAssertNotNil for an object)
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 is NULL
+ @param a1 Should be a pointer (use GHAssertNotNil for an object)
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertNotNULL(a1, description, ...) \
do { \
@try {\
@@ -181,12 +190,12 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when a1 is not NULL
-// Args:
-// a1: should be a pointer (use GHAssertNil for an object)
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 is not NULL
+ @param a1 should be a pointer (use GHAssertNil for an object)
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertNULL(a1, description, ...) \
do { \
@try {\
@@ -210,14 +219,13 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when a1 is equal to a2. This test is for C scalars,
-// structs and unions.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 is equal to a2. This test is for C scalars, structs and unions.
+ @param a1 Argument 1
+ @param a2 Argument 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertNotEquals(a1, a2, description, ...) \
do { \
@try {\
@@ -250,13 +258,13 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when a1 is equal to a2. This test is for objects.
-// Args:
-// a1: argument 1. object.
-// a2: argument 2. object.
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 is equal to a2. This test is for objects.
+ @param a1 Argument 1. object.
+ @param a2 Argument 2. object.
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertNotEqualObjects(a1, a2, desc, ...) \
do { \
@try {\
@@ -282,14 +290,14 @@ withDescription:GHComposeString(desc, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when a1 is not 'op' to a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 is not 'op' to a2. This test is for C scalars.
+ @param a1 Argument 1
+ @param a2 Argument 2
+ @param op Operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertOperation(a1, a2, op, description, ...) \
do { \
@try {\
@@ -323,61 +331,60 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when a1 is not > a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 is not > a2. This test is for C scalars.
+ @param a1 argument 1
+ @param a2 argument 2
+ @param op operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertGreaterThan(a1, a2, description, ...) \
GHAssertOperation(a1, a2, >, description, ##__VA_ARGS__)
-// Generates a failure when a1 is not >= a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 is not >= a2. This test is for C scalars.
+ @param a1 argument 1
+ @param a2 argument 2
+ @param op operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertGreaterThanOrEqual(a1, a2, description, ...) \
GHAssertOperation(a1, a2, >=, description, ##__VA_ARGS__)
-// Generates a failure when a1 is not < a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when a1 is not < a2. This test is for C scalars.
+ @param a1 argument 1
+ @param a2 argument 2
+ @param op operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertLessThan(a1, a2, description, ...) \
GHAssertOperation(a1, a2, <, description, ##__VA_ARGS__)
-// Generates a failure when a1 is not <= a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*! Generates a failure when a1 is not <= a2. This test is for C scalars.
+ @param a1 argument 1
+ @param a2 argument 2
+ @param op operation
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertLessThanOrEqual(a1, a2, description, ...) \
GHAssertOperation(a1, a2, <=, description, ##__VA_ARGS__)
-// Generates a failure when string a1 is not equal to string a2. This call
-// differs from GHAssertEqualObjects in that strings that are different in
-// composition (precomposed vs decomposed) will compare equal if their final
-// representation is equal.
-// ex O + umlaut decomposed is the same as O + umlaut composed.
-// Args:
-// a1: string 1
-// a2: string 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when string a1 is not equal to string a2. This call
+ differs from GHAssertEqualObjects in that strings that are different in
+ composition (precomposed vs decomposed) will compare equal if their final
+ representation is equal.
+ ex O + umlaut decomposed is the same as O + umlaut composed.
+ @param a1 string 1
+ @param a2 string 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertEqualStrings(a1, a2, description, ...) \
do { \
@try {\
@@ -402,17 +409,17 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when string a1 is equal to string a2. This call
-// differs from GHAssertEqualObjects in that strings that are different in
-// composition (precomposed vs decomposed) will compare equal if their final
-// representation is equal.
-// ex O + umlaut decomposed is the same as O + umlaut composed.
-// Args:
-// a1: string 1
-// a2: string 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when string a1 is equal to string a2. This call
+ differs from GHAssertEqualObjects in that strings that are different in
+ composition (precomposed vs decomposed) will compare equal if their final
+ representation is equal.
+ ex O + umlaut decomposed is the same as O + umlaut composed.
+ @param a1 string 1
+ @param a2 string 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertNotEqualStrings(a1, a2, description, ...) \
do { \
@try {\
@@ -424,7 +431,7 @@ if (([a1value isKindOfClass:[NSString class]] && \
(a1value == nil && [a2value isKindOfClass:[NSString class]]) || \
(a2value == nil && [a1value isKindOfClass:[NSString class]]) \
) continue; \
-[self failWithException:[NSException ghu_failureInEqualityBetweenObject: a1value \
+[self failWithException:[NSException ghu_failureInInequalityBetweenObject: a1value \
andObject: a2value \
inFile: [NSString stringWithUTF8String:__FILE__] \
atLine: __LINE__ \
@@ -439,13 +446,13 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when c-string a1 is not equal to c-string a2.
-// Args:
-// a1: string 1
-// a2: string 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when c-string a1 is not equal to c-string a2.
+ @param a1 string 1
+ @param a2 string 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertEqualCStrings(a1, a2, description, ...) \
do { \
@try {\
@@ -468,13 +475,13 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
-// Generates a failure when c-string a1 is equal to c-string a2.
-// Args:
-// a1: string 1
-// a2: string 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
+/*!
+ Generates a failure when c-string a1 is equal to c-string a2.
+ @param a1 string 1
+ @param a2 string 2
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present.
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertNotEqualCStrings(a1, a2, description, ...) \
do { \
@try {\
@@ -499,14 +506,13 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
// GTM_END
// SENTE_BEGIN
-/*" Generates a failure when !{ [a1 isEqualTo:a2] } is false
+/*! Generates a failure when !{ [a1 isEqualTo:a2] } is false
(or one is nil and the other is not).
- _{a1 The object on the left.}
- _{a2 The object on the right.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+ @param a1 The object on the left
+ @param a2 The object on the right
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertEqualObjects(a1, a2, description, ...) \
do { \
@try {\
@@ -532,14 +538,13 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
} while(0)
-/*" Generates a failure when a1 is not equal to a2. This test is for
+/*! Generates a failure when a1 is not equal to a2. This test is for
C scalars, structs and unions.
- _{a1 The argument on the left.}
- _{a2 The argument on the right.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+ @param a1 The argument on the left
+ @param a2 The argument on the right
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertEquals(a1, a2, description, ...) \
do { \
@try {\
@@ -571,21 +576,20 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
}\
} while(0)
+//! Absolute difference
#define GHAbsoluteDifference(left,right) (MAX(left,right)-MIN(left,right))
-/*" Generates a failure when a1 is not equal to a2 within + or - accuracy is false.
+/*!
+ Generates a failure when a1 is not equal to a2 within + or - accuracy is false.
This test is for scalars such as floats and doubles where small differences
could make these items not exactly equal, but also works for all scalars.
- _{a1 The scalar on the left.}
- _{a2 The scalar on the right.}
- _{accuracy The maximum difference between a1 and a2 for these values to be
- considered equal.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
-
+ @param a1 The scalar on the left
+ @param a2 The scalar on the right
+ @param accuracy The maximum difference between a1 and a2 for these values to be considered equal
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertEqualsWithAccuracy(a1, a2, accuracy, description, ...) \
do { \
@try {\
@@ -621,24 +625,22 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
-/*" Generates a failure unconditionally.
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+/*! Generates a failure unconditionally.
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHFail(description, ...) \
[self failWithException:[NSException ghu_failureInFile: [NSString stringWithUTF8String:__FILE__] \
atLine: __LINE__ \
withDescription: GHComposeString(description, ##__VA_ARGS__)]]
-/*" Generates a failure when a1 is not nil.
- _{a1 An object.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+/*! Generates a failure when a1 is not nil.
+ @param a1 An object
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertNil(a1, description, ...) \
do { \
@try {\
@@ -663,12 +665,11 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
} while(0)
-/*" Generates a failure when a1 is nil.
- _{a1 An object.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+/*! Generates a failure when a1 is nil.
+ @param a1 An object
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertNotNil(a1, description, ...) \
do { \
@try {\
@@ -693,12 +694,12 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
} while(0)
-/*" Generates a failure when expression evaluates to false.
- _{expr The expression that is tested.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+/*!
+ Generates a failure when expression evaluates to false.
+ @param expr The expression that is tested
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertTrue(expr, description, ...) \
do { \
BOOL _evaluatedExpression = (expr);\
@@ -713,13 +714,14 @@ withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when expression evaluates to false and in addition will
+/*!
+ Generates a failure when expression evaluates to false and in addition will
generate error messages if an exception is encountered.
- _{expr The expression that is tested.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+
+ @param expr The expression that is tested
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertTrueNoThrow(expr, description, ...) \
do { \
@try {\
@@ -743,12 +745,11 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when the expression evaluates to true.
- _{expr The expression that is tested.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+/*! Generates a failure when the expression evaluates to true.
+ @param expr The expression that is tested
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertFalse(expr, description, ...) \
do { \
BOOL _evaluatedExpression = (expr);\
@@ -763,13 +764,12 @@ withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when the expression evaluates to true and in addition
+/*! Generates a failure when the expression evaluates to true and in addition
will generate error messages if an exception is encountered.
- _{expr The expression that is tested.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+ @param expr The expression that is tested
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertFalseNoThrow(expr, description, ...) \
do { \
@try {\
@@ -793,12 +793,11 @@ withDescription:GHComposeString(description, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when expression does not throw an exception.
- _{expression The expression that is evaluated.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.
- "*/
+/*! Generates a failure when expression does not throw an exception.
+ @param expression The expression that is evaluated
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent.
+ */
#define GHAssertThrows(expr, description, ...) \
do { \
@try { \
@@ -815,14 +814,13 @@ withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when expression does not throw an exception of a
+/*! Generates a failure when expression does not throw an exception of a
specific class.
- _{expression The expression that is evaluated.}
- _{specificException The specified class of the exception.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+ @param expression The expression that is evaluated
+ @param specificException The specified class of the exception
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertThrowsSpecific(expr, specificException, description, ...) \
do { \
@try { \
@@ -849,18 +847,16 @@ withDescription: GHComposeString(_descrip, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when expression does not throw an exception of a
+/*! Generates a failure when expression does not throw an exception of a
specific class with a specific name. Useful for those frameworks like
AppKit or Foundation that throw generic NSException w/specific names
(NSInvalidArgumentException, etc).
- _{expression The expression that is evaluated.}
- _{specificException The specified class of the exception.}
- _{aName The name of the specified exception.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-
- "*/
+ @param expression The expression that is evaluated
+ @param specificException The specified class of the exception
+ @param aName The name of the specified exception
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertThrowsSpecificNamed(expr, specificException, aName, description, ...) \
do { \
@try { \
@@ -897,12 +893,11 @@ withDescription: GHComposeString(_descrip, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when expression does throw an exception.
- _{expression The expression that is evaluated.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+/*! Generates a failure when expression does throw an exception.
+ @param expression The expression that is evaluated
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertNoThrow(expr, description, ...) \
do { \
@try { \
@@ -918,14 +913,13 @@ withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when expression does throw an exception of the specitied
+/*! Generates a failure when expression does throw an exception of the specitied
class. Any other exception is okay (i.e. does not generate a failure).
- _{expression The expression that is evaluated.}
- _{specificException The specified class of the exception.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
- "*/
+ @param expression The expression that is evaluated
+ @param specificException The specified class of the exception
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertNoThrowSpecific(expr, specificException, description, ...) \
do { \
@try { \
@@ -944,18 +938,16 @@ withDescription: GHComposeString(description, ##__VA_ARGS__)]]; \
} while (0)
-/*" Generates a failure when expression does throw an exception of a
+/*! Generates a failure when expression does throw an exception of a
specific class with a specific name. Useful for those frameworks like
AppKit or Foundation that throw generic NSException w/specific names
(NSInvalidArgumentException, etc).
- _{expression The expression that is evaluated.}
- _{specificException The specified class of the exception.}
- _{aName The name of the specified exception.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-
- "*/
+ @param expression The expression that is evaluated.
+ @param specificException The specified class of the exception
+ @param aName The name of the specified exception
+ @param description A format string as in the printf() function. Can be nil or an empty string but must be present
+ @param ... A variable number of arguments to the format string. Can be absent
+ */
#define GHAssertNoThrowSpecificNamed(expr, specificException, aName, description, ...) \
do { \
@try { \
@@ -979,7 +971,9 @@ continue; \
} while (0)
-@interface NSException (GHTestMacros_GTMSenTestAdditions)
+//! @cond DEV
+
+@interface NSException(GHTestMacros_GTMSenTestAdditions)
+ (NSException *)ghu_failureInFile:(NSString *)filename
atLine:(int)lineNumber
withDescription:(NSString *)formatString, ...;
@@ -993,6 +987,11 @@ continue; \
inFile:(NSString *)filename
atLine:(int)lineNumber
withDescription:(NSString *)formatString, ...;
++ (NSException *)ghu_failureInInequalityBetweenObject:(id)left
+ andObject:(id)right
+ inFile:(NSString *)filename
+ atLine:(int)lineNumber
+ withDescription:(NSString *)formatString, ...;
+ (NSException *)ghu_failureInEqualityBetweenValue:(NSValue *)left
andValue:(NSValue *)right
withAccuracy:(NSValue *)accuracy
@@ -1010,4 +1009,6 @@ continue; \
withDescription:(NSString *)formatString, ...;
@end
+//! @endcond
+
// SENTE_END
View
6 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestOperation.h
@@ -27,6 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
#import "GHTest.h"
/*!
@@ -39,4 +41,6 @@
- (id)initWithTest:(id<GHTest>)test options:(GHTestOptions)options;
-@end
+@end
+
+//! @endcond
View
2 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestOutlineViewModel.h
@@ -6,9 +6,11 @@
// Copyright 2009. All rights reserved.
//
+#import <Cocoa/Cocoa.h>
#import "GHTestViewModel.h"
@class GHTestOutlineViewModel;
+#define MIN_WINDOW_WIDTH (635.0)
@protocol GHTestOutlineViewModelDelegate <NSObject>
- (void)testOutlineViewModelDidChangeSelection:(GHTestOutlineViewModel *)testOutlineViewModel;
View
3 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestRunner.h
@@ -26,6 +26,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
//
// Portions of this file fall under the following license, marked with:
// GTM_BEGIN : GTM_END
@@ -156,4 +158,5 @@
@end
+//! @endcond
View
4 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestSuite.h
@@ -27,6 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
#import "GHTestGroup.h"
/*!
@@ -112,3 +114,5 @@ extern NSString *GHUnitTest;
- (BOOL)writeJUnitXML:(NSError **)error;
@end
+
+//! @endcond
View
9 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestViewController.h
@@ -31,18 +31,18 @@
#import "GHTestGroup.h"
#import "GHTestOutlineViewModel.h"
-#import "BWSplitView.h"
-@interface GHTestViewController : NSViewController <GHTestRunnerDelegate, GHTestOutlineViewModelDelegate> {
+@interface GHTestViewController : NSViewController <GHTestRunnerDelegate, GHTestOutlineViewModelDelegate, NSSplitViewDelegate> {
- IBOutlet BWSplitView *_splitView;
+ IBOutlet NSSplitView *_splitView;
IBOutlet NSView *_statusView;
IBOutlet NSView *_detailsView;
IBOutlet NSOutlineView *_outlineView;
IBOutlet NSTextView *_textView;
IBOutlet NSSegmentedControl *_textSegmentedControl;
IBOutlet NSSegmentedControl *_segmentedControl;
IBOutlet NSSearchField *_searchField;
+ IBOutlet NSButton *_detailsToggleButton;
BOOL wrapInTextView_;
NSString *status_;
@@ -73,6 +73,9 @@
@property (retain, nonatomic) NSString *exceptionFilename;
@property (assign, nonatomic) NSInteger exceptionLineNumber;
+@property (assign, nonatomic) BOOL reraiseExceptions;
+@property (assign, nonatomic) BOOL runInParallel;
+
- (void)loadTestSuite;
View
8 Frameworks/GHUnit.framework/Versions/A/Headers/GHTestViewModel.h
@@ -1,6 +1,6 @@
//
// GHTest.h
-// GHKit
+// GHUnit
//
// Created by Gabriel Handford on 1/17/09.
// Copyright 2009. All rights reserved.
@@ -27,7 +27,11 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
#import "GHTestGroup.h"
+#import "GHTestSuite.h"
+#import "GHTestRunner.h"
@class GHTestNode;
@@ -161,3 +165,5 @@ typedef enum {
- (void)setFilter:(GHTestNodeFilter)filter textFilter:(NSString *)textFilter;
@end
+
+//! @endcond
View
7 Frameworks/GHUnit.framework/Versions/A/Headers/GHTesting.h
@@ -27,6 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
+//! @cond DEV
+
//
// Portions of this file fall under the following license, marked with:
// GTM_BEGIN : GTM_END
@@ -46,6 +48,9 @@
// the License.
//
+#import <Foundation/Foundation.h>
+#import "GHUnit.h"
+
#ifdef __cplusplus
extern "C" NSString *GHUStackTraceFromException(NSException *e);
#else
@@ -142,3 +147,5 @@ BOOL isTestFixtureOfClass(Class aClass, Class testCaseClass);
@protocol GHSenTestCase
- (void)raiseAfterFailure;
@end
+
+//! @endcond
View
36 Frameworks/GHUnit.framework/Versions/A/Headers/GHUNSObject+Swizzle.h
@@ -1,36 +0,0 @@
-//
-// GHNSObject+Swizzle.h
-// GHUnit
-//
-// Created by Gabriel Handford on 4/13/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-@interface NSObject (GHUSwizzle)
-
-+ (void)ghu_swizzleMethod:(SEL)original withMethod:(SEL)alternate;
-+ (void)ghu_swizzleClassMethod:(SEL)original withClassMethod:(SEL)alternate;
-
-@end
-
View
580 Frameworks/GHUnit.framework/Versions/A/Headers/GHUnit.h
@@ -42,10 +42,588 @@
#import "NSException+GHTestFailureExceptions.h"
#import "NSValue+GHValueFormatter.h"
+#if TARGET_OS_IPHONE
+#import "GHUnitIOSAppDelegate.h"
+#endif
+
#ifdef DEBUG
#define GHUDebug(fmt, ...) do { \
fputs([[[NSString stringWithFormat:fmt, ##__VA_ARGS__] stringByAppendingString:@"\n"] UTF8String], stdout); \
} while(0)
#else
#define GHUDebug(fmt, ...) do {} while(0)
-#endif
+#endif
+
+/*!
+ @mainpage GHUnit
+
+
+ GHUnit is a test framework for Objective-C (Mac OS X 10.5 and above and iPhone 3.x and above).
+ It can be used with SenTestingKit, GTM or all by itself.
+
+ For example, your test cases will be run if they subclass any of the following:
+
+ - GHTestCase
+ - SenTestCase
+ - GTMTestCase
+
+
+ Source: http://github.com/gabriel/gh-unit
+
+ View docs online: http://gabriel.github.com/gh-unit/
+
+
+ This manual is divided in the following sections:
+ - @subpage Examples
+ - @subpage Installing
+ - @subpage Building
+ - @subpage TestMacros
+ - @subpage EnvVariables
+ - @subpage CommandLine "Command Line & Makefiles"
+ - @subpage Customizing
+ - @subpage Hudson
+
+
+ @image html http://rel.me.s3.amazonaws.com/gh-unit/images/GHUnit-IPhone-0.4.18.png
+
+ @image html http://rel.me.s3.amazonaws.com/gh-unit/images/GHUnit-0.4.18.png
+
+ @section Notes Notes
+
+ GHUnit was inspired by and uses parts of GTM (google-toolbox-for-mac) code, mostly from UnitTesting: http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/UnitTesting/
+
+ */
+
+/*!
+ @page Installing Installing
+
+ - @ref InstallingIOSXCode4
+ - @ref InstallingIOSXCode3
+ - @ref InstallMacOSXXCode4
+ - @ref InstallMacOSXXCode3
+
+ @section InstallingIOSXCode4 Installing in XCode 4 (iOS)
+
+ - Add a <tt>New Target</tt>. Select <tt>iOS -> Application</tt>. You can select the Window-based application. Name it <tt>Tests</tt> (or something similar). And you can deselect the 'Add Unit Tests' option.
+ - Copy and add <tt>GHUnitIOS.framework</tt> into your project: Add Files to 'App'..., select <tt>GHUnitIOS.framework</tt>, and select only the "Tests" target.
+ - In the "Tests" target, Build Phases, Link Binary with Libraries, make sure the following Frameworks are present:
+ - <tt>GHUnitIOS.framework</tt>
+ - <tt>CoreGraphics.framework</tt>
+ - <tt>Foundation.framework</tt>
+ - <tt>UIKit.framework</tt>
+ - In the "Tests" target, Build Settings, under 'Framework Search Paths' make sure the (parent) directory to GHUnitIOS.framework is listed.
+ - In the "Tests" target, Build Settigns, under 'Other Linker Flags' in the "Tests" target, add <tt>-ObjC</tt> and <tt>-all_load</tt>
+ - By default, the Tests-Info.plist file includes <tt>MainWindow_iPhone</tt> and <tt>MainWindow_iPad</tt> for <tt>Main nib file base name</tt>. You should remove both these fields.
+ - Add the GHUnitIOSTestMain.m (http://github.com/gabriel/gh-unit/blob/master/Project-iOS/GHUnitIOSTestMain.m) file into your project and make sure its enabled for the "Tests" target. You should delete the existing main.m file (or replace the contents of the existing main.m with GHUnitIOSTestMain.m).
+ - @ref Examples "Create a test"
+ - Build and run the "Tests" target.
+ - You can remove the files: TestsAppDelete* and MainWindow* that were generated with the Tests target.
+ - (Optional) @ref Makefile "Install Makefile"
+
+ @section InstallingIOSXCode3 Installing in XCode 3 (iOS)
+
+ - Add a <tt>New Target</tt>. Select <tt>iOS -> Application</tt>. Name it <tt>Tests</tt> (or something similar).
+ - Copy and add <tt>GHUnitIOS.framework</tt> into your project: Add Files to ..., select <tt>GHUnitIOS.framework</tt>, and select the <tt>Tests</tt> target.
+ - Add the following frameworks to <tt>Linked Libraries</tt>:
+ - <tt>GHUnitIOS.framework</tt>
+ - <tt>CoreGraphics.framework</tt>
+ - <tt>Foundation.framework</tt>
+ - <tt>UIKit.framework</tt>
+ - In Build Settings, under 'Framework Search Paths' make sure the (parent) directory to GHUnitIOS.framework is listed.
+ - In Build Settings, under 'Other Linker Flags' in the <tt>Tests</tt> target, add <tt>-ObjC</tt> and <tt>-all_load</tt>
+ - By default, the Tests-Info.plist file includes <tt>MainWindow</tt> for <tt>Main nib file base name</tt>. You should clear this field.
+ - Add the GHUnitIOSTestMain.m (http://github.com/gabriel/gh-unit/blob/master/Project-iOS/GHUnitIOSTestMain.m) file into your project and make sure its enabled for the "Tests" target.
+ - (Optional) Create and and set a prefix header (<tt>Tests_Prefix.pch</tt>) and add <tt>#import <GHUnitIOS/GHUnit.h></tt> to it, and then you won't have to include that import for every test.
+ - @ref Examples "Create a test"
+ - Build and run the "Tests" target.
+ - (Optional) @ref Makefile "Install Makefile"
+
+
+ @section InstallMacOSXXCode4 Installing in XCode 4 (Mac OS X)
+
+ - Add a <tt>New Target</tt>. Select <tt>Application -> Cocoa Application</tt>. Name it <tt>Tests</tt> (or something similar).
+ - Copy and add <tt>GHUnit.framework</tt> into your project: Add Files to 'App'..., select <tt>GHUnit.framework</tt>, and select only the "Tests" target.
+ - In the "Tests" target, in Build Settings, add <tt>@@loader_path/../Frameworks</tt> to <tt>Runpath Search Paths</tt>.
+ - In the "Tests" target, in Build Phases, select <tt>Add Build Phase</tt> and then <tt>Add Copy Files</tt>.
+ - Change the Destination to <tt>Frameworks</tt>.
+ - Drag <tt>GHUnit.framework</tt> from the project file view into the the Copy Files build phase.
+ - Make sure the copy phase appears before any <tt>Run Script</tt> phases.
+ - Copy GHUnitTestMain.m (http://github.com/gabriel/gh-unit/tree/master/Classes-MacOSX/GHUnitTestMain.m) into your project and include in the Test target. You should delete the existing main.m file (or replace the contents of the existing main.m with GHUnitTestMain.m).
+ - By default, the Tests-Info.plist file includes <tt>MainWindow</tt> for <tt>Main nib file base name</tt>. You should clear this field. You can also delete the existing MainMenu.xib and files like TestsAppDelegate.*.
+ - @ref Examples "Create a test"
+ - Build and run the "Tests" target.
+ - (Optional) @ref Makefile "Install Makefile"
+
+ @section InstallMacOSXXCode3 Installing in XCode 3 (Mac OS X)
+
+ You can install it globally in /Library/Frameworks or with a little extra effort embed it with your project.
+
+ @subsection InstallLibraryFrameworks Installing in /Library/Frameworks
+
+ - Copy <tt>GHUnit.framework</tt> to <tt>/Library/Frameworks/</tt>
+ - Add a <tt>New Target</tt>. Select <tt>Cocoa -> Application</tt>. Name it <tt>Tests</tt> (or something similar).
+ - In the <tt>Target 'Tests' Info</tt> window, <tt>General</tt> tab:
+ - Add a linked library, under <tt>Mac OS X 10.X SDK</tt> section, select <tt>GHUnit.framework</tt>
+ - If your main target is a library: Add a linked library, and select your main target.
+ - If your main target is an application, you will need to include these source files in the <tt>Test</tt> project manually.
+ - Add a direct dependency, and select your project. (This will cause your application or framework to build before the test target.)
+ - Copy GHUnitTestMain.m (http://github.com/gabriel/gh-unit/tree/master/Classes-MacOSX/GHUnitTestMain.m) into your project and include in the Test target.
+ - Now create a test (either by subclassing <tt>SenTestCase</tt> or <tt>GHTestCase</tt>), adding it to your test target. (See example test case below.)
+ - By default, the Tests-Info.plist file includes <tt>MainWindow</tt> for <tt>Main nib file base name</tt>. You should clear this field.
+ - @ref Examples "Create a test"
+ - (Optional) @ref Makefile "Install Makefile"
+
+ @subsection InstallProject Installing in your project
+
+ - Add a <tt>New Target</tt>. Select <tt>Cocoa -> Application</tt>. Name it <tt>Tests</tt> (or something similar).
+ - In the Finder, copy <tt>GHUnit.framework</tt> to your project directory (maybe in MyProject/Frameworks/.)
+ - In the <tt>Tests</tt> target, add the <tt>GHUnit.framework</tt> files (from MyProject/Frameworks/). It should now be visible as a <tt>Linked Framework</tt> in the target.
+ - In the <tt>Tests</tt> target, under Build Settings, add <tt>@loader_path/../Frameworks</tt> to <tt>Runpath Search Paths</tt> (Under All Configurations)
+ - In the <tt>Tests</tt> target, add <tt>New Build Phase</tt> | <tt>New Copy Files Build Phase</tt>.
+ - Change the Destination to <tt>Frameworks</tt>.
+ - Drag <tt>GHUnit.framework</tt> into the the build phase
+ - Make sure the copy phase appears before any <tt>Run Script</tt> phases
+ - Copy GHUnitTestMain.m (http://github.com/gabriel/gh-unit/tree/master/Classes-MacOSX/GHUnitTestMain.m) into your project and include in the Test target.
+
+ - If your main target is a library:
+ - In the <tt>Target 'Tests' Info</tt> window, <tt>General</tt> tab:
+ - Add a linked library, and select your main target; This is so you can link your test target against your main target, and then you don't have to manually include source files in both targets.
+ - If your main target is an application, you will need to include these source files to the <tt>Test</tt> project manually.
+
+ - Now create a test (either by subclassing <tt>SenTestCase</tt> or <tt>GHTestCase</tt>), adding it to your test target. (See example test case below.)
+ - By default, the Tests-Info.plist file includes <tt>MainWindow</tt> for <tt>Main nib file base name</tt>. You should clear this field.
+ - @ref Examples "Create a test"
+ - (Optional) @ref Makefile "Install Makefile"
+ */
+
+/*!
+ @page Building Building
+
+ For iOS, run <tt>make</tt> from within the <tt>Project-iOS</tt> directory. The framework is in <tt>Project-iOS/build/Framework/</tt>.
+
+ For Mac OS X, the framework build is stored in <tt>Project/build/Release/</tt>.
+ */
+
+/*!
+ @page Examples Examples
+
+ - @ref ExampleTestCase
+ - @ref ExampleAsyncTestCase
+
+ @section ExampleTestCase Example Test Case
+
+ For example <tt>ExampleTest.m</tt>:
+
+ @code
+ // For iOS
+ #import <GHUnitIOS/GHUnit.h>
+ // For Mac OS X
+ //#import <GHUnit/GHUnit.h>
+
+ @interface ExampleTest : GHTestCase { }
+ @end
+
+ @implementation ExampleTest
+
+ - (BOOL)shouldRunOnMainThread {
+ // By default NO, but if you have a UI test or test dependent on running on the main thread return YES.
+ // Also an async test that calls back on the main thread, you'll probably want to return YES.
+ return NO;
+ }
+
+ - (void)setUpClass {
+ // Run at start of all tests in the class
+ }
+
+ - (void)tearDownClass {
+ // Run at end of all tests in the class
+ }
+
+ - (void)setUp {
+ // Run before each test method
+ }
+
+ - (void)tearDown {
+ // Run after each test method
+ }
+
+ - (void)testFoo {
+ NSString *a = @"foo";
+ GHTestLog(@"I can log to the GHUnit test console: %@", a);
+
+ // Assert a is not NULL, with no custom error description
+ GHAssertNotNULL(a, nil);
+
+ // Assert equal objects, add custom error description
+ NSString *b = @"bar";
+ GHAssertEqualObjects(a, b, @"A custom error message. a should be equal to: %@.", b);
+ }
+
+ - (void)testBar {
+ // Another test
+ }
+
+ @end
+ @endcode
+
+ @section ExampleAsyncTestCase Example Async Test Case
+
+ @code
+ // For iOS
+ #import <GHUnitIOS/GHUnit.h>
+ // For Mac OS X
+ //#import <GHUnit/GHUnit.h>
+
+ @interface ExampleAsyncTest : GHAsyncTestCase { }
+ @end
+
+ @implementation ExampleAsyncTest
+
+ - (void)testURLConnection {
+
+ // Call prepare to setup the asynchronous action.
+ // This helps in cases where the action is synchronous and the
+ // action occurs before the wait is actually called.
+ [self prepare];
+
+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]];
+ NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
+
+ // Wait until notify called for timeout (seconds); If notify is not called with kGHUnitWaitStatusSuccess then
+ // we will throw an error.
+ [self waitForStatus:kGHUnitWaitStatusSuccess timeout:10.0];
+
+ [connection release];
+ }
+
+ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
+ // Notify of success, specifying the method where wait is called.
+ // This prevents stray notifies from affecting other tests.
+ [self notify:kGHUnitWaitStatusSuccess forSelector:@selector(testURLConnection)];
+ }
+
+ - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
+ // Notify of connection failure
+ [self notify:kGHUnitWaitStatusFailure forSelector:@selector(testURLConnection)];
+ }
+
+ - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
+ GHTestLog(@"%@", [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]);
+ }
+
+ @end
+ @endcode
+
+
+ @section ExampleProjects Example Projects
+
+ Example projects can be found at: http://github.com/gabriel/gh-unit/tree/master/Examples/
+
+ */
+
+/*!
+ @page EnvVariables Environment Variables
+
+ @section GHUnitEnvVariables GHUnit Environment Variables
+
+ Go into the "Get Info" contextual menu of your (Tests) executable (inside the "Executables" group in the left panel of XCode).
+ Then go in the "Arguments" tab. You can add the following environment variables:
+
+ @verbatim
+ GHUNIT_CLI - Default NO; Runs tests on the command line (see Debugger Console, Cmd-Shift-R)
+ GHUNIT_RERAISE - Default NO; If an exception is encountered it re-raises it allowing you to crash into the debugger
+ GHUNIT_AUTORUN - Default NO; If YES, tests will start automatically
+ GHUNIT_AUTOEXIT - Default NO; If YES, will exit upon test completion (no matter what); For command line MacOSX testing
+ @endverbatim
+
+
+ @section EnvVariablesTest Test Environment Variables (Recommended)
+
+ Go into the "Get Info" contextual menu of your (Tests) executable (inside the "Executables" group in the left panel of XCode).
+ Then go in the "Arguments" tab. You can add the following environment variables:
+
+ @verbatim
+ Environment Variable: Default: Set to:
+ NSDebugEnabled NO YES
+ NSZombieEnabled NO YES
+ NSDeallocateZombies NO NO (or YES)
+ NSHangOnUncaughtException NO YES
+ NSAutoreleaseFreedObjectCheckEnabled NO YES
+ @endverbatim
+
+ If Using NSDeallocateZombies=NO, then all objects will leak so be sure to turn it off when debugging memory leaks.
+
+ For more info on these varaiables see NSDebug.h (http://theshadow.uw.hu/iPhoneSDKdoc/Foundation.framework/NSDebug.h.html)
+
+ For malloc debugging:
+