Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added skeleton for a unit test suite.

The test suite is automatically built when building the main target (Baker).
  • Loading branch information...
commit fcab71ae5f69b909ddc34508a8f9acb5069f90bb 1 parent 53d98cb
@Simbul Simbul authored
View
200 Baker.xcodeproj/project.pbxproj
@@ -25,9 +25,25 @@
BFBACF331274CD38009D9595 /* ios-icon-ipad72.png in Resources */ = {isa = PBXBuildFile; fileRef = BFBACF321274CD38009D9595 /* ios-icon-ipad72.png */; };
BFEC41E61309D9CA00628DF3 /* ios-icon-iphone57.png in Resources */ = {isa = PBXBuildFile; fileRef = BFEC41E51309D9CA00628DF3 /* ios-icon-iphone57.png */; };
BFEC41E81309D9CE00628DF3 /* ios-icon-iphone114.png in Resources */ = {isa = PBXBuildFile; fileRef = BFEC41E71309D9CE00628DF3 /* ios-icon-iphone114.png */; };
+ D281D06913549EF4009F1B11 /* InterceptorWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = F4EC203712862D4D008E94D1 /* InterceptorWindow.m */; };
+ D281D06A13549EF4009F1B11 /* InterceptorWindowTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D281D02E13546BB1009F1B11 /* InterceptorWindowTests.m */; };
+ D281D06B13549F08009F1B11 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
+ D281D06C13549F08009F1B11 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ D281D06D13549F08009F1B11 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
+ D281D06E13549F08009F1B11 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F242ED911FB344D00641757 /* QuartzCore.framework */; };
F4EC203812862D4D008E94D1 /* InterceptorWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = F4EC203712862D4D008E94D1 /* InterceptorWindow.m */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ D281D07D13549F80009F1B11 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = D281D06213549EDC009F1B11 /* UnitTests */;
+ remoteInfo = UnitTests;
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* BakerAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BakerAppDelegate.h; sourceTree = "<group>"; };
@@ -59,6 +75,10 @@
BFBACF321274CD38009D9595 /* ios-icon-ipad72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ios-icon-ipad72.png"; sourceTree = "<group>"; };
BFEC41E51309D9CA00628DF3 /* ios-icon-iphone57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ios-icon-iphone57.png"; sourceTree = "<group>"; };
BFEC41E71309D9CE00628DF3 /* ios-icon-iphone114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ios-icon-iphone114.png"; sourceTree = "<group>"; };
+ D281D02D13546BB1009F1B11 /* InterceptorWindowTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterceptorWindowTests.h; sourceTree = "<group>"; };
+ D281D02E13546BB1009F1B11 /* InterceptorWindowTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InterceptorWindowTests.m; sourceTree = "<group>"; };
+ D281D06313549EDC009F1B11 /* UnitTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
+ D281D06413549EDC009F1B11 /* UnitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UnitTests-Info.plist"; sourceTree = "<group>"; };
F4EC203612862D4D008E94D1 /* InterceptorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterceptorWindow.h; sourceTree = "<group>"; };
F4EC203712862D4D008E94D1 /* InterceptorWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InterceptorWindow.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -76,6 +96,17 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ D281D06013549EDC009F1B11 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D281D06B13549F08009F1B11 /* Foundation.framework in Frameworks */,
+ D281D06C13549F08009F1B11 /* UIKit.framework in Frameworks */,
+ D281D06D13549F08009F1B11 /* CoreGraphics.framework in Frameworks */,
+ D281D06E13549F08009F1B11 /* QuartzCore.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -101,6 +132,7 @@
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* Baker.app */,
+ D281D06313549EDC009F1B11 /* UnitTests.octest */,
);
name = Products;
sourceTree = "<group>";
@@ -108,12 +140,14 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
+ D281CE9B13545C0E009F1B11 /* Tests */,
BF2F993F1269379900E356EF /* book */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
+ D281D06413549EDC009F1B11 /* UnitTests-Info.plist */,
);
name = CustomTemplate;
sourceTree = "<group>";
@@ -166,6 +200,15 @@
path = minizip;
sourceTree = "<group>";
};
+ D281CE9B13545C0E009F1B11 /* Tests */ = {
+ isa = PBXGroup;
+ children = (
+ D281D02D13546BB1009F1B11 /* InterceptorWindowTests.h */,
+ D281D02E13546BB1009F1B11 /* InterceptorWindowTests.m */,
+ );
+ name = Tests;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -180,12 +223,31 @@
buildRules = (
);
dependencies = (
+ D281D07E13549F80009F1B11 /* PBXTargetDependency */,
);
name = Baker;
productName = Baker;
productReference = 1D6058910D05DD3D006BFB54 /* Baker.app */;
productType = "com.apple.product-type.application";
};
+ D281D06213549EDC009F1B11 /* UnitTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D281D06813549EDD009F1B11 /* Build configuration list for PBXNativeTarget "UnitTests" */;
+ buildPhases = (
+ D281D05E13549EDC009F1B11 /* Resources */,
+ D281D05F13549EDC009F1B11 /* Sources */,
+ D281D06013549EDC009F1B11 /* Frameworks */,
+ D281D06113549EDC009F1B11 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = UnitTests;
+ productName = UnitTests;
+ productReference = D281D06313549EDC009F1B11 /* UnitTests.octest */;
+ productType = "com.apple.product-type.bundle";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -206,6 +268,7 @@
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* Baker */,
+ D281D06213549EDC009F1B11 /* UnitTests */,
);
};
/* End PBXProject section */
@@ -222,8 +285,31 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ D281D05E13549EDC009F1B11 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
+/* Begin PBXShellScriptBuildPhase section */
+ D281D06113549EDC009F1B11 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
+ };
+/* End PBXShellScriptBuildPhase section */
+
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
@@ -242,8 +328,25 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ D281D05F13549EDC009F1B11 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D281D06913549EF4009F1B11 /* InterceptorWindow.m in Sources */,
+ D281D06A13549EF4009F1B11 /* InterceptorWindowTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ D281D07E13549F80009F1B11 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = D281D06213549EDC009F1B11 /* UnitTests */;
+ targetProxy = D281D07D13549F80009F1B11 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
@@ -330,6 +433,93 @@
};
name = Release;
};
+ D281D06513549EDC009F1B11 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
+ COPY_PHASE_STRIP = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "\"$(SDKROOT)/Developer/Library/Frameworks\"",
+ "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
+ );
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ INFOPLIST_FILE = "UnitTests-Info.plist";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ SenTestingKit,
+ "-framework",
+ UIKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = UnitTests;
+ SDKROOT = iphoneos;
+ WRAPPER_EXTENSION = octest;
+ };
+ name = Debug;
+ };
+ D281D06613549EDC009F1B11 /* Analyze */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
+ FRAMEWORK_SEARCH_PATHS = (
+ "\"$(SDKROOT)/Developer/Library/Frameworks\"",
+ "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
+ );
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ INFOPLIST_FILE = "UnitTests-Info.plist";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ SenTestingKit,
+ "-framework",
+ UIKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = UnitTests;
+ SDKROOT = iphoneos;
+ WRAPPER_EXTENSION = octest;
+ };
+ name = Analyze;
+ };
+ D281D06713549EDC009F1B11 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = (
+ "\"$(SDKROOT)/Developer/Library/Frameworks\"",
+ "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
+ );
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ INFOPLIST_FILE = "UnitTests-Info.plist";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ SenTestingKit,
+ "-framework",
+ UIKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = UnitTests;
+ SDKROOT = iphoneos;
+ WRAPPER_EXTENSION = octest;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -353,6 +543,16 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ D281D06813549EDD009F1B11 /* Build configuration list for PBXNativeTarget "UnitTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D281D06513549EDC009F1B11 /* Debug */,
+ D281D06613549EDC009F1B11 /* Analyze */,
+ D281D06713549EDC009F1B11 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
View
40 InterceptorWindowTests.h
@@ -0,0 +1,40 @@
+//
+// InterceptorWindowTests.h
+// Baker
+//
+// ==========================================================================================
+//
+// Copyright (c) 2010, Davide Casali, Marco Colombo, Alessandro Morandi
+// 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 <ORGANIZATION> 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
+//
+
+#import <SenTestingKit/SenTestingKit.h>
+#import <UIKit/UIKit.h>
+
+
+@interface InterceptorWindowTests : SenTestCase {
+
+}
+
+@end
View
47 InterceptorWindowTests.m
@@ -0,0 +1,47 @@
+//
+// InterceptorWindowTests.m
+// Baker
+//
+// ==========================================================================================
+//
+// Copyright (c) 2010, Davide Casali, Marco Colombo, Alessandro Morandi
+// 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 <ORGANIZATION> 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
+//
+
+#import "InterceptorWindowTests.h"
+#import "InterceptorWindow.h"
+
+@implementation InterceptorWindowTests
+
+- (void) testInitInterceptorWindow {
+ UIWindow *iWindow = [[InterceptorWindow alloc] initWithFrame:CGRectMake(0,0,100,100)];
+ STAssertNotNil(iWindow, @"Failed to initialize InterceptorWindow");
+}
+
+// Uncomment this to force a failure
+//- (void) testFail {
+// STFail(@"Must fail to succeed");
+//}
+
+@end
View
20 UnitTests-Info.plist
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+</dict>
+</plist>
Please sign in to comment.
Something went wrong with that request. Please try again.