Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

fixes #830, #880: bring back iOS tests; split OS X & iOS tests #1168

Merged
merged 1 commit into from
Apr 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

[submodule "test/ios/KIF"]
path = test/ios/KIF
url = https://github.com/mapbox/KIF.git
url = https://github.com/kif-framework/KIF.git

[submodule "platform/ios/vendor/SMCalloutView"]
path = platform/ios/vendor/SMCalloutView
Expand Down
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ env:
- IOS_PROFILE_NAME="ios-in-house"
- secure: "nQqSM8rd7OHtV4MqmNqVnkrVHqxKqQsaWRYk4/nPdhbeVWtTtkk0df711LrF1TUtbEPEewHxYUvTZ/UXmwJNeoKdzTHavI8hnatRkgjyxGERPn1il1Otelht9I+LQQHf+plrpRjVWBrNIW0Zox1B3cqn6d3NglpbXrEQ2EjYGNA="
# end iOS code signing
- KIF_SCREENSHOTS="${TRAVIS_BUILD_DIR}/screenshots"

before_install:
- if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then sudo service mysql stop; fi
Expand All @@ -68,6 +69,7 @@ before_install:
- ./scripts/travis_before_install.sh
- if [[ ${TRAVIS_OS_NAME} == "linux" && ${MASON_PLATFORM} != "android" ]]; then export LD_LIBRARY_PATH=`mason prefix mesa 10.4.3`/lib; fi
- if [[ ${TRAVIS_OS_NAME} == "linux" && ${MASON_PLATFORM} != "android" ]]; then glxinfo; fi
- if [[ ${TRAVIS_OS_NAME} == "osx" && ${TEST_OS} == "ios" ]]; then mkdir -p ${KIF_SCREENSHOTS}; fi

install:
- ulimit -c
Expand All @@ -88,6 +90,9 @@ script:
after_script:
- ./scripts/ios_travis/remove-key.sh

after_failure:
- if [[ ${TRAVIS_OS_NAME} == "osx" && ${TEST_OS} == "ios" ]]; then ./scripts/ios_travis/upload_screenshots.sh; fi

notifications:
slack:
secure: HHQYr7sF8M1SzoWSqgKVYtwAgGdLLCyTMsQjFhEEQNYO92ZwURE5s03qWTGH5k8+4Yqn26yrXt3NztLC4JIOpcGervN2mSZyq4dZgFTcWEd61igw0qwSenlwvFfbE1ASK/KYCzfyn9MIfHN+ovwLoRxXZkPwinKDvl3DXjBaFNg=
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ styles/styles:
SMCalloutView:
git submodule update --init platform/ios/vendor/SMCalloutView

KIF:
git submodule update --init test/ios/KIF

#### Library builds ############################################################

.PRECIOUS: Makefile/mbgl
Expand Down Expand Up @@ -129,6 +132,9 @@ isim: Xcode/ios
ipackage: clean Xcode/ios
./scripts/package_ios.sh

itest: ipackage KIF
./scripts/test_ios.sh

# Legacy name
iproj: ios-proj

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ If you merely want to install the library for iOS and try it out as an Objective

If you want to build from source and/or contribute to development of the project, run `make iproj`, which will create and open an Xcode project which can build the entire library from source as well as an Objective-C test app.

You can also run `make itest` to run the included tests. Requires `brew install xcpretty`.

Target devices: iPhone 4S and above (5, 5c, 5s, 6, 6 Plus) and iPad 2 and above (3, 4, Mini, Air, Mini 2, Air 2).

Target iOS: 7.0 through 8.1
Expand Down
13 changes: 13 additions & 0 deletions scripts/ios_travis/upload_screenshots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e
set -o pipefail
set -u

ls $KIF_SCREENSHOTS/

REPO_NAME=$(basename $TRAVIS_REPO_SLUG)

aws s3 cp $KIF_SCREENSHOTS/ s3://mapbox/$REPO_NAME/ios/tests/$TRAVIS_JOB_NUMBER/ --acl public-read --recursive > /dev/null

