From 70481e7c080b7ae45221d9cab866779b739619e6 Mon Sep 17 00:00:00 2001 From: jahorton Date: Thu, 20 Feb 2020 09:43:18 +0700 Subject: [PATCH] change(ios): Tweaks test.sh --- ios/test.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/ios/test.sh b/ios/test.sh index b93eff38b6..abe6221aba 100755 --- a/ios/test.sh +++ b/ios/test.sh @@ -1,22 +1,33 @@ +if [ "$#" -ge 1 ]; then + DEVICE=$1 +else + DEVICE="iPhone X" +fi + +echo "Running tests on simulated $DEVICE, iOS $OS_VERSION" + # Allows for easy re-running against different device specs if desired. function run_test() { - if [ "$#" -lt 2 ]; then - echo "Error in test-run configuration: run_test was only given $# arguments, needs 2" + if [ "$#" -lt 1 ]; then + echo "Error in test-run configuration: run_test was given no arguments, needs 1" return fi DEVICE=$1 - VERSION=$2 # a bit of thanks to https://stackoverflow.com/a/37971495. + # + # Note: we don't _have_ to specify the OS version; the Simulator will + # auto-pick what's most current if we don't. Makes CI maintenance + # much less problematic. xcodebuild \ -workspace keymanios.xcworkspace \ -scheme KeymanEngine \ -sdk iphonesimulator \ - -destination "platform=iOS Simulator,name=$DEVICE,OS=$VERSION" \ + -destination "platform=iOS Simulator,name=$DEVICE" \ -only-testing KeymanEngineTests \ test } # Example use. It's a start. -run_test "iPhone SE" "13.2.2" \ No newline at end of file +run_test "$DEVICE" \ No newline at end of file