Skip to content

Commit

Permalink
add simulator timeout hacks for iOS tests
Browse files Browse the repository at this point in the history
ensure simulator is launched w/ the desired device (as specified in
xcodebuild -destination argument)
  • Loading branch information
bgerstle committed Jun 20, 2016
1 parent afb0acb commit 3dd74bc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .travis.yml
Expand Up @@ -19,7 +19,18 @@ matrix:
script:
- set -o pipefail
- xcodebuild test -scheme SwiftCheck | xcpretty -c
- xcodebuild test -scheme SwiftCheck-iOS -destination 'platform=iOS Simulator,name=iPad Pro' | xcpretty -c
# -- Start iOS --
- pkill -lf 'Simulator.app'
- iOS_DEVICE_NAME="iPad Pro"
- iOS_RUNTIME_VERSION="9.3"
# !!!: Make sure desired device name & OS version are suitable for the Xcode version installed on osx_image
- SIMULATOR_ID=$(xcrun instruments -s | grep -o "${iOS_DEVICE_NAME} (${iOS_RUNTIME_VERSION}) \[.*\]" | grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$/\1/")
- echo $SIMULATOR_ID
- echo $iOS_DEVICE_NAME
- echo $iOS_RUNTIME_VERSION
- open -b com.apple.iphonesimulator --args -CurrentDeviceUDID $SIMULATOR_ID
- xcodebuild test -scheme SwiftCheck-iOS -destination "platform=iOS Simulator,name=${iOS_DEVICE_NAME},OS=${iOS_RUNTIME_VERSION}" | xcpretty -c
# -- End iOS --
- xcodebuild test -scheme SwiftCheck-tvOS -destination 'platform=tvOS Simulator,name=Apple TV 1080p' | xcpretty -c
- os: linux
language: generic
Expand Down

0 comments on commit 3dd74bc

Please sign in to comment.