From f3186cb3bf636d9f138cfe7fa49bf37f546aa092 Mon Sep 17 00:00:00 2001 From: Brian Dorfman Date: Thu, 15 Sep 2016 15:16:06 -0700 Subject: [PATCH] Update travis test scripts for xcode8 --- Tests/installation_tests/carthage/test.sh | 8 +++++++- .../cocoapods/with_frameworks/test.sh | 12 ++++++++---- .../cocoapods/without_frameworks/test.sh | 7 ++++++- Tests/installation_tests/manual_installation/test.sh | 3 ++- ci_scripts/run_tests.sh | 8 +++++--- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Tests/installation_tests/carthage/test.sh b/Tests/installation_tests/carthage/test.sh index 927d928f3b..5999c8647f 100755 --- a/Tests/installation_tests/carthage/test.sh +++ b/Tests/installation_tests/carthage/test.sh @@ -1,7 +1,13 @@ #!/bin/sh +# This causes the script to fail if any subscript fails +set -e +set -o pipefail + echo "Checking test Carthage app..." +gem install xcpretty --no-ri --no-rdoc + TESTDIR="$(cd $(dirname $0); pwd)" cd $TESTDIR @@ -15,4 +21,4 @@ echo "git \"$GIT_REPO\" \"$GIT_BRANCH\"" > "$TESTDIR/Cartfile" carthage bootstrap --platform ios --configuration Debug --no-use-binaries -xctool build -project "$TESTDIR/CarthageTest.xcodeproj" -scheme CarthageTest -sdk iphonesimulator +xcodebuild build -project "${TESTDIR}/CarthageTest.xcodeproj" -scheme CarthageTest -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' | xcpretty -c diff --git a/Tests/installation_tests/cocoapods/with_frameworks/test.sh b/Tests/installation_tests/cocoapods/with_frameworks/test.sh index b5d5ec234f..cc3cc46d67 100755 --- a/Tests/installation_tests/cocoapods/with_frameworks/test.sh +++ b/Tests/installation_tests/cocoapods/with_frameworks/test.sh @@ -1,11 +1,15 @@ #!/bin/sh +# This causes the script to fail if any subscript fails +set -e +set -o pipefail + echo "Checking test CocoaPods app (with frameworks)..." - -gem update cocoapods --no-ri --no-rdoc - cd $(dirname $0) +gem install xcpretty --no-ri --no-rdoc +gem update cocoapods --no-ri --no-rdoc + rm -rf Pods rm -f Podfile.lock -pod install --no-repo-update && xctool build -workspace CocoapodsTest.xcworkspace -scheme CocoapodsTest -sdk iphonesimulator +pod install --no-repo-update && xcodebuild build -workspace CocoapodsTest.xcworkspace -scheme CocoapodsTest -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' | xcpretty -c diff --git a/Tests/installation_tests/cocoapods/without_frameworks/test.sh b/Tests/installation_tests/cocoapods/without_frameworks/test.sh index b28a352087..0c82f736c2 100755 --- a/Tests/installation_tests/cocoapods/without_frameworks/test.sh +++ b/Tests/installation_tests/cocoapods/without_frameworks/test.sh @@ -1,10 +1,15 @@ #!/bin/sh +# This causes the script to fail if any subscript fails +set -e +set -o pipefail + echo "Checking test CocoaPods app..." cd $(dirname $0) +gem install xcpretty --no-ri --no-rdoc gem update cocoapods --no-ri --no-rdoc rm -rf Pods rm -f Podfile.lock -pod install --no-repo-update && xctool build -workspace CocoapodsTest.xcworkspace -scheme CocoapodsTest -sdk iphonesimulator +pod install --no-repo-update && xcodebuild build -workspace CocoapodsTest.xcworkspace -scheme CocoapodsTest -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' | xcpretty -c diff --git a/Tests/installation_tests/manual_installation/test.sh b/Tests/installation_tests/manual_installation/test.sh index 5e8ceec88c..1050969079 100755 --- a/Tests/installation_tests/manual_installation/test.sh +++ b/Tests/installation_tests/manual_installation/test.sh @@ -2,6 +2,7 @@ # This causes the script to fail if any subscript fails set -e +set -o pipefail echo "Checking test manual installation app..." @@ -21,4 +22,4 @@ mkdir $FRAMEWORKDIR cp $BUILDDIR/StripeiOS-Static.zip $FRAMEWORKDIR ditto -xk $FRAMEWORKDIR/StripeiOS-Static.zip $FRAMEWORKDIR -set -o pipefail && xcodebuild test -project "${TESTDIR}/ManualInstallationTest.xcodeproj" -scheme ManualInstallationTest -sdk iphonesimulator | xcpretty -c +xcodebuild test -project "${TESTDIR}/ManualInstallationTest.xcodeproj" -scheme ManualInstallationTest -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' | xcpretty -c diff --git a/ci_scripts/run_tests.sh b/ci_scripts/run_tests.sh index 2850bda13c..782b98d983 100755 --- a/ci_scripts/run_tests.sh +++ b/ci_scripts/run_tests.sh @@ -1,4 +1,6 @@ +set -euf -o pipefail + gem install xcpretty --no-ri --no-rdoc -set -euf -o pipefail && xcodebuild test -workspace Stripe.xcworkspace -scheme "StripeiOS Tests" -configuration Debug -sdk iphonesimulator | xcpretty -c -set -euf -o pipefail && xcodebuild build -workspace Stripe.xcworkspace -scheme "Stripe iOS Example (Simple)" -sdk iphonesimulator | xcpretty -c -set -euf -o pipefail && xcodebuild build -workspace Stripe.xcworkspace -scheme "Stripe iOS Example (Custom)" -sdk iphonesimulator | xcpretty -c +xcodebuild test -workspace Stripe.xcworkspace -scheme "StripeiOS Tests" -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' | xcpretty -c +xcodebuild build -workspace Stripe.xcworkspace -scheme "Stripe iOS Example (Simple)" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' | xcpretty -c +xcodebuild build -workspace Stripe.xcworkspace -scheme "Stripe iOS Example (Custom)" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' | xcpretty -c