test.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 -eo pipefail
  13. xcodebuild \
  14. -workspace Example/Firebase.xcworkspace \
  15. -scheme AllUnitTests \
  16. -sdk iphonesimulator \
  17. -destination 'platform=iOS Simulator,name=iPhone 7' \
  18. build \
  19. test \
  20. ONLY_ACTIVE_ARCH=YES \
  21. CODE_SIGNING_REQUIRED=NO \
  22. | xcpretty
  23. RESULT=$?
  24. if [ $RESULT == 65 ]; then
  25. echo "xcodebuild exited with 65, retrying"
  26. xcodebuild \
  27. -workspace Example/Firebase.xcworkspace \
  28. -scheme AllUnitTests \
  29. -sdk iphonesimulator \
  30. -destination 'platform=iOS Simulator,name=iPhone 7' \
  31. build \
  32. test \
  33. ONLY_ACTIVE_ARCH=YES \
  34. CODE_SIGNING_REQUIRED=NO \
  35. | xcpretty
  36. else
  37. exit $RESULT
  38. fi