From e606ec1e0faef6382eac70876b2d5c7ac9c392b5 Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Mon, 18 Nov 2013 21:36:09 +0100 Subject: [PATCH] * Add XCTest Target * Use xctool --- OpenSSL-for-iOS.xcodeproj/project.pbxproj | 193 +++++++++++++++++- OpenSSL-for-iOS_Tests/FSOpenSSLTests.m | 33 +++ .../OpenSSL-for-iOS_Tests-Info.plist | 22 ++ .../OpenSSL-for-iOS_Tests-Prefix.pch | 10 + .../en.lproj/InfoPlist.strings | 2 + scripts/build-travis.sh | 2 +- 6 files changed, 259 insertions(+), 3 deletions(-) create mode 100644 OpenSSL-for-iOS_Tests/FSOpenSSLTests.m create mode 100644 OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Info.plist create mode 100644 OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Prefix.pch create mode 100644 OpenSSL-for-iOS_Tests/en.lproj/InfoPlist.strings diff --git a/OpenSSL-for-iOS.xcodeproj/project.pbxproj b/OpenSSL-for-iOS.xcodeproj/project.pbxproj index 8c14011..2a179cb 100644 --- a/OpenSSL-for-iOS.xcodeproj/project.pbxproj +++ b/OpenSSL-for-iOS.xcodeproj/project.pbxproj @@ -19,9 +19,24 @@ 533ED32C1528C53B0005C6FA /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED32A1528C53B0005C6FA /* libcrypto.a */; }; 533ED32D1528C53B0005C6FA /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED32B1528C53B0005C6FA /* libssl.a */; }; 534FB2AE180975D700B5F868 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 534FB2AD180975D700B5F868 /* Icons.xcassets */; }; + 53572A4D183AAFFE00B21832 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53572A4C183AAFFE00B21832 /* XCTest.framework */; }; + 53572A4E183AAFFE00B21832 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED3011528C4840005C6FA /* Foundation.framework */; }; + 53572A4F183AAFFE00B21832 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 533ED2FF1528C4840005C6FA /* UIKit.framework */; }; + 53572A55183AAFFE00B21832 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53572A53183AAFFE00B21832 /* InfoPlist.strings */; }; + 53572A57183AAFFE00B21832 /* FSOpenSSLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 53572A56183AAFFE00B21832 /* FSOpenSSLTests.m */; }; D1E978031547EE765CD39AD2 /* FSOpenSSL.m in Sources */ = {isa = PBXBuildFile; fileRef = D1E97EE2A904D58DAE4231E2 /* FSOpenSSL.m */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 53572A59183AAFFE00B21832 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 533ED2F21528C4840005C6FA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 533ED2FA1528C4840005C6FA; + remoteInfo = "OpenSSL-for-iOS"; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 533ED2FB1528C4840005C6FA /* OpenSSL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenSSL.app; sourceTree = BUILT_PRODUCTS_DIR; }; 533ED2FF1528C4840005C6FA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; @@ -40,6 +55,12 @@ 533ED32A1528C53B0005C6FA /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = lib/libcrypto.a; sourceTree = ""; }; 533ED32B1528C53B0005C6FA /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = lib/libssl.a; sourceTree = ""; }; 534FB2AD180975D700B5F868 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = ""; }; + 53572A4B183AAFFE00B21832 /* OpenSSL-for-iOS_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OpenSSL-for-iOS_Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 53572A4C183AAFFE00B21832 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 53572A52183AAFFE00B21832 /* OpenSSL-for-iOS_Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OpenSSL-for-iOS_Tests-Info.plist"; sourceTree = ""; }; + 53572A54183AAFFE00B21832 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 53572A56183AAFFE00B21832 /* FSOpenSSLTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FSOpenSSLTests.m; sourceTree = ""; }; + 53572A58183AAFFE00B21832 /* OpenSSL-for-iOS_Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OpenSSL-for-iOS_Tests-Prefix.pch"; sourceTree = ""; }; D1E979D803ACC127411934DC /* FSOpenSSL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSOpenSSL.h; sourceTree = ""; }; D1E97EE2A904D58DAE4231E2 /* FSOpenSSL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSOpenSSL.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -57,6 +78,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 53572A48183AAFFE00B21832 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 53572A4D183AAFFE00B21832 /* XCTest.framework in Frameworks */, + 53572A4F183AAFFE00B21832 /* UIKit.framework in Frameworks */, + 53572A4E183AAFFE00B21832 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -64,6 +95,7 @@ isa = PBXGroup; children = ( 533ED3051528C4840005C6FA /* OpenSSL-for-iOS */, + 53572A50183AAFFE00B21832 /* OpenSSL-for-iOS_Tests */, 533ED2FE1528C4840005C6FA /* Frameworks */, 533ED2FC1528C4840005C6FA /* Products */, ); @@ -73,6 +105,7 @@ isa = PBXGroup; children = ( 533ED2FB1528C4840005C6FA /* OpenSSL.app */, + 53572A4B183AAFFE00B21832 /* OpenSSL-for-iOS_Tests.xctest */, ); name = Products; sourceTree = ""; @@ -85,6 +118,7 @@ 533ED2FF1528C4840005C6FA /* UIKit.framework */, 533ED3011528C4840005C6FA /* Foundation.framework */, 533ED3031528C4840005C6FA /* CoreGraphics.framework */, + 53572A4C183AAFFE00B21832 /* XCTest.framework */, ); name = Frameworks; sourceTree = ""; @@ -117,6 +151,25 @@ name = "Supporting Files"; sourceTree = ""; }; + 53572A50183AAFFE00B21832 /* OpenSSL-for-iOS_Tests */ = { + isa = PBXGroup; + children = ( + 53572A56183AAFFE00B21832 /* FSOpenSSLTests.m */, + 53572A51183AAFFE00B21832 /* Supporting Files */, + ); + path = "OpenSSL-for-iOS_Tests"; + sourceTree = ""; + }; + 53572A51183AAFFE00B21832 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 53572A52183AAFFE00B21832 /* OpenSSL-for-iOS_Tests-Info.plist */, + 53572A53183AAFFE00B21832 /* InfoPlist.strings */, + 53572A58183AAFFE00B21832 /* OpenSSL-for-iOS_Tests-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -137,6 +190,24 @@ productReference = 533ED2FB1528C4840005C6FA /* OpenSSL.app */; productType = "com.apple.product-type.application"; }; + 53572A4A183AAFFE00B21832 /* OpenSSL-for-iOS_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 53572A5D183AAFFE00B21832 /* Build configuration list for PBXNativeTarget "OpenSSL-for-iOS_Tests" */; + buildPhases = ( + 53572A47183AAFFE00B21832 /* Sources */, + 53572A48183AAFFE00B21832 /* Frameworks */, + 53572A49183AAFFE00B21832 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 53572A5A183AAFFE00B21832 /* PBXTargetDependency */, + ); + name = "OpenSSL-for-iOS_Tests"; + productName = "OpenSSL-for-iOS_Tests"; + productReference = 53572A4B183AAFFE00B21832 /* OpenSSL-for-iOS_Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -145,6 +216,11 @@ attributes = { LastUpgradeCheck = 0430; ORGANIZATIONNAME = Immobilienscout24; + TargetAttributes = { + 53572A4A183AAFFE00B21832 = { + TestTargetID = 533ED2FA1528C4840005C6FA; + }; + }; }; buildConfigurationList = 533ED2F51528C4840005C6FA /* Build configuration list for PBXProject "OpenSSL-for-iOS" */; compatibilityVersion = "Xcode 3.2"; @@ -159,6 +235,7 @@ projectRoot = ""; targets = ( 533ED2FA1528C4840005C6FA /* OpenSSL-for-iOS */, + 53572A4A183AAFFE00B21832 /* OpenSSL-for-iOS_Tests */, ); }; /* End PBXProject section */ @@ -175,6 +252,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 53572A49183AAFFE00B21832 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 53572A55183AAFFE00B21832 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -189,8 +274,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 53572A47183AAFFE00B21832 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 53572A57183AAFFE00B21832 /* FSOpenSSLTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 53572A5A183AAFFE00B21832 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 533ED2FA1528C4840005C6FA /* OpenSSL-for-iOS */; + targetProxy = 53572A59183AAFFE00B21832 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 533ED3081528C4840005C6FA /* InfoPlist.strings */ = { isa = PBXVariantGroup; @@ -216,6 +317,14 @@ name = ViewController_iPad.xib; sourceTree = ""; }; + 53572A53183AAFFE00B21832 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 53572A54183AAFFE00B21832 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -225,7 +334,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -252,7 +360,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; @@ -302,6 +409,80 @@ }; name = Release; }; + 53572A5B183AAFFE00B21832 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/OpenSSL.app/OpenSSL"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = "OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Info.plist"; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 53572A5C183AAFFE00B21832 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/OpenSSL.app/OpenSSL"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_NS_ASSERTIONS = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Prefix.pch"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = "OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -323,6 +504,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 53572A5D183AAFFE00B21832 /* Build configuration list for PBXNativeTarget "OpenSSL-for-iOS_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 53572A5B183AAFFE00B21832 /* Debug */, + 53572A5C183AAFFE00B21832 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; /* End XCConfigurationList section */ }; rootObject = 533ED2F21528C4840005C6FA /* Project object */; diff --git a/OpenSSL-for-iOS_Tests/FSOpenSSLTests.m b/OpenSSL-for-iOS_Tests/FSOpenSSLTests.m new file mode 100644 index 0000000..2782fdf --- /dev/null +++ b/OpenSSL-for-iOS_Tests/FSOpenSSLTests.m @@ -0,0 +1,33 @@ +// +// OpenSSL_for_iOS_Tests.m +// OpenSSL-for-iOS_Tests +// +// Created by Felix Schulze on 18.11.2013. +// Copyright (c) 2013 Felix Schulze . All rights reserved. +// Web: http://www.felixschulze.de +// + +#import +#import "FSOpenSSL.h" + +@interface FSOpenSSLTests : XCTestCase +@end + +@implementation FSOpenSSLTests + +- (void)setUp +{ + [super setUp]; +} + +- (void)tearDown +{ + [super tearDown]; +} + +- (void)testMD5 +{ + XCTAssertEqualObjects([FSOpenSSL md5FromString:@"test string"], @"6f8db599de986fab7a21625b7916589c"); +} + +@end diff --git a/OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Info.plist b/OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Info.plist new file mode 100644 index 0000000..0ddcabc --- /dev/null +++ b/OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + de.felixschulze.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Prefix.pch b/OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Prefix.pch new file mode 100644 index 0000000..3fdee9d --- /dev/null +++ b/OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Prefix.pch @@ -0,0 +1,10 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/OpenSSL-for-iOS_Tests/en.lproj/InfoPlist.strings b/OpenSSL-for-iOS_Tests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/OpenSSL-for-iOS_Tests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/scripts/build-travis.sh b/scripts/build-travis.sh index dcc4180..49909d2 100755 --- a/scripts/build-travis.sh +++ b/scripts/build-travis.sh @@ -1,4 +1,4 @@ #!/bin/sh echo "Build" -xcodebuild -project OpenSSL-for-iOS.xcodeproj \ No newline at end of file +xctool -project OpenSSL-for-iOS.xcodeproj -scheme OpenSSL-for-iOS -sdk iphonesimulator clean build \ No newline at end of file