aboutsummaryrefslogtreecommitdiff
path: root/travis.sh
diff options
context:
space:
mode:
authorThomas Van Lenten <thomasvl@google.com>2015-11-09 14:21:51 -0500
committerThomas Van Lenten <thomasvl@google.com>2015-11-09 15:06:32 -0500
commit76b61384a2cf6cffcb7b7895b6df18a097682910 (patch)
treeecc4e2569a353bdc955061c914cb838fe565d91c /travis.sh
parenta663afb23bfc7b7f34abfd0ae86b16e128c428ce (diff)
downloadprotobuf-76b61384a2cf6cffcb7b7895b6df18a097682910.tar.gz
protobuf-76b61384a2cf6cffcb7b7895b6df18a097682910.tar.bz2
protobuf-76b61384a2cf6cffcb7b7895b6df18a097682910.zip
Switch ObjC Travis testing to using xctool
xctool is preinstalled on the Travis OS X images and it seems to do better with iOS simulator flake, so use it instead of xcodebuild. xctool also is less chatty compared to xcodebuild, so it makes the logs a little easier to read.
Diffstat (limited to 'travis.sh')
-rwxr-xr-xtravis.sh49
1 files changed, 43 insertions, 6 deletions
diff --git a/travis.sh b/travis.sh
index 3f281e7a..3b6ec336 100755
--- a/travis.sh
+++ b/travis.sh
@@ -129,18 +129,55 @@ internal_install_python_deps() {
fi
}
-build_objectivec_common () {
- # Reused the build script that takes care of configure and then Xcode
- # builds/tests.
- objectivec/DevTools/full_mac_build.sh --core-only "$@"
+internal_objectivec_common () {
+ # Make sure xctool is up to date. Adapted from
+ # http://docs.travis-ci.com/user/osx-ci-environment/
+ # We don't use a before_install because we test multiple OSes.
+ brew update
+ brew outdated xctool || brew upgrade xctool
+ # Reused the build script that takes care of configuring and ensuring things
+ # are up to date.
+ objectivec/DevTools/full_mac_build.sh --core-only --skip-xcode
+}
+
+internal_xctool_debug_and_release() {
+ xctool -configuration Debug "$@"
+ xctool -configuration Release "$@"
}
build_objectivec_ios() {
- build_objectivec_common --skip-xcode-osx
+ internal_objectivec_common
+ # https://github.com/facebook/xctool/issues/509 - unlike xcodebuild, xctool
+ # doesn't support >1 destination, so we have to build first and then run the
+ # tests one destination at a time.
+ internal_xctool_debug_and_release \
+ -project objectivec/ProtocolBuffers_iOS.xcodeproj \
+ -scheme ProtocolBuffers \
+ -sdk iphonesimulator \
+ build-tests
+ IOS_DESTINATIONS=(
+ "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
+ "platform=iOS Simulator,name=iPhone 6,OS=9.1" # 64bit
+ "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit
+ "platform=iOS Simulator,name=iPad Air,OS=9.1" # 64bit
+ )
+ for i in "${IOS_DESTINATIONS[@]}" ; do
+ internal_xctool_debug_and_release \
+ -project objectivec/ProtocolBuffers_iOS.xcodeproj \
+ -scheme ProtocolBuffers \
+ -sdk iphonesimulator \
+ -destination "${i}" \
+ run-tests
+ done
}
build_objectivec_osx() {
- build_objectivec_common --skip-xcode-ios
+ internal_objectivec_common
+ internal_xctool_debug_and_release \
+ -project objectivec/ProtocolBuffers_OSX.xcodeproj \
+ -scheme ProtocolBuffers \
+ -destination "platform=OS X,arch=x86_64" \
+ test
}
build_python() {