فهرست منبع

Added minimal tests for Mac framework

Pierre-Olivier Latour 10 سال پیش
والد
کامیت
99cae36644

+ 24 - 0
Frameworks/Tests.m

@@ -0,0 +1,24 @@
+#import <GCDWebServers/GCDWebServers.h>
+#import <XCTest/XCTest.h>
+
+@interface Tests : XCTestCase
+@end
+
+@implementation Tests
+
+- (void)testWebServer {
+  GCDWebServer* server = [[GCDWebServer alloc] init];
+  XCTAssertNotNil(server);
+}
+
+- (void)testDAVServer {
+  GCDWebDAVServer* server = [[GCDWebDAVServer alloc] init];
+  XCTAssertNotNil(server);
+}
+
+- (void)testWebUploader {
+  GCDWebUploader* server = [[GCDWebUploader alloc] init];
+  XCTAssertNotNil(server);
+}
+
+@end

+ 100 - 0
GCDWebServer.xcodeproj/project.pbxproj

@@ -110,6 +110,8 @@
 		E22112991690B7AA0048D2B2 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E22112981690B7AA0048D2B2 /* CFNetwork.framework */; };
 		E221129B1690B7B10048D2B2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E221129A1690B7B10048D2B2 /* UIKit.framework */; };
 		E221129D1690B7BA0048D2B2 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E221129C1690B7BA0048D2B2 /* MobileCoreServices.framework */; };
+		E240392B1BA09207000B7089 /* GCDWebServers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEE28CD11AE004D800F4023C /* GCDWebServers.framework */; };
+		E24039321BA092B7000B7089 /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = E24039311BA092B7000B7089 /* Tests.m */; };
 		E28BAE3418F99C810095C089 /* GCDWebServer.m in Sources */ = {isa = PBXBuildFile; fileRef = E28BAE1718F99C810095C089 /* GCDWebServer.m */; };
 		E28BAE3518F99C810095C089 /* GCDWebServer.m in Sources */ = {isa = PBXBuildFile; fileRef = E28BAE1718F99C810095C089 /* GCDWebServer.m */; };
 		E28BAE3618F99C810095C089 /* GCDWebServerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = E28BAE1918F99C810095C089 /* GCDWebServerConnection.m */; };
@@ -164,6 +166,13 @@
 			remoteGlobalIDString = CEE28CEE1AE0051F00F4023C;
 			remoteInfo = "GCDWebServers (iOS)";
 		};
+		E240392C1BA09207000B7089 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = CEE28CD01AE004D800F4023C;
+			remoteInfo = "GCDWebServers (Mac)";
+		};
 		E274F87A187E77E3009E0582 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
@@ -213,6 +222,8 @@
 		E22112981690B7AA0048D2B2 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
 		E221129A1690B7B10048D2B2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
 		E221129C1690B7BA0048D2B2 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; };
+		E24039251BA09207000B7089 /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+		E24039311BA092B7000B7089 /* Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
 		E28BAE1618F99C810095C089 /* GCDWebServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCDWebServer.h; sourceTree = "<group>"; };
 		E28BAE1718F99C810095C089 /* GCDWebServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GCDWebServer.m; sourceTree = "<group>"; };
 		E28BAE1818F99C810095C089 /* GCDWebServerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCDWebServerConnection.h; sourceTree = "<group>"; };
@@ -304,6 +315,14 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		E24039221BA09207000B7089 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				E240392B1BA09207000B7089 /* GCDWebServers.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
@@ -330,6 +349,7 @@
 				E221125A1690B4DE0048D2B2 /* GCDWebServer.app */,
 				CEE28CD11AE004D800F4023C /* GCDWebServers.framework */,
 				CEE28CEF1AE0051F00F4023C /* GCDWebServers.framework */,
+				E24039251BA09207000B7089 /* Tests.xctest */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -339,6 +359,7 @@
 			children = (
 				CEE28CF31AE0051F00F4023C /* GCDWebServers.h */,
 				CEE28CF21AE0051F00F4023C /* Info.plist */,
+				E24039311BA092B7000B7089 /* Tests.m */,
 			);
 			path = Frameworks;
 			sourceTree = "<group>";
@@ -593,6 +614,23 @@
 			productReference = E221125A1690B4DE0048D2B2 /* GCDWebServer.app */;
 			productType = "com.apple.product-type.application";
 		};