echo http://mapbox.s3.amazonaws.com/$REPO_NAME/ios/tests/$TRAVIS_JOB_NUMBER/index.html
4 changes: 3 additions & 1 deletion scripts/package_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ export BUILDTYPE=${BUILDTYPE:-Release}
export HOST=ios
make Xcode/mbgl

step "Building iOS targets..."
step "Building iOS device targets..."
xcodebuild -sdk iphoneos${IOS_SDK_VERSION} \
ARCHS="arm64 armv7 armv7s" \
ONLY_ACTIVE_ARCH=NO \
-project ./build/ios/mbgl.xcodeproj \
-configuration ${BUILDTYPE} \
-target everything \
Expand All @@ -45,6 +46,7 @@ xcodebuild -sdk iphoneos${IOS_SDK_VERSION} \
step "Building iOS Simulator targets..."
xcodebuild -sdk iphonesimulator${IOS_SDK_VERSION} \
ARCHS="x86_64 i386" \
ONLY_ACTIVE_ARCH=NO \
-project ./build/ios/mbgl.xcodeproj \
-configuration ${BUILDTYPE} \
-target everything \
Expand Down
16 changes: 16 additions & 0 deletions scripts/test_ios.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -e
set -o pipefail
set -u

xcodebuild \
-project ./test/ios/ios-tests.xcodeproj \
-scheme 'Mapbox GL Tests' \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 5s,OS=7.1' \
-destination 'platform=iOS Simulator,name=iPhone 5s,OS=latest' \
-destination 'platform=iOS Simulator,name=iPad 2,OS=7.1' \
-destination 'platform=iOS Simulator,name=iPad 2,OS=latest' \
test \
| xcpretty
21 changes: 15 additions & 6 deletions scripts/travis_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,24 @@ elif [[ ${TRAVIS_OS_NAME} == "osx" && ${MASON_PLATFORM} == "osx" ]]; then

