test.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env bash
  2. # Copyright 2017 Google
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. # See the License for the specific language governing permissions and
  11. # limitations under the License.
  12. set -euo pipefail
  13. FIRESTORE_DIR=$(dirname "${BASH_SOURCE[0]}")
  14. test_iOS() {
  15. xcodebuild \
  16. -workspace "$FIRESTORE_DIR/Example/Firestore.xcworkspace" \
  17. -scheme Firestore_Tests \
  18. -sdk iphonesimulator \
  19. -destination 'platform=iOS Simulator,name=iPhone 7' \
  20. build \
  21. test \
  22. ONLY_ACTIVE_ARCH=YES \
  23. CODE_SIGNING_REQUIRED=NO \
  24. | xcpretty
  25. xcodebuild \
  26. -workspace "$FIRESTORE_DIR/Example/Firestore.xcworkspace" \
  27. -scheme SwiftBuildTest \
  28. -sdk iphonesimulator \
  29. -destination 'platform=iOS Simulator,name=iPhone 7' \
  30. build \
  31. ONLY_ACTIVE_ARCH=YES \
  32. CODE_SIGNING_REQUIRED=NO \
  33. | xcpretty
  34. }
  35. test_iOS; RESULT=$?
  36. if [[ $RESULT == 65 ]]; then
  37. echo "xcodebuild exited with 65, retrying"
  38. sleep 5
  39. test_iOS; RESULT=$?
  40. fi
  41. exit $RESULT