From c58220701ada0ccca85cd290a57b3e2277537b75 Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Tue, 21 Oct 2014 20:50:13 -0700 Subject: Implement unit tests for message builder and message parsers --- build-mac/mailcore2.xcodeproj/project.pbxproj | 165 ++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) (limited to 'build-mac') diff --git a/build-mac/mailcore2.xcodeproj/project.pbxproj b/build-mac/mailcore2.xcodeproj/project.pbxproj index 0f011a20..1c025752 100755 --- a/build-mac/mailcore2.xcodeproj/project.pbxproj +++ b/build-mac/mailcore2.xcodeproj/project.pbxproj @@ -932,6 +932,9 @@ C6AC110117114DAF00B715B7 /* MCPOPCheckAccountOperation.cc in Sources */ = {isa = PBXBuildFile; fileRef = C6AC10FE17114DAF00B715B7 /* MCPOPCheckAccountOperation.cc */; }; C6AC113417124D0600B715B7 /* MCLibetpanTypes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6AC1131171249DF00B715B7 /* MCLibetpanTypes.h */; }; C6AC113517124D0A00B715B7 /* MCLibetpanTypes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6AC1131171249DF00B715B7 /* MCLibetpanTypes.h */; }; + C6B5AE0719F630B3001352A6 /* unittest.mm in Sources */ = {isa = PBXBuildFile; fileRef = C6B5AE0619F630B3001352A6 /* unittest.mm */; }; + C6B5B09119F6359B001352A6 /* data in Resources */ = {isa = PBXBuildFile; fileRef = C6B5B08F19F63542001352A6 /* data */; }; + C6B5B09219F6FFB5001352A6 /* MailCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6BD288D170BD71100A91AC1 /* MailCore.framework */; }; C6BA2B0C1705F4E6003F0E9E /* MCHTMLRendererCallback.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = C63CD68516BE148B00DB18F1 /* MCHTMLRendererCallback.h */; }; C6BA2B0D1705F4E6003F0E9E /* MCOMultipart.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = C64BB26816FD44C2000DB34C /* MCOMultipart.h */; }; C6BA2B0E1705F4E6003F0E9E /* MCOMessageBuilder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = C64BB25F16FD438F000DB34C /* MCOMessageBuilder.h */; }; @@ -1356,6 +1359,13 @@ remoteGlobalIDString = C6BA2B091705F4E6003F0E9E; remoteInfo = "mailcore2 ios"; }; + C6B5B09519F70093001352A6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C64EA52E169E772200778456 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C6BD288C170BD71100A91AC1; + remoteInfo = "mailcore osx"; + }; C6BD28A4170BD86A00A91AC1 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = C64EA52E169E772200778456 /* Project object */; @@ -2169,6 +2179,12 @@ C6AC10FE17114DAF00B715B7 /* MCPOPCheckAccountOperation.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MCPOPCheckAccountOperation.cc; sourceTree = ""; }; C6AC10FF17114DAF00B715B7 /* MCPOPCheckAccountOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCPOPCheckAccountOperation.h; sourceTree = ""; }; C6AC1131171249DF00B715B7 /* MCLibetpanTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCLibetpanTypes.h; sourceTree = ""; }; + C6B5AE0219F630B3001352A6 /* unittest.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = unittest.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + C6B5AE0519F630B3001352A6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C6B5AE0619F630B3001352A6 /* unittest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = unittest.mm; sourceTree = ""; }; + C6B5AE0F19F6347C001352A6 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + C6B5AE1119F63496001352A6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + C6B5B08F19F63542001352A6 /* data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = data; sourceTree = ""; }; C6BA2C191705F4E6003F0E9E /* libMailCore-ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libMailCore-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; }; C6BD288D170BD71100A91AC1 /* MailCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MailCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C6BD288E170BD71100A91AC1 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; @@ -2331,6 +2347,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6B5ADFF19F630B3001352A6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C6B5B09219F6FFB5001352A6 /* MailCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C6BA2C151705F4E6003F0E9E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2519,6 +2543,7 @@ C64EA545169E78B100778456 /* src */, C64EA7A916A00AF400778456 /* tests */, C6A81BB517068C0600882C15 /* tests-ios */, + C6B5AE0319F630B3001352A6 /* unittest */, C64EA78E169F259200778456 /* Frameworks */, C64EA538169E772200778456 /* Products */, ); @@ -2533,6 +2558,7 @@ C6A81B911706840C00882C15 /* test-ios.app */, C6BD288D170BD71100A91AC1 /* MailCore.framework */, 27780C3A19CF9CD100C77E44 /* MailCore-ios.framework */, + C6B5AE0219F630B3001352A6 /* unittest.xctest */, ); name = Products; sourceTree = ""; @@ -2858,6 +2884,8 @@ C64EA78E169F259200778456 /* Frameworks */ = { isa = PBXGroup; children = ( + C6B5AE1119F63496001352A6 /* Foundation.framework */, + C6B5AE0F19F6347C001352A6 /* Security.framework */, 27780D3419CFA19500C77E44 /* libstdc++.dylib */, 27780C3C19CF9D9800C77E44 /* CFNetwork.framework */, C6ED6D1C17A191BF00A4A14C /* Security.framework */, @@ -2896,6 +2924,25 @@ path = "../tests-ios"; sourceTree = ""; }; + C6B5AE0319F630B3001352A6 /* unittest */ = { + isa = PBXGroup; + children = ( + C6B5B08F19F63542001352A6 /* data */, + C6B5AE0619F630B3001352A6 /* unittest.mm */, + C6B5AE0419F630B3001352A6 /* Supporting Files */, + ); + name = unittest; + path = ../unittest; + sourceTree = ""; + }; + C6B5AE0419F630B3001352A6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C6B5AE0519F630B3001352A6 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; C6BD2890170BD71100A91AC1 /* Other Frameworks */ = { isa = PBXGroup; children = ( @@ -3711,6 +3758,24 @@ productReference = C6A81B911706840C00882C15 /* test-ios.app */; productType = "com.apple.product-type.application"; }; + C6B5AE0119F630B3001352A6 /* unittest */ = { + isa = PBXNativeTarget; + buildConfigurationList = C6B5AE0A19F630B3001352A6 /* Build configuration list for PBXNativeTarget "unittest" */; + buildPhases = ( + C6B5ADFE19F630B3001352A6 /* Sources */, + C6B5ADFF19F630B3001352A6 /* Frameworks */, + C6B5AE0019F630B3001352A6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C6B5B09619F70093001352A6 /* PBXTargetDependency */, + ); + name = unittest; + productName = unittest; + productReference = C6B5AE0219F630B3001352A6 /* unittest.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; C6BA2B091705F4E6003F0E9E /* static mailcore2 ios */ = { isa = PBXNativeTarget; buildConfigurationList = C6BA2C161705F4E6003F0E9E /* Build configuration list for PBXNativeTarget "static mailcore2 ios" */; @@ -3758,6 +3823,11 @@ attributes = { LastUpgradeCheck = 0510; ORGANIZATIONNAME = MailCore; + TargetAttributes = { + C6B5AE0119F630B3001352A6 = { + CreatedOnToolsVersion = 6.0; + }; + }; }; buildConfigurationList = C64EA531169E772200778456 /* Build configuration list for PBXProject "mailcore2" */; compatibilityVersion = "Xcode 3.2"; @@ -3777,6 +3847,7 @@ C6A81B901706840C00882C15 /* test-ios */, C6BD288C170BD71100A91AC1 /* mailcore osx */, 27780C2A19CF9CD100C77E44 /* mailcore ios */, + C6B5AE0119F630B3001352A6 /* unittest */, ); }; /* End PBXProject section */ @@ -3812,6 +3883,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6B5AE0019F630B3001352A6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C6B5B09119F6359B001352A6 /* data in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C6BD288B170BD71100A91AC1 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -4110,6 +4189,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6B5ADFE19F630B3001352A6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C6B5AE0719F630B3001352A6 /* unittest.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C6BA2B981705F4E6003F0E9E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -4336,6 +4423,11 @@ target = C6BA2B091705F4E6003F0E9E /* static mailcore2 ios */; targetProxy = C6A81BB01706852200882C15 /* PBXContainerItemProxy */; }; + C6B5B09619F70093001352A6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C6BD288C170BD71100A91AC1 /* mailcore osx */; + targetProxy = C6B5B09519F70093001352A6 /* PBXContainerItemProxy */; + }; C6BD28A5170BD86A00A91AC1 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = C64EA536169E772200778456 /* static mailcore2 osx */; @@ -4613,6 +4705,70 @@ }; name = Release; }; + C6B5AE0819F630B3001352A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = ../unittest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-framework", + XCTest, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + C6B5AE0919F630B3001352A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = ../unittest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-framework", + XCTest, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; C6BA2C171705F4E6003F0E9E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4749,6 +4905,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C6B5AE0A19F630B3001352A6 /* Build configuration list for PBXNativeTarget "unittest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C6B5AE0819F630B3001352A6 /* Debug */, + C6B5AE0919F630B3001352A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; C6BA2C161705F4E6003F0E9E /* Build configuration list for PBXNativeTarget "static mailcore2 ios" */ = { isa = XCConfigurationList; buildConfigurations = ( -- cgit v1.2.3 From 5216f330753f9f6548def45677286bca028be239 Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Tue, 21 Oct 2014 21:00:15 -0700 Subject: Travis runs unit tests --- .../xcshareddata/xcschemes/unittest.xcscheme | 96 ++++++++++++++++++++++ scripts/travis/script.sh | 32 +++++--- 2 files changed, 115 insertions(+), 13 deletions(-) create mode 100644 build-mac/mailcore2.xcodeproj/xcshareddata/xcschemes/unittest.xcscheme (limited to 'build-mac') diff --git a/build-mac/mailcore2.xcodeproj/xcshareddata/xcschemes/unittest.xcscheme b/build-mac/mailcore2.xcodeproj/xcshareddata/xcschemes/unittest.xcscheme new file mode 100644 index 00000000..e90e0367 --- /dev/null +++ b/build-mac/mailcore2.xcodeproj/xcshareddata/xcschemes/unittest.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/travis/script.sh b/scripts/travis/script.sh index 3473452b..9d52ae19 100755 --- a/scripts/travis/script.sh +++ b/scripts/travis/script.sh @@ -1,33 +1,39 @@ #!/bin/sh set -e +IPHONESDK=iphoneos8.0 +SIMULATORSDK=iphonesimulator8.0 +MACSDK=macosx10.9 + echo Operating system: uname -mkdir -p Externals/prebuilt -cd Externals/prebuilt -git clone --depth=1 https://github.com/MailCore/mailcore2-deps -cd ../.. -cp Externals/prebuilt/mailcore2-deps/prebuilt.list scripts/prebuilt.list -mkdir -p Externals/builds/builds -rsync --exclude=.git -av Externals/prebuilt/mailcore2-deps/ Externals/builds/builds/ +# mkdir -p Externals/prebuilt +# cd Externals/prebuilt +# git clone --depth=1 https://github.com/MailCore/mailcore2-deps +# cd ../.. +# cp Externals/prebuilt/mailcore2-deps/prebuilt.list scripts/prebuilt.list +# mkdir -p Externals/builds/builds +# rsync --exclude=.git -av Externals/prebuilt/mailcore2-deps/ Externals/builds/builds/ if test x"`uname`" = xDarwin ; then echo Building library for iPhoneOS - xctool -project build-mac/mailcore2.xcodeproj -sdk iphoneos8.0 -scheme "static mailcore2 ios" build ARCHS="armv7 armv7s arm64" + xctool -project build-mac/mailcore2.xcodeproj -sdk $IPHONESDK -scheme "static mailcore2 ios" build ARCHS="armv7 armv7s arm64" echo Building library for iPhoneSimulator - xctool -project build-mac/mailcore2.xcodeproj -sdk iphonesimulator8.0 -scheme "static mailcore2 ios" build ARCHS="i386 x86_64" + xctool -project build-mac/mailcore2.xcodeproj -sdk $SIMULATORSDK -scheme "static mailcore2 ios" build ARCHS="i386 x86_64" #echo Link test for iPhoneOS #xcodebuild -project build-mac/mailcore2.xcodeproj -sdk iphoneos7.1 -target "test-ios" CODE_SIGN_IDENTITY="" build echo Link test for iPhoneSimulator - xctool -project build-mac/mailcore2.xcodeproj -sdk iphonesimulator8.0 -scheme "test-ios" build ARCHS="i386 x86_64" + xctool -project build-mac/mailcore2.xcodeproj -sdk $SIMULATORSDK -scheme "test-ios" build ARCHS="i386 x86_64" echo Building library for Mac - xctool -project build-mac/mailcore2.xcodeproj -sdk macosx10.9 -scheme "static mailcore2 osx" build + xctool -project build-mac/mailcore2.xcodeproj -sdk $MACSDK -scheme "static mailcore2 osx" build echo Building framework for Mac - xctool -project build-mac/mailcore2.xcodeproj -sdk macosx10.9 -scheme "mailcore osx" build + xctool -project build-mac/mailcore2.xcodeproj -sdk $MACSDK -scheme "mailcore osx" build echo Link test for Mac - xctool -project build-mac/mailcore2.xcodeproj -sdk macosx10.9 -scheme "tests" build + xctool -project build-mac/mailcore2.xcodeproj -sdk $MACSDK -scheme "tests" build + echo Unit Tests for Mac + xctool -project build-mac/mailcore2.xcodeproj -sdk $MACSDK -scheme "unittest" test fi echo Testing CMake build -- cgit v1.2.3