run_unit_tests.sh 777 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env bash
  2. #
  3. # Build and run the Trio unit tests, mirroring the CI workflow (.github unit_tests.yml).
  4. #
  5. # Usage:
  6. # scripts/run_unit_tests.sh # run every test
  7. # scripts/run_unit_tests.sh PumpHistoryNativeConversionTests # run a single suite/class
  8. #
  9. # The optional first argument is a test class/@Suite name in TrioTests.
  10. #
  11. # See installed runtimes with: xcrun simctl list runtimes | grep iOS
  12. set -euo pipefail
  13. # Run from the repo root regardless of the caller's working directory.
  14. cd "$(dirname "$0")/.."
  15. DEST='platform=iOS Simulator,name=iPhone 17'
  16. ONLY="${1:+-only-testing:TrioTests/$1}"
  17. xcodebuild test \
  18. -workspace Trio.xcworkspace \
  19. -scheme "Trio Tests" \
  20. -destination "$DEST" \
  21. $ONLY \
  22. 2>&1 | tee xcodebuild.log