├── .gitignore ├── LICENSE ├── Makefile ├── README.markdown ├── XcodeTest ├── SGXcodeTest.m ├── XcodeTest-Prefix.pch └── XcodeTest.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ └── xcschemes │ └── XcodeTest.xcscheme ├── XcodeTestSample ├── RunPlatformUnitTests.sh ├── XcodeTestSample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── XcodeTestSample.xcscheme │ │ ├── XcodeTestSampleFailingTests.xcscheme │ │ ├── XcodeTestSampleLogicTests.xcscheme │ │ └── XcodeTestSamplePassingTests.xcscheme ├── XcodeTestSample │ ├── XcodeTestSample-Info.plist │ ├── XcodeTestSample-Prefix.pch │ ├── XcodeTestSampleAppDelegate.h │ ├── XcodeTestSampleAppDelegate.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── XcodeTestSampleLogicTests │ ├── XcodeTestSampleLogicTests-Info.plist │ ├── XcodeTestSampleLogicTests-Prefix.pch │ ├── XcodeTestSampleLogicTests.m │ └── en.lproj │ │ └── InfoPlist.strings └── XcodeTestSampleTests │ ├── XcodeTestSampleFailingTests.m │ ├── XcodeTestSamplePassingTests.m │ ├── XcodeTestSampleTests-Info.plist │ ├── XcodeTestSampleUITests.m │ └── en.lproj │ └── InfoPlist.strings ├── build_and_run_unit_tests.sh ├── run_sample_failing.sh ├── run_sample_passing.sh ├── scripts └── RunUnitTests.rb └── xcodetest.xcworkspace └── contents.xcworkspacedata /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *.mode* 3 | *.pbxuser 4 | .svn 5 | *.orig 6 | *.perspective 7 | *.perspectivev3 8 | *.trace 9 | *project.xcworkspace/ 10 | *.xcuserdatad 11 | .DS_Store 12 | *.orig 13 | *.BACKUP.* 14 | *.REMOTE.* 15 | *.LOCAL.* 16 | *.BASE.* 17 | libXcodeTest.a 18 | xcodetest.zip 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Stewart Gleadow 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Makefile to build the XcodeTest static library and sample test project 2 | 3 | default: clean xcodetest 4 | 5 | .PHONY: clean 6 | clean: 7 | xcodebuild -sdk iphonesimulator -scheme XcodeTest clean 8 | rm -rf libXcodeTest.a 9 | 10 | .PHONY: xcodetest 11 | xcodetest: 12 | xcodebuild -sdk iphonesimulator -scheme XcodeTest install 13 | 14 | .PHONY: bundle 15 | bundle: xcodetest 16 | zip -r xcodetest.zip libXcodeTest.a build_and_run_unit_tests.sh README.markdown 17 | 18 | ui: 19 | xcodebuild -sdk iphonesimulator -scheme XcodeTestSamplePassingTests build ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=YES 20 | 21 | logic: 22 | xcodebuild -sdk iphonesimulator -scheme XcodeTestSampleLogicTests build ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=YES 23 | 24 | passing: 25 | xcodebuild -sdk iphonesimulator -scheme XcodeTestSamplePassingTests build ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=YES XCODETEST=YES 26 | 27 | failing: 28 | xcodebuild -sdk iphonesimulator -scheme XcodeTestSampleFailingTests build ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=YES XCODETEST=YES 29 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # XcodeTest 2 | 3 | A way of running your application unit tests from the command line. 4 | 5 | 6 | ## How to use XcodeTest 7 | 8 | - add `libXcodeTest.a` to the root of your project (either next to your `.xcworkspace` or main `.xcodeproj` file) 9 | - add the shell script `build_and_run_unit_tests.sh` to the root of your project 10 | - make sure you have a *scheme* that builds your app, and that both the scheme and your target app have the same name (eg. sche e MyApp builds the target MyApp) 11 | - make sure you have a *scheme* that builds your unit test target (when you create a new unit test scheme, you need to edit the scheme and make sure it builds as part of the *run* action in Xcode so that it will build when using the command line `xcodebuild`) 12 | 13 | Since there are peculiarities when feeding in linker flags from the command line, you have to edit your *target build settings* in Xcode, or in your *xcconfig* file so that it knows about all this magic: 14 | 15 | - *In xcconfigs:* `OTHER_LDFLAGS = $(inherited) $(XCODE_TEST_LDFLAGS)` 16 | - *In Xcode:* double-click on `Other Linker Flags` in the Xcode build settings, hit the `+` button in the editor and add an entry for `$(XCODE_TEST_LDFLAGS)` 17 | 18 | Now try running the shell script: 19 | 20 | `./build_and_run_unit_tests.sh MyApp MyAppTests` 21 | 22 | That shell script should: 23 | - build your unit tests using the provided scheme name (second argument) 24 | - re-build your app with libXcodeTest.a compiled in 25 | - load your app using waxsim 26 | 27 | 28 | *NOTE: if you decide to add libXcodeTest.a to another directory, please provide the relative path as a third argument to the shell script, so we can tell the linker where to look.* 29 | 30 | eg. 31 | `./build_and_run_unit_tests.sh MyApp MyAppTests lib` 32 | 33 | 34 | ## Building libXcodeTest.a from source 35 | 36 | Checkout the source from [the github project](https://github.com/sgleadow/xcodetest) and type `make` in the root of the project to build the static library. To bundle up the library and associated shell scripts to distribute, type `make bundle`. 37 | 38 | 39 | ## Dependencies 40 | 41 | This tool uses the [waxsim](https://github.com/square/WaxSim/) tool to run your app in the iOS Simulator. Since there have been a few bugfixes that are yet to be merged in, please use [Jonathan Penn's fork](https://github.com/jonathanpenn/WaxSim/). Build and install waxsim using the command: 42 | 43 | `xcodebuild install DSTROOT=/ INSTALL_PATH=/usr/local/bin` 44 | 45 | 46 | ## How XcodeTest works 47 | 48 | XcodeTest is distributed as a static library that can be linked into your main application. The library automatically hooks itself into your application when the class loads, and registers for the `applicationDidBecomeActive` notification. It dynamically loads the symbols from the unit test bundle, fed in using the environment variable `XCODE_TEST_PATH`. 49 | 50 | If the `XCODE_TEST_PATH` variable is missing, it aborts. If the unit test object file cannot be dynamically loaded, it aborts. When both succeed, it runs your OCUnit/Kiwi tests using the same mechanism that Xcode uses, so the terminal output should be the same. 51 | 52 | 53 | ## Why XcodeTest exists 54 | 55 | Apple differentiates between 'logic' unit tests and 'application' unit tests. Logic unit tests only depend on Foundation libraries that are common to both OS X and iOS and can run directly on your development machine. Logic tests run on the command line simply by specifying TEST_AFTER_BUILD=YES when running `xcodebuild`. Application unit tests depend on iOS frameworks, like UIKit, and must run in the context of a host app inside the iOS simulator. Running application tests on the command line is not supported by Apple. You used to be able to get it working by hacking the underlying shell script, which I [wrote up already](http://www.stewgleadow.com/blog/2012/02/09/running-ocunit-and-kiwi-tests-on-the-command-line/). 56 | 57 | However, these hacks are flakey and don't work with the lastest versions of Xcode. There is a radar for the [bug running command line unit tests](http://openradar.appspot.com/12306879). This tool should get you going in the mean time. There is a [stackoverflow post](http://stackoverflow.com/questions/12557935/xcode-4-5-command-line-unit-testing) about the issue as well. 58 | 59 | 60 | ## Known Issues 61 | 62 | - If you use workspaces, and rely on Xcode picking up implicit dependencies, these don't seem to get detected when running `xcodebuild`, so you might have to edit the script and add your own `-workspace` option 63 | 64 | - Some people just use a single scheme that compiles both your app and your unit tests. This hack is to simple to deal with that case. 65 | 66 | ## Feedback 67 | 68 | Please raise issues if you find defects or have a feature request. 69 | 70 | 71 | ## License 72 | 73 | This library is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). 74 | -------------------------------------------------------------------------------- /XcodeTest/SGXcodeTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // SGXcodeTest.m 3 | // XcodeTest 4 | // 5 | // Created by Stewart Gleadow on 16/07/12. 6 | // Copyright (c) 2012 Stewart Gleadow 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | #import 28 | #import 29 | 30 | @interface SGXcodeTest : NSObject 31 | @end 32 | 33 | @implementation SGXcodeTest 34 | 35 | + (void)load 36 | { 37 | char *unitTestPath = getenv("XCODE_TEST_PATH"); 38 | assert(unitTestPath != NULL); 39 | 40 | void *loadedTests = NULL; 41 | loadedTests = dlopen(unitTestPath, RTLD_NOW); 42 | assert(loadedTests != NULL); 43 | 44 | [[NSNotificationCenter defaultCenter] addObserver:[self class] 45 | selector:@selector(applicationDidBecomeActive:) 46 | name:@"UIApplicationDidBecomeActiveNotification" 47 | object:nil]; 48 | } 49 | 50 | + (void)applicationDidBecomeActive:(NSNotification *)notification 51 | { 52 | SenSelfTestMain(); 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /XcodeTest/XcodeTest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'xcodetest' target in the 'XcodeTest' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /XcodeTest/XcodeTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C99C665815B435C90092A9B4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C665715B435C90092A9B4 /* Foundation.framework */; }; 11 | C99C667F15B436930092A9B4 /* SGXcodeTest.m in Sources */ = {isa = PBXBuildFile; fileRef = C99C665E15B435C90092A9B4 /* SGXcodeTest.m */; }; 12 | C99C668115B436C30092A9B4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C668015B436C30092A9B4 /* UIKit.framework */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXCopyFilesBuildPhase section */ 16 | C99C665215B435C90092A9B4 /* CopyFiles */ = { 17 | isa = PBXCopyFilesBuildPhase; 18 | buildActionMask = 2147483647; 19 | dstPath = "include/${PRODUCT_NAME}"; 20 | dstSubfolderSpec = 16; 21 | files = ( 22 | ); 23 | runOnlyForDeploymentPostprocessing = 0; 24 | }; 25 | /* End PBXCopyFilesBuildPhase section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | C99C665415B435C90092A9B4 /* libXcodeTest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libXcodeTest.a; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | C99C665715B435C90092A9B4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 30 | C99C665B15B435C90092A9B4 /* XcodeTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XcodeTest-Prefix.pch"; sourceTree = ""; }; 31 | C99C665E15B435C90092A9B4 /* SGXcodeTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SGXcodeTest.m; sourceTree = ""; }; 32 | C99C666615B435C90092A9B4 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 33 | C99C668015B436C30092A9B4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | C99C665115B435C90092A9B4 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | C99C668115B436C30092A9B4 /* UIKit.framework in Frameworks */, 42 | C99C665815B435C90092A9B4 /* Foundation.framework in Frameworks */, 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | /* End PBXFrameworksBuildPhase section */ 47 | 48 | /* Begin PBXGroup section */ 49 | C99C664915B435C90092A9B4 = { 50 | isa = PBXGroup; 51 | children = ( 52 | C99C665915B435C90092A9B4 /* XcodeTest */, 53 | C99C665615B435C90092A9B4 /* Frameworks */, 54 | C99C665515B435C90092A9B4 /* Products */, 55 | ); 56 | indentWidth = 4; 57 | sourceTree = ""; 58 | tabWidth = 4; 59 | }; 60 | C99C665515B435C90092A9B4 /* Products */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | C99C665415B435C90092A9B4 /* libXcodeTest.a */, 64 | ); 65 | name = Products; 66 | sourceTree = ""; 67 | }; 68 | C99C665615B435C90092A9B4 /* Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | C99C665715B435C90092A9B4 /* Foundation.framework */, 72 | C99C666615B435C90092A9B4 /* SenTestingKit.framework */, 73 | C99C668015B436C30092A9B4 /* UIKit.framework */, 74 | ); 75 | name = Frameworks; 76 | sourceTree = ""; 77 | }; 78 | C99C665915B435C90092A9B4 /* XcodeTest */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | C99C665B15B435C90092A9B4 /* XcodeTest-Prefix.pch */, 82 | C99C665E15B435C90092A9B4 /* SGXcodeTest.m */, 83 | ); 84 | name = XcodeTest; 85 | sourceTree = SOURCE_ROOT; 86 | }; 87 | /* End PBXGroup section */ 88 | 89 | /* Begin PBXNativeTarget section */ 90 | C99C665315B435C90092A9B4 /* XcodeTest */ = { 91 | isa = PBXNativeTarget; 92 | buildConfigurationList = C99C667915B435C90092A9B4 /* Build configuration list for PBXNativeTarget "XcodeTest" */; 93 | buildPhases = ( 94 | C99C665015B435C90092A9B4 /* Sources */, 95 | C99C665115B435C90092A9B4 /* Frameworks */, 96 | C99C665215B435C90092A9B4 /* CopyFiles */, 97 | ); 98 | buildRules = ( 99 | ); 100 | dependencies = ( 101 | ); 102 | name = XcodeTest; 103 | productName = Triumph; 104 | productReference = C99C665415B435C90092A9B4 /* libXcodeTest.a */; 105 | productType = "com.apple.product-type.library.static"; 106 | }; 107 | /* End PBXNativeTarget section */ 108 | 109 | /* Begin PBXProject section */ 110 | C99C664B15B435C90092A9B4 /* Project object */ = { 111 | isa = PBXProject; 112 | attributes = { 113 | LastUpgradeCheck = 0450; 114 | ORGANIZATIONNAME = "Stewart Gleadow"; 115 | }; 116 | buildConfigurationList = C99C664E15B435C90092A9B4 /* Build configuration list for PBXProject "XcodeTest" */; 117 | compatibilityVersion = "Xcode 3.2"; 118 | developmentRegion = English; 119 | hasScannedForEncodings = 0; 120 | knownRegions = ( 121 | en, 122 | ); 123 | mainGroup = C99C664915B435C90092A9B4; 124 | productRefGroup = C99C665515B435C90092A9B4 /* Products */; 125 | projectDirPath = ""; 126 | projectRoot = ""; 127 | targets = ( 128 | C99C665315B435C90092A9B4 /* XcodeTest */, 129 | ); 130 | }; 131 | /* End PBXProject section */ 132 | 133 | /* Begin PBXSourcesBuildPhase section */ 134 | C99C665015B435C90092A9B4 /* Sources */ = { 135 | isa = PBXSourcesBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | C99C667F15B436930092A9B4 /* SGXcodeTest.m in Sources */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXSourcesBuildPhase section */ 143 | 144 | /* Begin XCBuildConfiguration section */ 145 | C99C667715B435C90092A9B4 /* Debug */ = { 146 | isa = XCBuildConfiguration; 147 | buildSettings = { 148 | ALWAYS_SEARCH_USER_PATHS = NO; 149 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 150 | CLANG_ENABLE_OBJC_ARC = YES; 151 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 152 | COPY_PHASE_STRIP = NO; 153 | GCC_C_LANGUAGE_STANDARD = gnu99; 154 | GCC_DYNAMIC_NO_PIC = NO; 155 | GCC_OPTIMIZATION_LEVEL = 0; 156 | GCC_PREPROCESSOR_DEFINITIONS = ( 157 | "DEBUG=1", 158 | "$(inherited)", 159 | ); 160 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 161 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 162 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 163 | GCC_WARN_UNUSED_VARIABLE = YES; 164 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 165 | SDKROOT = iphoneos; 166 | }; 167 | name = Debug; 168 | }; 169 | C99C667815B435C90092A9B4 /* Release */ = { 170 | isa = XCBuildConfiguration; 171 | buildSettings = { 172 | ALWAYS_SEARCH_USER_PATHS = NO; 173 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 174 | CLANG_ENABLE_OBJC_ARC = YES; 175 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 176 | COPY_PHASE_STRIP = YES; 177 | GCC_C_LANGUAGE_STANDARD = gnu99; 178 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 179 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 180 | GCC_WARN_UNUSED_VARIABLE = YES; 181 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 182 | SDKROOT = iphoneos; 183 | VALIDATE_PRODUCT = YES; 184 | }; 185 | name = Release; 186 | }; 187 | C99C667A15B435C90092A9B4 /* Debug */ = { 188 | isa = XCBuildConfiguration; 189 | buildSettings = { 190 | DSTROOT = "$(PROJECT_DIR)/../"; 191 | FRAMEWORK_SEARCH_PATHS = ( 192 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 193 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 194 | ); 195 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 196 | GCC_PREFIX_HEADER = "XcodeTest-Prefix.pch"; 197 | INSTALL_PATH = /; 198 | PRODUCT_NAME = XcodeTest; 199 | SKIP_INSTALL = NO; 200 | }; 201 | name = Debug; 202 | }; 203 | C99C667B15B435C90092A9B4 /* Release */ = { 204 | isa = XCBuildConfiguration; 205 | buildSettings = { 206 | DSTROOT = "$(PROJECT_DIR)/../"; 207 | FRAMEWORK_SEARCH_PATHS = ( 208 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 209 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 210 | ); 211 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 212 | GCC_PREFIX_HEADER = "XcodeTest-Prefix.pch"; 213 | INSTALL_PATH = /; 214 | PRODUCT_NAME = XcodeTest; 215 | SKIP_INSTALL = NO; 216 | }; 217 | name = Release; 218 | }; 219 | /* End XCBuildConfiguration section */ 220 | 221 | /* Begin XCConfigurationList section */ 222 | C99C664E15B435C90092A9B4 /* Build configuration list for PBXProject "XcodeTest" */ = { 223 | isa = XCConfigurationList; 224 | buildConfigurations = ( 225 | C99C667715B435C90092A9B4 /* Debug */, 226 | C99C667815B435C90092A9B4 /* Release */, 227 | ); 228 | defaultConfigurationIsVisible = 0; 229 | defaultConfigurationName = Release; 230 | }; 231 | C99C667915B435C90092A9B4 /* Build configuration list for PBXNativeTarget "XcodeTest" */ = { 232 | isa = XCConfigurationList; 233 | buildConfigurations = ( 234 | C99C667A15B435C90092A9B4 /* Debug */, 235 | C99C667B15B435C90092A9B4 /* Release */, 236 | ); 237 | defaultConfigurationIsVisible = 0; 238 | defaultConfigurationName = Release; 239 | }; 240 | /* End XCConfigurationList section */ 241 | }; 242 | rootObject = C99C664B15B435C90092A9B4 /* Project object */; 243 | } 244 | -------------------------------------------------------------------------------- /XcodeTest/XcodeTest.xcodeproj/xcshareddata/xcschemes/XcodeTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 52 | 53 | 54 | 55 | 61 | 62 | 64 | 65 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /XcodeTestSample/RunPlatformUnitTests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ## 3 | # Copyright 2008 Apple Inc. 4 | # All rights reserved. 5 | # 6 | # iPhoneSimulator platform 7 | # This script runs all of the unit tests for the target test bundle specified by the passed-in environment. 8 | # This script is generally intended to be invoked by ${DEVELOPER_TOOLS_DIR}/RunUnitTests. The interface or location of this script may change in future releases. 9 | ## 10 | # 11 | # Input: 12 | # See ${DEVELOPER_TOOLS_DIR}/RunUnitTests for input variables 13 | 14 | Message() { 15 | # usage: Message line type message 16 | # Echo the message to stdout as the given type of message and continue 17 | echo "${PLATFORM_DEVELOPER_TOOLS_DIR}/Tools/RunPlatformUnitTests:${1}: ${2}: ${3}" 18 | } 19 | 20 | Note() { 21 | # usage: Notify line message 22 | # Echo the message to stdout as a note and continue 23 | Message "${1}" note "${2}" 24 | } 25 | 26 | Warning() { 27 | # usage: Warning line message 28 | # Echo the message to stdout as a note and continue 29 | Message "${1}" warning "${2}" 30 | } 31 | 32 | Error() { 33 | # usage: Notify line message 34 | # Echo the message to stdout as an error and continue 35 | Message "${1}" error "${2}" 36 | } 37 | 38 | Fail() { 39 | # usage: Fail line message 40 | # Echo the message to stdout and return 1, the universal error code 41 | Error "${1}" "${2}" 42 | exit 1 43 | } 44 | 45 | ### Do not run tests on anything but a "build". 46 | 47 | if [ "${ACTION}" != "build" ]; then 48 | exit 0 49 | fi 50 | 51 | ### Silently skip tests if TEST_AFTER_BUILD is NO 52 | 53 | if [ "${TEST_AFTER_BUILD}" = "NO" ]; then 54 | exit 0 55 | fi 56 | 57 | ### Source RunUnitTests.include functionality 58 | 59 | if [ "${DEVELOPER_TOOLS_DIR}" = "" ]; then 60 | Fail ${LINENO} "DEVELOPER_TOOLS_DIR is not set." 61 | fi 62 | 63 | if [ "${PLATFORM_DEVELOPER_TOOLS_DIR}" = "" ]; then 64 | Fail ${LINENO} "PLATFORM_DEVELOPER_TOOLS_DIR is not set." 65 | fi 66 | 67 | includeFile="${DEVELOPER_TOOLS_DIR}/RunPlatformUnitTests.include" 68 | if [ ! -r "${includeFile}" ]; then 69 | Fail ${LINENO} "Cannot read include file ${includeFile}" 70 | fi 71 | 72 | source "${includeFile}" 73 | 74 | if [ 0 != $? ]; then 75 | Fail ${LINENO} "Could not source include file ${includeFile}" 76 | fi 77 | 78 | ### Define a sensible default for the path to the otest 79 | 80 | if [ "${OTEST}" = "" ]; then 81 | OTEST="${SDKROOT}/Developer/usr/bin/otest" 82 | fi 83 | 84 | Main() { 85 | # usage: Main 86 | # Determine how tests need to be run and run them. 87 | 88 | # GC not supported by the simulator 89 | TEST_GC_STATES="OFF" 90 | 91 | Configure_TEST_ARCHS 92 | 93 | if [ "${TEST_HOST}" != "" ]; then 94 | 95 | # SG changed based on this post: 96 | # http://longweekendmobile.com/2011/04/17/xcode4-running-application-tests-from-the-command-line-in-ios/ 97 | #Warning ${LINENO} "Skipping tests; the iPhoneSimulator platform does not currently support application-hosted tests (TEST_HOST set)." 98 | export OTHER_TEST_FLAGS="-RegisterForSystemEvents" 99 | RunTestsForApplication "${TEST_HOST}" "${TEST_BUNDLE_PATH}" 100 | else 101 | # If no TEST_HOST is specified, assume we're running the test bundle. 102 | 103 | RunTestsForBundle "${TEST_BUNDLE_PATH}" 104 | fi 105 | } 106 | 107 | ### Update the dyld environment to support running tests out of the build directory. 108 | 109 | # Sets and exports the following environment variables: 110 | # DYLD_ROOT_PATH 111 | # DYLD_FRAMEWORK_PATH 112 | # DYLD_LIBRARY_PATH 113 | # DYLD_NEW_LOCAL_SHARED_REGIONS 114 | # DYLD_NO_FIX_PREBINDING 115 | 116 | if [ "${DYLD_FRAMEWORK_PATH}" != "" ]; then 117 | DYLD_FRAMEWORK_PATH="${BUILT_PRODUCTS_DIR}:${SDKROOT}${DEVELOPER_LIBRARY_DIR}/Frameworks:${DYLD_FRAMEWORK_PATH}" 118 | else 119 | DYLD_FRAMEWORK_PATH="${BUILT_PRODUCTS_DIR}:${SDKROOT}${DEVELOPER_LIBRARY_DIR}/Frameworks" 120 | fi 121 | 122 | if [ "${DYLD_LIBRARY_PATH}" != "" ]; then 123 | DYLD_LIBRARY_PATH="${BUILT_PRODUCTS_DIR}:${DYLD_LIBRARY_PATH}" 124 | else 125 | DYLD_LIBRARY_PATH="${BUILT_PRODUCTS_DIR}" 126 | fi 127 | 128 | if [ "${DYLD_ROOT_PATH}" != "" ]; then 129 | DYLD_ROOT_PATH="${SDKROOT}:${DYLD_ROOT_PATH}" 130 | else 131 | DYLD_ROOT_PATH="${SDKROOT}" 132 | fi 133 | 134 | DYLD_NEW_LOCAL_SHARED_REGIONS=YES 135 | DYLD_NO_FIX_PREBINDING=YES 136 | IPHONE_SIMULATOR_ROOT=$SDKROOT ## rdar://6528939 137 | CFFIXED_USER_HOME="${HOME}/Library/Application Support/iPhone Simulator/$IPHONESIMULATOR_PLATFORM_VERSION" 138 | 139 | EXPORT_VARS=(DYLD_FRAMEWORK_PATH DYLD_LIBRARY_PATH DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING DYLD_ROOT_PATH IPHONE_SIMULATOR_ROOT CFFIXED_USER_HOME ) 140 | 141 | ### Run the tests 142 | 143 | Main 144 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C90FE86616649C3B00E73469 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65EF15B432FE0092A9B4 /* SenTestingKit.framework */; }; 11 | C90FE86716649C3B00E73469 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65D715B432FD0092A9B4 /* UIKit.framework */; }; 12 | C90FE86816649C3B00E73469 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65D915B432FD0092A9B4 /* Foundation.framework */; }; 13 | C90FE86E16649C3B00E73469 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C90FE86C16649C3B00E73469 /* InfoPlist.strings */; }; 14 | C90FE87116649C3B00E73469 /* XcodeTestSampleLogicTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C90FE87016649C3B00E73469 /* XcodeTestSampleLogicTests.m */; }; 15 | C91E26AF15B7D2AF00CB0AF3 /* XcodeTestSamplePassingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C99C65FC15B432FE0092A9B4 /* XcodeTestSamplePassingTests.m */; }; 16 | C91E26B115B7D2AF00CB0AF3 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65EF15B432FE0092A9B4 /* SenTestingKit.framework */; }; 17 | C91E26B215B7D2AF00CB0AF3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65D715B432FD0092A9B4 /* UIKit.framework */; }; 18 | C91E26B315B7D2AF00CB0AF3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65D915B432FD0092A9B4 /* Foundation.framework */; }; 19 | C91E26B515B7D2AF00CB0AF3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C99C65F815B432FE0092A9B4 /* InfoPlist.strings */; }; 20 | C91E26BC15B7D46500CB0AF3 /* XcodeTestSampleFailingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C91E26BB15B7D46500CB0AF3 /* XcodeTestSampleFailingTests.m */; }; 21 | C99C65D815B432FD0092A9B4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65D715B432FD0092A9B4 /* UIKit.framework */; }; 22 | C99C65DA15B432FD0092A9B4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65D915B432FD0092A9B4 /* Foundation.framework */; }; 23 | C99C65DC15B432FD0092A9B4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65DB15B432FD0092A9B4 /* CoreGraphics.framework */; }; 24 | C99C65E215B432FD0092A9B4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C99C65E015B432FD0092A9B4 /* InfoPlist.strings */; }; 25 | C99C65E415B432FD0092A9B4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C99C65E315B432FD0092A9B4 /* main.m */; }; 26 | C99C65E815B432FE0092A9B4 /* XcodeTestSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C99C65E715B432FE0092A9B4 /* XcodeTestSampleAppDelegate.m */; }; 27 | C99C65F015B432FE0092A9B4 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65EF15B432FE0092A9B4 /* SenTestingKit.framework */; }; 28 | C99C65F115B432FE0092A9B4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65D715B432FD0092A9B4 /* UIKit.framework */; }; 29 | C99C65F215B432FE0092A9B4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C99C65D915B432FD0092A9B4 /* Foundation.framework */; }; 30 | C99C65FA15B432FE0092A9B4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C99C65F815B432FE0092A9B4 /* InfoPlist.strings */; }; 31 | C99C65FD15B432FE0092A9B4 /* XcodeTestSamplePassingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C99C65FC15B432FE0092A9B4 /* XcodeTestSamplePassingTests.m */; }; 32 | C9DD9CED1638C3AA0038B5F4 /* XcodeTestSampleUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = C9DD9CEC1638C3AA0038B5F4 /* XcodeTestSampleUITests.m */; }; 33 | C9DD9CEE1638C3AA0038B5F4 /* XcodeTestSampleUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = C9DD9CEC1638C3AA0038B5F4 /* XcodeTestSampleUITests.m */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | C91E26AD15B7D2AF00CB0AF3 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = C99C65CA15B432FD0092A9B4 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = C99C65D215B432FD0092A9B4; 42 | remoteInfo = TriumphSample; 43 | }; 44 | C99C65F315B432FE0092A9B4 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = C99C65CA15B432FD0092A9B4 /* Project object */; 47 | proxyType = 1; 48 | remoteGlobalIDString = C99C65D215B432FD0092A9B4; 49 | remoteInfo = TriumphSample; 50 | }; 51 | /* End PBXContainerItemProxy section */ 52 | 53 | /* Begin PBXFileReference section */ 54 | C90FE86516649C3B00E73469 /* XcodeTestSampleLogicTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XcodeTestSampleLogicTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | C90FE86B16649C3B00E73469 /* XcodeTestSampleLogicTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XcodeTestSampleLogicTests-Info.plist"; sourceTree = ""; }; 56 | C90FE86D16649C3B00E73469 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | C90FE87016649C3B00E73469 /* XcodeTestSampleLogicTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XcodeTestSampleLogicTests.m; sourceTree = ""; }; 58 | C90FE87216649C3B00E73469 /* XcodeTestSampleLogicTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XcodeTestSampleLogicTests-Prefix.pch"; sourceTree = ""; }; 59 | C91E26B915B7D2AF00CB0AF3 /* XcodeTestSampleFailingTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XcodeTestSampleFailingTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | C91E26BB15B7D46500CB0AF3 /* XcodeTestSampleFailingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XcodeTestSampleFailingTests.m; sourceTree = ""; }; 61 | C99C65D315B432FD0092A9B4 /* XcodeTestSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XcodeTestSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | C99C65D715B432FD0092A9B4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 63 | C99C65D915B432FD0092A9B4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 64 | C99C65DB15B432FD0092A9B4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 65 | C99C65DF15B432FD0092A9B4 /* XcodeTestSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XcodeTestSample-Info.plist"; sourceTree = ""; }; 66 | C99C65E115B432FD0092A9B4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 67 | C99C65E315B432FD0092A9B4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 68 | C99C65E515B432FD0092A9B4 /* XcodeTestSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XcodeTestSample-Prefix.pch"; sourceTree = ""; }; 69 | C99C65E615B432FE0092A9B4 /* XcodeTestSampleAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XcodeTestSampleAppDelegate.h; sourceTree = ""; }; 70 | C99C65E715B432FE0092A9B4 /* XcodeTestSampleAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XcodeTestSampleAppDelegate.m; sourceTree = ""; }; 71 | C99C65EE15B432FE0092A9B4 /* XcodeTestSamplePassingTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XcodeTestSamplePassingTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 72 | C99C65EF15B432FE0092A9B4 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 73 | C99C65F715B432FE0092A9B4 /* XcodeTestSampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XcodeTestSampleTests-Info.plist"; sourceTree = ""; }; 74 | C99C65F915B432FE0092A9B4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 75 | C99C65FC15B432FE0092A9B4 /* XcodeTestSamplePassingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XcodeTestSamplePassingTests.m; sourceTree = ""; }; 76 | C9DD9CEC1638C3AA0038B5F4 /* XcodeTestSampleUITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XcodeTestSampleUITests.m; sourceTree = ""; }; 77 | /* End PBXFileReference section */ 78 | 79 | /* Begin PBXFrameworksBuildPhase section */ 80 | C90FE86116649C3B00E73469 /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | C90FE86616649C3B00E73469 /* SenTestingKit.framework in Frameworks */, 85 | C90FE86716649C3B00E73469 /* UIKit.framework in Frameworks */, 86 | C90FE86816649C3B00E73469 /* Foundation.framework in Frameworks */, 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | C91E26B015B7D2AF00CB0AF3 /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | C91E26B115B7D2AF00CB0AF3 /* SenTestingKit.framework in Frameworks */, 95 | C91E26B215B7D2AF00CB0AF3 /* UIKit.framework in Frameworks */, 96 | C91E26B315B7D2AF00CB0AF3 /* Foundation.framework in Frameworks */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | C99C65D015B432FD0092A9B4 /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | C99C65D815B432FD0092A9B4 /* UIKit.framework in Frameworks */, 105 | C99C65DA15B432FD0092A9B4 /* Foundation.framework in Frameworks */, 106 | C99C65DC15B432FD0092A9B4 /* CoreGraphics.framework in Frameworks */, 107 | ); 108 | runOnlyForDeploymentPostprocessing = 0; 109 | }; 110 | C99C65EA15B432FE0092A9B4 /* Frameworks */ = { 111 | isa = PBXFrameworksBuildPhase; 112 | buildActionMask = 2147483647; 113 | files = ( 114 | C99C65F015B432FE0092A9B4 /* SenTestingKit.framework in Frameworks */, 115 | C99C65F115B432FE0092A9B4 /* UIKit.framework in Frameworks */, 116 | C99C65F215B432FE0092A9B4 /* Foundation.framework in Frameworks */, 117 | ); 118 | runOnlyForDeploymentPostprocessing = 0; 119 | }; 120 | /* End PBXFrameworksBuildPhase section */ 121 | 122 | /* Begin PBXGroup section */ 123 | C90FE86916649C3B00E73469 /* XcodeTestSampleLogicTests */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | C90FE87016649C3B00E73469 /* XcodeTestSampleLogicTests.m */, 127 | C90FE86A16649C3B00E73469 /* Supporting Files */, 128 | ); 129 | path = XcodeTestSampleLogicTests; 130 | sourceTree = ""; 131 | }; 132 | C90FE86A16649C3B00E73469 /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | C90FE86B16649C3B00E73469 /* XcodeTestSampleLogicTests-Info.plist */, 136 | C90FE86C16649C3B00E73469 /* InfoPlist.strings */, 137 | C90FE87216649C3B00E73469 /* XcodeTestSampleLogicTests-Prefix.pch */, 138 | ); 139 | name = "Supporting Files"; 140 | sourceTree = ""; 141 | }; 142 | C99C65C815B432FD0092A9B4 = { 143 | isa = PBXGroup; 144 | children = ( 145 | C99C65DD15B432FD0092A9B4 /* XcodeTestSample */, 146 | C99C65F515B432FE0092A9B4 /* XcodeTestSampleTests */, 147 | C90FE86916649C3B00E73469 /* XcodeTestSampleLogicTests */, 148 | C99C65D615B432FD0092A9B4 /* Frameworks */, 149 | C99C65D415B432FD0092A9B4 /* Products */, 150 | ); 151 | indentWidth = 4; 152 | sourceTree = ""; 153 | tabWidth = 4; 154 | }; 155 | C99C65D415B432FD0092A9B4 /* Products */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | C99C65D315B432FD0092A9B4 /* XcodeTestSample.app */, 159 | C99C65EE15B432FE0092A9B4 /* XcodeTestSamplePassingTests.octest */, 160 | C91E26B915B7D2AF00CB0AF3 /* XcodeTestSampleFailingTests.octest */, 161 | C90FE86516649C3B00E73469 /* XcodeTestSampleLogicTests.octest */, 162 | ); 163 | name = Products; 164 | sourceTree = ""; 165 | }; 166 | C99C65D615B432FD0092A9B4 /* Frameworks */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | C99C65D715B432FD0092A9B4 /* UIKit.framework */, 170 | C99C65D915B432FD0092A9B4 /* Foundation.framework */, 171 | C99C65DB15B432FD0092A9B4 /* CoreGraphics.framework */, 172 | C99C65EF15B432FE0092A9B4 /* SenTestingKit.framework */, 173 | ); 174 | name = Frameworks; 175 | sourceTree = ""; 176 | }; 177 | C99C65DD15B432FD0092A9B4 /* XcodeTestSample */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | C99C65DE15B432FD0092A9B4 /* Supporting Files */, 181 | C99C65E615B432FE0092A9B4 /* XcodeTestSampleAppDelegate.h */, 182 | C99C65E715B432FE0092A9B4 /* XcodeTestSampleAppDelegate.m */, 183 | ); 184 | path = XcodeTestSample; 185 | sourceTree = SOURCE_ROOT; 186 | }; 187 | C99C65DE15B432FD0092A9B4 /* Supporting Files */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | C99C65DF15B432FD0092A9B4 /* XcodeTestSample-Info.plist */, 191 | C99C65E015B432FD0092A9B4 /* InfoPlist.strings */, 192 | C99C65E315B432FD0092A9B4 /* main.m */, 193 | C99C65E515B432FD0092A9B4 /* XcodeTestSample-Prefix.pch */, 194 | ); 195 | name = "Supporting Files"; 196 | sourceTree = ""; 197 | }; 198 | C99C65F515B432FE0092A9B4 /* XcodeTestSampleTests */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | C99C65F615B432FE0092A9B4 /* Supporting Files */, 202 | C99C65FC15B432FE0092A9B4 /* XcodeTestSamplePassingTests.m */, 203 | C91E26BB15B7D46500CB0AF3 /* XcodeTestSampleFailingTests.m */, 204 | C9DD9CEC1638C3AA0038B5F4 /* XcodeTestSampleUITests.m */, 205 | ); 206 | path = XcodeTestSampleTests; 207 | sourceTree = SOURCE_ROOT; 208 | }; 209 | C99C65F615B432FE0092A9B4 /* Supporting Files */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | C99C65F715B432FE0092A9B4 /* XcodeTestSampleTests-Info.plist */, 213 | C99C65F815B432FE0092A9B4 /* InfoPlist.strings */, 214 | ); 215 | name = "Supporting Files"; 216 | sourceTree = ""; 217 | }; 218 | /* End PBXGroup section */ 219 | 220 | /* Begin PBXNativeTarget section */ 221 | C90FE86416649C3B00E73469 /* XcodeTestSampleLogicTests */ = { 222 | isa = PBXNativeTarget; 223 | buildConfigurationList = C90FE87516649C3B00E73469 /* Build configuration list for PBXNativeTarget "XcodeTestSampleLogicTests" */; 224 | buildPhases = ( 225 | C90FE86016649C3B00E73469 /* Sources */, 226 | C90FE86116649C3B00E73469 /* Frameworks */, 227 | C90FE86216649C3B00E73469 /* Resources */, 228 | C90FE86316649C3B00E73469 /* ShellScript */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | ); 234 | name = XcodeTestSampleLogicTests; 235 | productName = XcodeTestSampleLogicTests; 236 | productReference = C90FE86516649C3B00E73469 /* XcodeTestSampleLogicTests.octest */; 237 | productType = "com.apple.product-type.bundle"; 238 | }; 239 | C91E26AB15B7D2AF00CB0AF3 /* XcodeTestSampleFailingTests */ = { 240 | isa = PBXNativeTarget; 241 | buildConfigurationList = C91E26B615B7D2AF00CB0AF3 /* Build configuration list for PBXNativeTarget "XcodeTestSampleFailingTests" */; 242 | buildPhases = ( 243 | C91E26AE15B7D2AF00CB0AF3 /* Sources */, 244 | C91E26B015B7D2AF00CB0AF3 /* Frameworks */, 245 | C91E26B415B7D2AF00CB0AF3 /* Resources */, 246 | C924254E16175C2700E5F418 /* ShellScript */, 247 | C90FE87816649F3800E73469 /* ShellScript */, 248 | ); 249 | buildRules = ( 250 | ); 251 | dependencies = ( 252 | C91E26AC15B7D2AF00CB0AF3 /* PBXTargetDependency */, 253 | ); 254 | name = XcodeTestSampleFailingTests; 255 | productName = TriumphSampleTests; 256 | productReference = C91E26B915B7D2AF00CB0AF3 /* XcodeTestSampleFailingTests.octest */; 257 | productType = "com.apple.product-type.bundle"; 258 | }; 259 | C99C65D215B432FD0092A9B4 /* XcodeTestSample */ = { 260 | isa = PBXNativeTarget; 261 | buildConfigurationList = C99C660015B432FE0092A9B4 /* Build configuration list for PBXNativeTarget "XcodeTestSample" */; 262 | buildPhases = ( 263 | C99C65CF15B432FD0092A9B4 /* Sources */, 264 | C99C65D015B432FD0092A9B4 /* Frameworks */, 265 | C99C65D115B432FD0092A9B4 /* Resources */, 266 | ); 267 | buildRules = ( 268 | ); 269 | dependencies = ( 270 | ); 271 | name = XcodeTestSample; 272 | productName = TriumphSample; 273 | productReference = C99C65D315B432FD0092A9B4 /* XcodeTestSample.app */; 274 | productType = "com.apple.product-type.application"; 275 | }; 276 | C99C65ED15B432FE0092A9B4 /* XcodeTestSamplePassingTests */ = { 277 | isa = PBXNativeTarget; 278 | buildConfigurationList = C99C660315B432FE0092A9B4 /* Build configuration list for PBXNativeTarget "XcodeTestSamplePassingTests" */; 279 | buildPhases = ( 280 | C99C65E915B432FE0092A9B4 /* Sources */, 281 | C99C65EA15B432FE0092A9B4 /* Frameworks */, 282 | C99C65EB15B432FE0092A9B4 /* Resources */, 283 | C924254816175BDC00E5F418 /* ShellScript */, 284 | C90FE87716649CEE00E73469 /* ShellScript */, 285 | ); 286 | buildRules = ( 287 | ); 288 | dependencies = ( 289 | C99C65F415B432FE0092A9B4 /* PBXTargetDependency */, 290 | ); 291 | name = XcodeTestSamplePassingTests; 292 | productName = TriumphSampleTests; 293 | productReference = C99C65EE15B432FE0092A9B4 /* XcodeTestSamplePassingTests.octest */; 294 | productType = "com.apple.product-type.bundle"; 295 | }; 296 | /* End PBXNativeTarget section */ 297 | 298 | /* Begin PBXProject section */ 299 | C99C65CA15B432FD0092A9B4 /* Project object */ = { 300 | isa = PBXProject; 301 | attributes = { 302 | CLASSPREFIX = TR; 303 | LastUpgradeCheck = 0450; 304 | ORGANIZATIONNAME = "Stewart Gleadow"; 305 | }; 306 | buildConfigurationList = C99C65CD15B432FD0092A9B4 /* Build configuration list for PBXProject "XcodeTestSample" */; 307 | compatibilityVersion = "Xcode 3.2"; 308 | developmentRegion = English; 309 | hasScannedForEncodings = 0; 310 | knownRegions = ( 311 | en, 312 | ); 313 | mainGroup = C99C65C815B432FD0092A9B4; 314 | productRefGroup = C99C65D415B432FD0092A9B4 /* Products */; 315 | projectDirPath = ""; 316 | projectRoot = ""; 317 | targets = ( 318 | C99C65D215B432FD0092A9B4 /* XcodeTestSample */, 319 | C99C65ED15B432FE0092A9B4 /* XcodeTestSamplePassingTests */, 320 | C91E26AB15B7D2AF00CB0AF3 /* XcodeTestSampleFailingTests */, 321 | C90FE86416649C3B00E73469 /* XcodeTestSampleLogicTests */, 322 | ); 323 | }; 324 | /* End PBXProject section */ 325 | 326 | /* Begin PBXResourcesBuildPhase section */ 327 | C90FE86216649C3B00E73469 /* Resources */ = { 328 | isa = PBXResourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | C90FE86E16649C3B00E73469 /* InfoPlist.strings in Resources */, 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | }; 335 | C91E26B415B7D2AF00CB0AF3 /* Resources */ = { 336 | isa = PBXResourcesBuildPhase; 337 | buildActionMask = 2147483647; 338 | files = ( 339 | C91E26B515B7D2AF00CB0AF3 /* InfoPlist.strings in Resources */, 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | C99C65D115B432FD0092A9B4 /* Resources */ = { 344 | isa = PBXResourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | C99C65E215B432FD0092A9B4 /* InfoPlist.strings in Resources */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | C99C65EB15B432FE0092A9B4 /* Resources */ = { 352 | isa = PBXResourcesBuildPhase; 353 | buildActionMask = 2147483647; 354 | files = ( 355 | C99C65FA15B432FE0092A9B4 /* InfoPlist.strings in Resources */, 356 | ); 357 | runOnlyForDeploymentPostprocessing = 0; 358 | }; 359 | /* End PBXResourcesBuildPhase section */ 360 | 361 | /* Begin PBXShellScriptBuildPhase section */ 362 | C90FE86316649C3B00E73469 /* ShellScript */ = { 363 | isa = PBXShellScriptBuildPhase; 364 | buildActionMask = 2147483647; 365 | files = ( 366 | ); 367 | inputPaths = ( 368 | ); 369 | outputPaths = ( 370 | ); 371 | runOnlyForDeploymentPostprocessing = 0; 372 | shellPath = /bin/sh; 373 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 374 | showEnvVarsInLog = 0; 375 | }; 376 | C90FE87716649CEE00E73469 /* ShellScript */ = { 377 | isa = PBXShellScriptBuildPhase; 378 | buildActionMask = 2147483647; 379 | files = ( 380 | ); 381 | inputPaths = ( 382 | ); 383 | outputPaths = ( 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | shellPath = /bin/sh; 387 | shellScript = "if [ \"${XCODETEST}\" = \"YES\" ]; then\n ../scripts/RunUnitTests.rb\nfi\n"; 388 | showEnvVarsInLog = 0; 389 | }; 390 | C90FE87816649F3800E73469 /* ShellScript */ = { 391 | isa = PBXShellScriptBuildPhase; 392 | buildActionMask = 2147483647; 393 | files = ( 394 | ); 395 | inputPaths = ( 396 | ); 397 | outputPaths = ( 398 | ); 399 | runOnlyForDeploymentPostprocessing = 0; 400 | shellPath = /bin/sh; 401 | shellScript = "if [ \"${XCODETEST}\" = \"YES\" ]; then\n../scripts/RunUnitTests.rb\nfi\n"; 402 | showEnvVarsInLog = 0; 403 | }; 404 | C924254816175BDC00E5F418 /* ShellScript */ = { 405 | isa = PBXShellScriptBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | ); 409 | inputPaths = ( 410 | ); 411 | outputPaths = ( 412 | ); 413 | runOnlyForDeploymentPostprocessing = 0; 414 | shellPath = /bin/sh; 415 | shellScript = "if [ \"${XCODETEST}\" = \"\" ]; then\n \"${PROJECT_DIR}/RunPlatformUnitTests.sh\"\nfi\n"; 416 | showEnvVarsInLog = 0; 417 | }; 418 | C924254E16175C2700E5F418 /* ShellScript */ = { 419 | isa = PBXShellScriptBuildPhase; 420 | buildActionMask = 2147483647; 421 | files = ( 422 | ); 423 | inputPaths = ( 424 | ); 425 | outputPaths = ( 426 | ); 427 | runOnlyForDeploymentPostprocessing = 0; 428 | shellPath = /bin/sh; 429 | shellScript = "if [ \"${XCODETEST}\" = \"\" ]; then\n\"${PROJECT_DIR}/RunPlatformUnitTests.sh\"\nfi\n"; 430 | showEnvVarsInLog = 0; 431 | }; 432 | /* End PBXShellScriptBuildPhase section */ 433 | 434 | /* Begin PBXSourcesBuildPhase section */ 435 | C90FE86016649C3B00E73469 /* Sources */ = { 436 | isa = PBXSourcesBuildPhase; 437 | buildActionMask = 2147483647; 438 | files = ( 439 | C90FE87116649C3B00E73469 /* XcodeTestSampleLogicTests.m in Sources */, 440 | ); 441 | runOnlyForDeploymentPostprocessing = 0; 442 | }; 443 | C91E26AE15B7D2AF00CB0AF3 /* Sources */ = { 444 | isa = PBXSourcesBuildPhase; 445 | buildActionMask = 2147483647; 446 | files = ( 447 | C9DD9CEE1638C3AA0038B5F4 /* XcodeTestSampleUITests.m in Sources */, 448 | C91E26AF15B7D2AF00CB0AF3 /* XcodeTestSamplePassingTests.m in Sources */, 449 | C91E26BC15B7D46500CB0AF3 /* XcodeTestSampleFailingTests.m in Sources */, 450 | ); 451 | runOnlyForDeploymentPostprocessing = 0; 452 | }; 453 | C99C65CF15B432FD0092A9B4 /* Sources */ = { 454 | isa = PBXSourcesBuildPhase; 455 | buildActionMask = 2147483647; 456 | files = ( 457 | C99C65E415B432FD0092A9B4 /* main.m in Sources */, 458 | C99C65E815B432FE0092A9B4 /* XcodeTestSampleAppDelegate.m in Sources */, 459 | ); 460 | runOnlyForDeploymentPostprocessing = 0; 461 | }; 462 | C99C65E915B432FE0092A9B4 /* Sources */ = { 463 | isa = PBXSourcesBuildPhase; 464 | buildActionMask = 2147483647; 465 | files = ( 466 | C9DD9CED1638C3AA0038B5F4 /* XcodeTestSampleUITests.m in Sources */, 467 | C99C65FD15B432FE0092A9B4 /* XcodeTestSamplePassingTests.m in Sources */, 468 | ); 469 | runOnlyForDeploymentPostprocessing = 0; 470 | }; 471 | /* End PBXSourcesBuildPhase section */ 472 | 473 | /* Begin PBXTargetDependency section */ 474 | C91E26AC15B7D2AF00CB0AF3 /* PBXTargetDependency */ = { 475 | isa = PBXTargetDependency; 476 | target = C99C65D215B432FD0092A9B4 /* XcodeTestSample */; 477 | targetProxy = C91E26AD15B7D2AF00CB0AF3 /* PBXContainerItemProxy */; 478 | }; 479 | C99C65F415B432FE0092A9B4 /* PBXTargetDependency */ = { 480 | isa = PBXTargetDependency; 481 | target = C99C65D215B432FD0092A9B4 /* XcodeTestSample */; 482 | targetProxy = C99C65F315B432FE0092A9B4 /* PBXContainerItemProxy */; 483 | }; 484 | /* End PBXTargetDependency section */ 485 | 486 | /* Begin PBXVariantGroup section */ 487 | C90FE86C16649C3B00E73469 /* InfoPlist.strings */ = { 488 | isa = PBXVariantGroup; 489 | children = ( 490 | C90FE86D16649C3B00E73469 /* en */, 491 | ); 492 | name = InfoPlist.strings; 493 | sourceTree = ""; 494 | }; 495 | C99C65E015B432FD0092A9B4 /* InfoPlist.strings */ = { 496 | isa = PBXVariantGroup; 497 | children = ( 498 | C99C65E115B432FD0092A9B4 /* en */, 499 | ); 500 | name = InfoPlist.strings; 501 | sourceTree = ""; 502 | }; 503 | C99C65F815B432FE0092A9B4 /* InfoPlist.strings */ = { 504 | isa = PBXVariantGroup; 505 | children = ( 506 | C99C65F915B432FE0092A9B4 /* en */, 507 | ); 508 | name = InfoPlist.strings; 509 | sourceTree = ""; 510 | }; 511 | /* End PBXVariantGroup section */ 512 | 513 | /* Begin XCBuildConfiguration section */ 514 | C90FE87316649C3B00E73469 /* Debug */ = { 515 | isa = XCBuildConfiguration; 516 | buildSettings = { 517 | CLANG_CXX_LIBRARY = "libc++"; 518 | CLANG_WARN_EMPTY_BODY = YES; 519 | FRAMEWORK_SEARCH_PATHS = ( 520 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 521 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 522 | ); 523 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 524 | GCC_PREFIX_HEADER = "XcodeTestSampleLogicTests/XcodeTestSampleLogicTests-Prefix.pch"; 525 | INFOPLIST_FILE = "XcodeTestSampleLogicTests/XcodeTestSampleLogicTests-Info.plist"; 526 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 527 | ONLY_ACTIVE_ARCH = YES; 528 | PRODUCT_NAME = "$(TARGET_NAME)"; 529 | WRAPPER_EXTENSION = octest; 530 | }; 531 | name = Debug; 532 | }; 533 | C90FE87416649C3B00E73469 /* Release */ = { 534 | isa = XCBuildConfiguration; 535 | buildSettings = { 536 | CLANG_CXX_LIBRARY = "libc++"; 537 | CLANG_WARN_EMPTY_BODY = YES; 538 | FRAMEWORK_SEARCH_PATHS = ( 539 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 540 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 541 | ); 542 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 543 | GCC_PREFIX_HEADER = "XcodeTestSampleLogicTests/XcodeTestSampleLogicTests-Prefix.pch"; 544 | INFOPLIST_FILE = "XcodeTestSampleLogicTests/XcodeTestSampleLogicTests-Info.plist"; 545 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 546 | PRODUCT_NAME = "$(TARGET_NAME)"; 547 | WRAPPER_EXTENSION = octest; 548 | }; 549 | name = Release; 550 | }; 551 | C91E26B715B7D2AF00CB0AF3 /* Debug */ = { 552 | isa = XCBuildConfiguration; 553 | buildSettings = { 554 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XcodeTestSample.app/XcodeTestSample"; 555 | FRAMEWORK_SEARCH_PATHS = ( 556 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 557 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 558 | ); 559 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 560 | GCC_PREFIX_HEADER = "XcodeTestSample/XcodeTestSample-Prefix.pch"; 561 | INFOPLIST_FILE = "XcodeTestSampleTests/XcodeTestSampleTests-Info.plist"; 562 | PRODUCT_NAME = XcodeTestSampleFailingTests; 563 | TEST_HOST = "$(BUNDLE_LOADER)"; 564 | WRAPPER_EXTENSION = octest; 565 | }; 566 | name = Debug; 567 | }; 568 | C91E26B815B7D2AF00CB0AF3 /* Release */ = { 569 | isa = XCBuildConfiguration; 570 | buildSettings = { 571 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XcodeTestSample.app/XcodeTestSample"; 572 | FRAMEWORK_SEARCH_PATHS = ( 573 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 574 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 575 | ); 576 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 577 | GCC_PREFIX_HEADER = "XcodeTestSample/XcodeTestSample-Prefix.pch"; 578 | INFOPLIST_FILE = "XcodeTestSampleTests/XcodeTestSampleTests-Info.plist"; 579 | PRODUCT_NAME = XcodeTestSampleFailingTests; 580 | TEST_HOST = "$(BUNDLE_LOADER)"; 581 | WRAPPER_EXTENSION = octest; 582 | }; 583 | name = Release; 584 | }; 585 | C99C65FE15B432FE0092A9B4 /* Debug */ = { 586 | isa = XCBuildConfiguration; 587 | buildSettings = { 588 | ALWAYS_SEARCH_USER_PATHS = NO; 589 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 590 | CLANG_ENABLE_OBJC_ARC = YES; 591 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 592 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 593 | COPY_PHASE_STRIP = NO; 594 | GCC_C_LANGUAGE_STANDARD = gnu99; 595 | GCC_DYNAMIC_NO_PIC = NO; 596 | GCC_OPTIMIZATION_LEVEL = 0; 597 | GCC_PREPROCESSOR_DEFINITIONS = ( 598 | "DEBUG=1", 599 | "$(inherited)", 600 | ); 601 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 602 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 603 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 604 | GCC_WARN_UNUSED_VARIABLE = YES; 605 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 606 | SDKROOT = iphoneos; 607 | }; 608 | name = Debug; 609 | }; 610 | C99C65FF15B432FE0092A9B4 /* Release */ = { 611 | isa = XCBuildConfiguration; 612 | buildSettings = { 613 | ALWAYS_SEARCH_USER_PATHS = NO; 614 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 615 | CLANG_ENABLE_OBJC_ARC = YES; 616 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 617 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 618 | COPY_PHASE_STRIP = YES; 619 | GCC_C_LANGUAGE_STANDARD = gnu99; 620 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 621 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 622 | GCC_WARN_UNUSED_VARIABLE = YES; 623 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 624 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 625 | SDKROOT = iphoneos; 626 | VALIDATE_PRODUCT = YES; 627 | }; 628 | name = Release; 629 | }; 630 | C99C660115B432FE0092A9B4 /* Debug */ = { 631 | isa = XCBuildConfiguration; 632 | buildSettings = { 633 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 634 | GCC_PREFIX_HEADER = "XcodeTestSample/XcodeTestSample-Prefix.pch"; 635 | INFOPLIST_FILE = "XcodeTestSample/XcodeTestSample-Info.plist"; 636 | OTHER_LDFLAGS = "$(XCODE_TEST_LDFLAGS)"; 637 | PRODUCT_NAME = XcodeTestSample; 638 | WRAPPER_EXTENSION = app; 639 | }; 640 | name = Debug; 641 | }; 642 | C99C660215B432FE0092A9B4 /* Release */ = { 643 | isa = XCBuildConfiguration; 644 | buildSettings = { 645 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 646 | GCC_PREFIX_HEADER = "XcodeTestSample/XcodeTestSample-Prefix.pch"; 647 | INFOPLIST_FILE = "XcodeTestSample/XcodeTestSample-Info.plist"; 648 | OTHER_LDFLAGS = "$(XCODE_TEST_LDFLAGS)"; 649 | PRODUCT_NAME = XcodeTestSample; 650 | WRAPPER_EXTENSION = app; 651 | }; 652 | name = Release; 653 | }; 654 | C99C660415B432FE0092A9B4 /* Debug */ = { 655 | isa = XCBuildConfiguration; 656 | buildSettings = { 657 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XcodeTestSample.app/XcodeTestSample"; 658 | FRAMEWORK_SEARCH_PATHS = ( 659 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 660 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 661 | ); 662 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 663 | GCC_PREFIX_HEADER = "XcodeTestSample/XcodeTestSample-Prefix.pch"; 664 | INFOPLIST_FILE = "XcodeTestSampleTests/XcodeTestSampleTests-Info.plist"; 665 | PRODUCT_NAME = XcodeTestSamplePassingTests; 666 | TEST_HOST = "$(BUNDLE_LOADER)"; 667 | WRAPPER_EXTENSION = octest; 668 | }; 669 | name = Debug; 670 | }; 671 | C99C660515B432FE0092A9B4 /* Release */ = { 672 | isa = XCBuildConfiguration; 673 | buildSettings = { 674 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XcodeTestSample.app/XcodeTestSample"; 675 | FRAMEWORK_SEARCH_PATHS = ( 676 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 677 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 678 | ); 679 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 680 | GCC_PREFIX_HEADER = "XcodeTestSample/XcodeTestSample-Prefix.pch"; 681 | INFOPLIST_FILE = "XcodeTestSampleTests/XcodeTestSampleTests-Info.plist"; 682 | PRODUCT_NAME = XcodeTestSamplePassingTests; 683 | TEST_HOST = "$(BUNDLE_LOADER)"; 684 | WRAPPER_EXTENSION = octest; 685 | }; 686 | name = Release; 687 | }; 688 | /* End XCBuildConfiguration section */ 689 | 690 | /* Begin XCConfigurationList section */ 691 | C90FE87516649C3B00E73469 /* Build configuration list for PBXNativeTarget "XcodeTestSampleLogicTests" */ = { 692 | isa = XCConfigurationList; 693 | buildConfigurations = ( 694 | C90FE87316649C3B00E73469 /* Debug */, 695 | C90FE87416649C3B00E73469 /* Release */, 696 | ); 697 | defaultConfigurationIsVisible = 0; 698 | }; 699 | C91E26B615B7D2AF00CB0AF3 /* Build configuration list for PBXNativeTarget "XcodeTestSampleFailingTests" */ = { 700 | isa = XCConfigurationList; 701 | buildConfigurations = ( 702 | C91E26B715B7D2AF00CB0AF3 /* Debug */, 703 | C91E26B815B7D2AF00CB0AF3 /* Release */, 704 | ); 705 | defaultConfigurationIsVisible = 0; 706 | defaultConfigurationName = Release; 707 | }; 708 | C99C65CD15B432FD0092A9B4 /* Build configuration list for PBXProject "XcodeTestSample" */ = { 709 | isa = XCConfigurationList; 710 | buildConfigurations = ( 711 | C99C65FE15B432FE0092A9B4 /* Debug */, 712 | C99C65FF15B432FE0092A9B4 /* Release */, 713 | ); 714 | defaultConfigurationIsVisible = 0; 715 | defaultConfigurationName = Release; 716 | }; 717 | C99C660015B432FE0092A9B4 /* Build configuration list for PBXNativeTarget "XcodeTestSample" */ = { 718 | isa = XCConfigurationList; 719 | buildConfigurations = ( 720 | C99C660115B432FE0092A9B4 /* Debug */, 721 | C99C660215B432FE0092A9B4 /* Release */, 722 | ); 723 | defaultConfigurationIsVisible = 0; 724 | defaultConfigurationName = Release; 725 | }; 726 | C99C660315B432FE0092A9B4 /* Build configuration list for PBXNativeTarget "XcodeTestSamplePassingTests" */ = { 727 | isa = XCConfigurationList; 728 | buildConfigurations = ( 729 | C99C660415B432FE0092A9B4 /* Debug */, 730 | C99C660515B432FE0092A9B4 /* Release */, 731 | ); 732 | defaultConfigurationIsVisible = 0; 733 | defaultConfigurationName = Release; 734 | }; 735 | /* End XCConfigurationList section */ 736 | }; 737 | rootObject = C99C65CA15B432FD0092A9B4 /* Project object */; 738 | } 739 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample.xcodeproj/xcshareddata/xcschemes/XcodeTestSample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample.xcodeproj/xcshareddata/xcschemes/XcodeTestSampleFailingTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 28 | 34 | 35 | 36 | 37 | 38 | 43 | 44 | 46 | 52 | 53 | 54 | 55 | 56 | 66 | 67 | 68 | 69 | 75 | 76 | 78 | 79 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample.xcodeproj/xcshareddata/xcschemes/XcodeTestSampleLogicTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 52 | 53 | 54 | 55 | 61 | 62 | 64 | 65 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample.xcodeproj/xcshareddata/xcschemes/XcodeTestSamplePassingTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 67 | 68 | 69 | 70 | 76 | 77 | 79 | 80 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample/XcodeTestSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.stewgleadow.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample/XcodeTestSample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'XcodeTestSample' target in the 'XcodeTestSample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample/XcodeTestSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TRAppDelegate.h 3 | // XcodeTestSample 4 | // 5 | // Created by Stewart Gleadow on 16/07/12. 6 | // Copyright (c) 2012 Stewart Gleadow 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface XcodeTestSampleAppDelegate : UIResponder 29 | 30 | @property (strong, nonatomic) UIWindow *window; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample/XcodeTestSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TRAppDelegate.m 3 | // XcodeTestSample 4 | // 5 | // Created by Stewart Gleadow on 16/07/12. 6 | // Copyright (c) 2012 Stewart Gleadow 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XcodeTestSampleAppDelegate.h" 27 | 28 | @implementation XcodeTestSampleAppDelegate 29 | 30 | @synthesize window = _window; 31 | 32 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 33 | { 34 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 35 | // Override point for customization after application launch. 36 | self.window.backgroundColor = [UIColor whiteColor]; 37 | [self.window makeKeyAndVisible]; 38 | return YES; 39 | } 40 | 41 | - (void)applicationWillResignActive:(UIApplication *)application 42 | { 43 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 44 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 45 | } 46 | 47 | - (void)applicationDidEnterBackground:(UIApplication *)application 48 | { 49 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 50 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 51 | } 52 | 53 | - (void)applicationWillEnterForeground:(UIApplication *)application 54 | { 55 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 56 | } 57 | 58 | - (void)applicationDidBecomeActive:(UIApplication *)application 59 | { 60 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 61 | } 62 | 63 | - (void)applicationWillTerminate:(UIApplication *)application 64 | { 65 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XcodeTestSample 4 | // 5 | // Created by Stewart Gleadow on 16/07/12. 6 | // Copyright (c) 2012 Stewart Gleadow 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | #import "XcodeTestSampleAppDelegate.h" 29 | 30 | int main(int argc, char *argv[]) 31 | { 32 | @autoreleasepool { 33 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([XcodeTestSampleAppDelegate class])); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleLogicTests/XcodeTestSampleLogicTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.stewgleadow.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleLogicTests/XcodeTestSampleLogicTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'XcodeTestSampleLogicTests' target in the 'XcodeTestSampleLogicTests' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleLogicTests/XcodeTestSampleLogicTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XcodeTestSampleLogicTests.m 3 | // XcodeTestSampleLogicTests 4 | // 5 | // Created by Stewart Gleadow on 27/11/12. 6 | // Copyright (c) 2012 Stewart Gleadow. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface XcodeTestSampleLogicTests : SenTestCase 29 | @end 30 | 31 | @implementation XcodeTestSampleLogicTests 32 | 33 | - (void)testSampleThatDoesNotNeedAUIEnvironment 34 | { 35 | STAssertTrue(YES, @"It does do something"); 36 | STAssertEquals((2+2), 4, @"Yep, the basics work"); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleLogicTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleTests/XcodeTestSampleFailingTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XcodeTestSampleFailingTests.m 3 | // XcodeTestSampleTests 4 | // 5 | // Created by Stewart Gleadow on 16/07/12. 6 | // Copyright (c) 2012 Stewart Gleadow 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface XcodeTestSampleFailingTests : SenTestCase 29 | @end 30 | 31 | @implementation XcodeTestSampleFailingTests 32 | 33 | - (void)testSampleThatAlwaysFails 34 | { 35 | STAssertNil(@"but I'm not nil", @"Should be nil"); 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleTests/XcodeTestSamplePassingTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XcodeTestSamplePassingTests.m 3 | // XcodeTestSampleTests 4 | // 5 | // Created by Stewart Gleadow on 16/07/12. 6 | // Copyright (c) 2012 Stewart Gleadow 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface XcodeTestSamplePassingTests : SenTestCase 29 | 30 | @end 31 | 32 | @implementation XcodeTestSamplePassingTests 33 | 34 | - (void)testSampleThatAlwaysPasses 35 | { 36 | STAssertNotNil(@"I'm not nil", @"Should not be nil"); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleTests/XcodeTestSampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.stewgleadow.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleTests/XcodeTestSampleUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XcodeTestSampleUITests.m 3 | // XcodeTestSampleTests 4 | // 5 | // Created by Stewart Gleadow on 16/07/12. 6 | // Copyright (c) 2012 Stewart Gleadow 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface XcodeTestSampleUITests : SenTestCase 29 | @end 30 | 31 | @implementation XcodeTestSampleUITests 32 | 33 | - (void)testSampleThatRequiresTheUIKitEnvironment 34 | { 35 | STAssertNotNil([UIApplication sharedApplication].delegate, @"There should be an app delegate"); 36 | } 37 | 38 | - (void)testSampleThatRequiresUIFontToWork 39 | { 40 | STAssertNotNil([UIFont systemFontOfSize:12], @"Fonts should work"); 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /XcodeTestSample/XcodeTestSampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /build_and_run_unit_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script to compile and run unit tests from the command line 3 | 4 | # The scheme and target name of the main app 5 | MAIN_APP_TARGET="$1" 6 | 7 | # The scheme and target name of the unit tests 8 | UNIT_TEST_TARGET="$2" 9 | 10 | # The path to libXcodeTest.a, if not in current directory 11 | PATH_TO_XCODE_TEST_LIB="$3" 12 | 13 | # Output variable defaults to current directory of not specified 14 | LINK_TO_XCODE_TEST_LIB="" 15 | if [[ "${PATH_TO_XCODE_TEST_LIB}" != "" ]]; then 16 | XCODE_TEST_ABS_LIB_PATH="${PWD}/${PATH_TO_XCODE_TEST_LIB}" 17 | LINK_TO_XCODE_TEST_LIB="-lXcodeTest -L \"${XCODE_TEST_ABS_LIB_PATH}\"" 18 | else 19 | CURRENT_PATH="${PWD}" 20 | LINK_TO_XCODE_TEST_LIB="-lXcodeTest -L\"${CURRENT_PATH}\"" 21 | fi 22 | 23 | # Calculate the variables to feed into the build 24 | OUTPUT_DIR="/tmp/xcodetest/${MAIN_APP_TARGET}" 25 | XCODE_TEST_PATH="${OUTPUT_DIR}/${UNIT_TEST_TARGET}.octest/${UNIT_TEST_TARGET}" 26 | XCODE_TEST_LDFLAGS="-ObjC -framework SenTestingKit ${LINK_TO_XCODE_TEST_LIB} -F \"$\(SDKROOT\)/Developer/Library/Frameworks\"" 27 | 28 | # More reliable if the simulator is not already running 29 | osascript -e 'tell app "iPhone Simulator" to quit' 30 | 31 | # Build the unit tests bundle, so it can be fed into waxsim 32 | echo "=========================" 33 | echo "Building unit test bundle" 34 | echo "=========================" 35 | echo "xcodebuild -sdk iphonesimulator -scheme ${UNIT_TEST_TARGET} build CONFIGURATION_BUILD_DIR=\"${OUTPUT_DIR}\"" 36 | echo "=========================" 37 | xcodebuild -sdk iphonesimulator -scheme "${UNIT_TEST_TARGET}" build CONFIGURATION_BUILD_DIR="${OUTPUT_DIR}" 38 | if [[ $? != 0 ]]; then 39 | echo "Failed to build unit tests!" 40 | exit $? 41 | fi 42 | 43 | # Build the main app, with libXcodeTest.a linked in 44 | echo "===========================" 45 | echo "Building app with xcodetest" 46 | echo "===========================" 47 | echo "xcodebuild -sdk iphonesimulator -scheme ${MAIN_APP_TARGET} build CONFIGURATION_BUILD_DIR=\"${OUTPUT_DIR}\" XCODE_TEST_LDFLAGS=\"${XCODE_TEST_LDFLAGS}\"" 48 | echo "===========================" 49 | xcodebuild -sdk iphonesimulator -scheme "${MAIN_APP_TARGET}" build CONFIGURATION_BUILD_DIR="${OUTPUT_DIR}" XCODE_TEST_LDFLAGS="${XCODE_TEST_LDFLAGS}" 50 | if [[ $? != 0 ]]; then 51 | echo "Failed to build app!" 52 | exit $? 53 | fi 54 | 55 | # Check that waxsim is installed, used to run the app in the simulator 56 | which waxsim 57 | if [[ $? != 0 ]]; then 58 | echo "Could not find 'waxsim', make sure it is installed and try again" 59 | exit $? 60 | fi 61 | 62 | # Warn users that it wont run the tests unless you tweak the linker settings 63 | echo "=================" 64 | echo "If tests do not run, make sure you have included XCODE_TEST_LDFLAGS in your linker flags:" 65 | echo " In xcconfigs: OTHER_LDFLAGS = \$(inherited) \$(XCODE_TEST_LDFLAGS)" 66 | echo " In Xcode: set Other Linker Flags to include \$(XCODE_TEST_LDFLAGS)" 67 | echo "=================" 68 | 69 | # Run the app in the simulator, will automatically load and run unit tests 70 | OUT_FILE="${OUTPUT_DIR}/waxsim.out" 71 | XCODE_TEST_PATH="${XCODE_TEST_PATH}" waxsim "${OUTPUT_DIR}/${MAIN_APP_TARGET}.app" -SenTest All > "${OUT_FILE}" 2>&1 72 | cat "${OUT_FILE}" 73 | osascript -e 'tell app "iPhone Simulator" to quit' 74 | 75 | # if there was a failure, show what waxsim was hiding and crucially return with a non-zero exit code 76 | grep -q ": error:" "$OUT_FILE" 77 | success=`exec grep -c ": error:" $OUT_FILE` 78 | 79 | if [[ $success != 0 ]]; then 80 | echo "=================" 81 | echo "Unit Tests Failed" 82 | echo "=================" 83 | exit 1 84 | else 85 | echo "=================" 86 | echo "Unit Tests Passed" 87 | echo "=================" 88 | fi 89 | -------------------------------------------------------------------------------- /run_sample_failing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Sample script to use the test runner to use XcodeTest 3 | 4 | if [ ! -f libXcodeTest.a ]; then 5 | echo "libXcodeTest.a does not exist in the current directory" 6 | echo "use \"make xcodetest\" to build it" 7 | exit 1 8 | fi 9 | 10 | # To use the script, feed in the scheme names (which are also assumed to match the build target names) 11 | ./build_and_run_unit_tests.sh XcodeTestSample XcodeTestSampleFailingTests 12 | -------------------------------------------------------------------------------- /run_sample_passing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Sample script to use the test runner to use XcodeTest 3 | 4 | if [ ! -f libXcodeTest.a ]; then 5 | echo "libXcodeTest.a does not exist in the current directory" 6 | echo "use \"make xcodetest\" to build it" 7 | exit 1 8 | fi 9 | 10 | # To use the script, feed in the scheme names (which are also assumed to match the build target names) 11 | ./build_and_run_unit_tests.sh XcodeTestSample XcodeTestSamplePassingTests 12 | -------------------------------------------------------------------------------- /scripts/RunUnitTests.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # Run the unit tests in this test bundle. 3 | # Use ios-sim to trigger the unit test 4 | # Reference: http://stackoverflow.com/questions/5403991/xcode-4-run-tests-from-the-command-line-xcodebuild 5 | # Thanks to Tony Arnold for the basis of this script: https://gist.github.com/a46a3efe90544b6a8873 6 | 7 | puts "** Running Kiwi Tests **" 8 | if ENV['TEST_AFTER_BUILD'] != 'YES' 9 | puts "** Not running tests, TEST_AFTER_BUILD is #{ENV['TEST_AFTER_BUILD']}. Set to 'YES' to run tests. **" 10 | exit 0 11 | end 12 | 13 | system %Q{osascript -e 'tell app "iPhone Simulator" to quit'} 14 | 15 | launcher_path = `which ios-sim`.strip 16 | if launcher_path.nil? 17 | puts "Could not find ios-sim on your system." 18 | end 19 | 20 | test_bundle_path = File.join(ENV['BUILT_PRODUCTS_DIR'], "#{ENV['PRODUCT_NAME']}.#{ENV['WRAPPER_EXTENSION']}") 21 | test_output_path = File.join(ENV['BUILD_DIR'], "kiwi-tests.out") 22 | 23 | environment = { 24 | 'DYLD_INSERT_LIBRARIES' => "/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection", 25 | 'XCInjectBundle' => test_bundle_path, 26 | 'XCInjectBundleInto' => ENV["TEST_HOST"] 27 | } 28 | 29 | environment_args = environment.collect { |key, value| "--setenv #{key}=\"#{value}\""}.join(" ") 30 | 31 | app_test_host = File.dirname(ENV["TEST_HOST"]) 32 | 33 | cmd = %Q{#{launcher_path} launch "#{app_test_host}" #{environment_args} --args -SenTest All 2>&1 | tee "#{test_output_path}" } 34 | cmd.gsub! "iphoneos", "iphonesimulator" 35 | puts "** Running command: #{cmd}" 36 | system(cmd) 37 | 38 | check_cmd = %Q{grep -Fq "[FAILED]" "#{test_output_path}"} 39 | found_failures = system check_cmd 40 | completion_status = found_failures ? "FAILED" : "PASSED" 41 | 42 | puts "** Kiwi Tests #{completion_status} **" 43 | unless completion_status 44 | puts "Failures:\n" 45 | system %Q{grep -F "[FAILED]" "#{test_output_path}"} 46 | end 47 | 48 | exit !found_failures 49 | -------------------------------------------------------------------------------- /xcodetest.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | --------------------------------------------------------------------------------