elif [[ ${TRAVIS_OS_NAME} == "osx" && ${MASON_PLATFORM} == "ios" ]]; then
#
# build & package iOS
#
mapbox_time "package_ios"
make ipackage
#
# conditionally deploy iOS build
# conditionally publish or test
#
if [[ -n "$PUBLISH_TAG" ]]; then
#
# build & package iOS
#
mapbox_time "package_ios"
make ipackage
#
# publish iOS build
#
mapbox_time "deploy_ios"
./scripts/publish_ios.sh "$PUBLISH_VERSION"
else
#
# build & test iOS
#
mapbox_time "run_ios_tests"
make itest
fi
fi
2 changes: 1 addition & 1 deletion test/ios/KIF
Submodule KIF updated 66 files
+4 −1 .travis.yml
+8 −2 Additions/UIAccessibilityElement-KIFAdditions.m
+1 −1 Additions/UIApplication-KIFAdditions.h
+18 −7 Additions/UIApplication-KIFAdditions.m
+19 −0 Additions/UIEvent+KIFAdditions.h
+152 −0 Additions/UIEvent+KIFAdditions.m
+34 −0 Additions/UIView-KIFAdditions.h
+333 −84 Additions/UIView-KIFAdditions.m
+52 −0 Additions/XCTestCase-KIFAdditions.m
+8 −0 Classes/KIFSystemTestActor.h
+23 −5 Classes/KIFSystemTestActor.m
+3 −0 Classes/KIFTestActor.h
+2 −0 Classes/KIFTestActor.m
+37 −28 Classes/KIFTestCase.m
+2 −0 Classes/KIFTypist.h
+43 −147 Classes/KIFTypist.m
+7 −7 Classes/KIFUITestActor-ConditionalTests.h
+58 −7 Classes/KIFUITestActor.h
+237 −65 Classes/KIFUITestActor.m
+17 −0 Classes/UIAutomationHelper.h
+84 −0 Classes/UIAutomationHelper.m
+556 −0 Documentation/Examples/Testable Swift/Testable Swift.xcodeproj/project.pbxproj
+96 −0 Documentation/Examples/Testable Swift/Testable Swift.xcodeproj/xcshareddata/xcschemes/Testable Swift.xcscheme
+15 −0 Documentation/Examples/Testable Swift/Testable Swift/AppDelegate.swift
+41 −0 Documentation/Examples/Testable Swift/Testable Swift/Base.lproj/LaunchScreen.xib
+102 −0 Documentation/Examples/Testable Swift/Testable Swift/Base.lproj/Main.storyboard
+38 −0 Documentation/Examples/Testable Swift/Testable Swift/Images.xcassets/AppIcon.appiconset/Contents.json
+50 −0 Documentation/Examples/Testable Swift/Testable Swift/Info.plist
+19 −0 Documentation/Examples/Testable Swift/Testable Swift/MasterViewController.swift
+24 −0 Documentation/Examples/Testable Swift/Testable SwiftTests/Info.plist
+24 −0 Documentation/Examples/Testable Swift/Testable SwiftTests/SimpleObjCTest.m
+29 −0 Documentation/Examples/Testable Swift/Testable SwiftTests/SimpleSwiftTest.swift
+5 −0 Documentation/Examples/Testable Swift/Testable SwiftTests/Testable SwiftTests-Bridging-Header.h
+37 −0 Documentation/Examples/Testable Swift/Testable SwiftTests/Testable_SwiftTests.swift
+ Documentation/Images/Add Category Linker Flags.png
+ Documentation/Images/Add Library Sheet.png
+ Documentation/Images/Add Library.png
+ Documentation/Images/Added KIF to Project.png
+ Documentation/Images/Simple App.png
+80 −0 IdentifierTests/KIFUITestActor-IdentifierTests.h
+206 −0 IdentifierTests/KIFUITestActor-IdentifierTests.m
+91 −0 KIF Tests/AccessibilityIdentifierTests.m
+1 −1 KIF Tests/CollectionViewTests.m
+1 −1 KIF Tests/LandscapeTests.m
+59 −0 KIF Tests/MultiFingerTests.m
+17 −3 KIF Tests/PickerTests.m
+16 −11 KIF Tests/SpecificControlTests.m
+43 −0 KIF Tests/SystemAlertTests.m
+5 −0 KIF Tests/SystemTests.m
+6 −1 KIF Tests/TableViewTests.m
+25 −2 KIF Tests/TypingTests.m
+31 −0 KIF Tests/WaitForAnimationTests.m
+43 −0 KIF Tests/WebViewTests.m
+10 −3 KIF.podspec
+107 −4 KIF.xcodeproj/project.pbxproj
+123 −78 README.md
+25 −0 Test Host/AnimationViewController.m
+1 −1 Test Host/PickerController.m
+42 −0 Test Host/SystemAlertViewController.m
+19 −1 Test Host/TapViewController.m
+2 −0 Test Host/Test Host-Info.plist
+9 −4 Test Host/TestSuiteViewController.m
+23 −0 Test Host/WebViewController.m
+224 −10 Test Host/en.lproj/MainStoryboard.storyboard
+14 −0 Test Host/index.html
+6 −0 Test Host/page2.html
1 change: 1 addition & 0 deletions test/ios/KIFTestActor+MapboxGL.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import <UIKit/UIKit.h>
#import <KIF/KIF.h>

@class MGLMapView;
Expand Down
5 changes: 3 additions & 2 deletions test/ios/KIFTestActor+MapboxGL.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#import "KIFTestActor+MapboxGL.h"

#import "MapboxGL.h"

#import <KIF/UIApplication-KIFAdditions.h>
#import <KIF/UIAccessibilityElement-KIFAdditions.h>
#import "MGLMapView.h"

@implementation KIFTestActor (MapboxGL)

Expand Down
2 changes: 1 addition & 1 deletion test/ios/MGLTAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

@interface MGLTAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (nonatomic) UIWindow *window;

@end
2 changes: 1 addition & 1 deletion test/ios/MGLTViewController.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "MGLTViewController.h"
#import "MGLMapView.h"
#import "MapboxGL.h"

@implementation MGLTViewController

Expand Down
5 changes: 0 additions & 5 deletions test/ios/MapViewTests.h

This file was deleted.

Loading