+		E24039241BA09207000B7089 /* Tests (Mac) */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = E240392E1BA09207000B7089 /* Build configuration list for PBXNativeTarget "Tests (Mac)" */;
+			buildPhases = (
+				E24039211BA09207000B7089 /* Sources */,
+				E24039221BA09207000B7089 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				E240392D1BA09207000B7089 /* PBXTargetDependency */,
+			);
+			name = "Tests (Mac)";
+			productName = "GCDWebServers Tests (Mac)";
+			productReference = E24039251BA09207000B7089 /* Tests.xctest */;
+			productType = "com.apple.product-type.bundle.unit-test";
+		};
 /* End PBXNativeTarget section */
 
 /* Begin PBXProject section */
@@ -607,6 +645,9 @@
 					CEE28CEE1AE0051F00F4023C = {
 						CreatedOnToolsVersion = 6.3;
 					};
+					E24039241BA09207000B7089 = {
+						CreatedOnToolsVersion = 6.4;
+					};
 				};
 			};
 			buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "GCDWebServer" */;
@@ -629,6 +670,7 @@
 				E22112591690B4DE0048D2B2 /* GCDWebServer (iOS) */,
 				CEE28CD01AE004D800F4023C /* GCDWebServers (Mac) */,
 				CEE28CEE1AE0051F00F4023C /* GCDWebServers (iOS) */,
+				E24039241BA09207000B7089 /* Tests (Mac) */,
 			);
 		};
 /* End PBXProject section */
@@ -769,6 +811,14 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		E24039211BA09207000B7089 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				E24039321BA092B7000B7089 /* Tests.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXSourcesBuildPhase section */
 
 /* Begin PBXTargetDependency section */
@@ -782,6 +832,11 @@
 			target = CEE28CEE1AE0051F00F4023C /* GCDWebServers (iOS) */;
 			targetProxy = CE54F3951AE84FCA003C110E /* PBXContainerItemProxy */;
 		};
+		E240392D1BA09207000B7089 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = CEE28CD01AE004D800F4023C /* GCDWebServers (Mac) */;
+			targetProxy = E240392C1BA09207000B7089 /* PBXContainerItemProxy */;
+		};
 		E274F87B187E77E3009E0582 /* PBXTargetDependency */ = {
 			isa = PBXTargetDependency;
 			target = 8DD76FA90486AB0100D96B5E /* GCDWebServer (Mac) */;
@@ -956,6 +1011,42 @@
 			};
 			name = Release;
 		};
+		E240392F1BA09207000B7089 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(DEVELOPER_FRAMEWORKS_DIR)",
+					"$(inherited)",
+				);
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
+				PRODUCT_NAME = Tests;
+				SDKROOT = macosx;
+				WARNING_CFLAGS = (
+					"$(inherited)",
+					"-Wno-gnu-zero-variadic-macro-arguments",
+				);
+			};
+			name = Debug;
+		};
+		E24039301BA09207000B7089 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(DEVELOPER_FRAMEWORKS_DIR)",
+					"$(inherited)",
+				);
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
+				PRODUCT_NAME = Tests;
+				SDKROOT = macosx;
+				WARNING_CFLAGS = (
+					"$(inherited)",
+					"-Wno-gnu-zero-variadic-macro-arguments",
+				);
+			};
+			name = Release;
+		};
 		E274F877187E77D8009E0582 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
@@ -1018,6 +1109,15 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
+		E240392E1BA09207000B7089 /* Build configuration list for PBXNativeTarget "Tests (Mac)" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				E240392F1BA09207000B7089 /* Debug */,
+				E24039301BA09207000B7089 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
 		E274F879187E77D8009E0582 /* Build configuration list for PBXAggregateTarget "Build All" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (

+ 10 - 9
GCDWebServer.xcodeproj/xcshareddata/xcschemes/GCDWebServers (Mac).xcscheme

@@ -28,16 +28,17 @@
       shouldUseLaunchSchemeArgsEnv = "YES"
       buildConfiguration = "Debug">
       <Testables>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "E24039241BA09207000B7089"
+               BuildableName = "Tests.xctest"
+               BlueprintName = "Tests (Mac)"
+               ReferencedContainer = "container:GCDWebServer.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
       </Testables>
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "CEE28CD01AE004D800F4023C"
-            BuildableName = "GCDWebServers.framework"
-            BlueprintName = "GCDWebServers (Mac)"
-            ReferencedContainer = "container:GCDWebServer.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
       <AdditionalOptions>
       </AdditionalOptions>
    </TestAction>