From f0c1492ef6a6ad17ef62d49cd671980742729783 Mon Sep 17 00:00:00 2001 From: Sergio Campamá Date: Tue, 14 Jun 2016 11:26:01 -0700 Subject: Add the CocoaPods integration tests to Travis. Also hotwires updating ruby as CocoaPods was crashing within a support library. Fixes #1619 --- .travis.yml | 3 +++ objectivec/Tests/CocoaPods/run_tests.sh | 11 ++++++++++- tests.sh | 12 ++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 86451edd..46abbb9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ env: - CONFIG=objectivec_ios_debug - CONFIG=objectivec_ios_release - CONFIG=objectivec_osx + - CONFIG=objectivec_cocoapods_integration - CONFIG=python - CONFIG=python_cpp - CONFIG=ruby19 @@ -67,6 +68,8 @@ matrix: env: CONFIG=objectivec_ios_release - os: linux env: CONFIG=objectivec_osx + - os: linux + env: CONFIG=objectivec_cocoapods_integration allow_failures: # These currently do not work on OS X but are being worked on by @haberman. - os: osx diff --git a/objectivec/Tests/CocoaPods/run_tests.sh b/objectivec/Tests/CocoaPods/run_tests.sh index edf0fe81..749f413c 100755 --- a/objectivec/Tests/CocoaPods/run_tests.sh +++ b/objectivec/Tests/CocoaPods/run_tests.sh @@ -119,9 +119,18 @@ do_test() { # Put the right Podfile in place. cp -f "Podfile-${TEST_MODE}" "Podfile" + xcodebuild_args=( "-workspace" "${TEST_NAME}.xcworkspace" "-scheme" "${TEST_NAME}" ) + + # For iOS, if the SDK is not provided it tries to use iphoneos, and the test + # fail on Travis since those machines don't have a Code Signing identity. + if [[ "${TEST_NAME}" == iOS* ]] ; then + xcodebuild_args+=( "-sdk" "iphonesimulator" "ONLY_ACTIVE_ARCH=NO" ) + fi + # Do the work! pod install --verbose - xcodebuild -workspace "${TEST_NAME}.xcworkspace" -scheme "${TEST_NAME}" build + + xcodebuild "${xcodebuild_args[@]}" build # Clear the hook and manually run cleanup. trap - EXIT diff --git a/tests.sh b/tests.sh index cde108fd..72465a7b 100755 --- a/tests.sh +++ b/tests.sh @@ -223,6 +223,17 @@ build_objectivec_osx() { --core-only --skip-xcode-ios } +build_objectivec_cocoapods_integration() { + # First, load the RVM environment in bash, needed to update ruby. + source ~/.rvm/scripts/rvm + # Update ruby to 2.2.3 as the default one crashes with segmentation faults + # when using pod. + rvm use 2.2.3 --install --binary --fuzzy + # Update pod to the latest version. + gem install cocoapods --no-ri --no-rdoc + objectivec/Tests/CocoaPods/run_tests.sh +} + build_python() { internal_build_cpp internal_install_python_deps @@ -304,6 +315,7 @@ Usage: $0 { cpp | objectivec_ios_debug | objectivec_ios_release | objectivec_osx | + objectivec_cocoapods_integration | python | python_cpp | ruby19 | -- cgit v1.2.3