From b6bc7c704a5de01ef35dce5f54dbfc4583dbe904 Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Mon, 29 Aug 2022 15:02:28 +0100
Subject: [PATCH] Update run-tests.sh

---
 run-tests.sh | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/run-tests.sh b/run-tests.sh
index 4e75d7ee..107defb3 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -1,8 +1,21 @@
 #!/bin/sh
 set -e
 
-echo "\n\033[1;32mâ–¶ Running package tests on iOS Simulator...\033[0m"
-set -o pipefail && xcodebuild -scheme 'elixxir-dapps-sdk-swift-Package' -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13' test | ./xcbeautify
+if [ ! -n "$1" ]; then
 
-echo "\n\033[1;32mâ–¶ Running XXMessenger example tests on iOS Simulator...\033[0m"
-set -o pipefail && xcodebuild -workspace 'Examples/xx-messenger/XXMessenger.xcworkspace' -scheme 'XXMessenger' -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13' test | ./xcbeautify
+  echo "\n\033[1;32mâ–¶ Running package tests on iOS Simulator...\033[0m"
+  set -o pipefail && xcodebuild -scheme 'elixxir-dapps-sdk-swift-Package' -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13' test | ./xcbeautify
+
+elif [ "$1" = "examples" ]; then
+
+  echo "\n\033[1;32mâ–¶ Running XXMessenger example tests on iOS Simulator...\033[0m"
+  set -o pipefail && xcodebuild -workspace 'Examples/xx-messenger/XXMessenger.xcworkspace' -scheme 'XXMessenger' -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13' test | ./xcbeautify
+
+else
+
+  echo "Invalid option. Usage:"
+  echo "  run-tests.sh          - Run package tests"
+  echo "  run-tests.sh examples - Run examples tests"
+  exit 1
+
+fi
-- 
GitLab