Ver código fonte

Add the CocoaPods integration tests to Travis.

Also hotwires updating ruby as CocoaPods was crashing within a support library.

Fixes #1619
Sergio Campamá 9 anos atrás
pai
commit
f0c1492ef6
3 arquivos alterados com 25 adições e 1 exclusões
  1. 3 0
      .travis.yml
  2. 10 1
      objectivec/Tests/CocoaPods/run_tests.sh
  3. 12 0
      tests.sh

+ 3 - 0
.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

+ 10 - 1
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

+ 12 - 0
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 |