Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 33d14f2

Browse files
committed
Use xcpretty in Run-Tests.sh if available
1 parent b060305 commit 33d14f2

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Run-Tests.sh

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash -exu -o pipefail
22

3+
if [[ -f "/usr/local/bin/xcpretty" ]]; then
4+
PRETTYFIER="xcpretty"
5+
else
6+
PRETTYFIER="tee" # Passthrough stdout
7+
fi
8+
39
OSX_SDK="macosx"
410
IOS_SDK="iphonesimulator"
511
TVOS_SDK="appletvsimulator"
@@ -45,7 +51,7 @@ xcodebuild test -scheme "$OSX_TEST_SCHEME" "SYMROOT=$BUILD_DIR"
4551

4652
# Build for OS X for oldest supported deployment target
4753
rm -rf "$BUILD_DIR"
48-
xcodebuild build -sdk "$OSX_SDK" -target "$OSX_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "MACOSX_DEPLOYMENT_TARGET=10.7" > /dev/null
54+
xcodebuild build -sdk "$OSX_SDK" -target "$OSX_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "MACOSX_DEPLOYMENT_TARGET=10.7" | $PRETTYFIER
4955

5056
# Run tests
5157
runTests $PRODUCT "htmlForm" "Tests/HTMLForm"
@@ -59,19 +65,19 @@ runTests $PRODUCT "webServer" "Tests/WebServer-Sample-Movie" "Tests/Sample-Movie
5965

6066
# Build for OS X for current deployment target
6167
rm -rf "$BUILD_DIR"
62-
xcodebuild build -sdk "$OSX_SDK" -target "$OSX_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "MACOSX_DEPLOYMENT_TARGET=$OSX_SDK_VERSION" > /dev/null
68+
xcodebuild build -sdk "$OSX_SDK" -target "$OSX_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "MACOSX_DEPLOYMENT_TARGET=$OSX_SDK_VERSION" | $PRETTYFIER
6369

6470
# Build for iOS for oldest supported deployment target
6571
rm -rf "$BUILD_DIR"
66-
xcodebuild build -sdk "$IOS_SDK" -target "$IOS_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "IPHONEOS_DEPLOYMENT_TARGET=8.0" > /dev/null
72+
xcodebuild build -sdk "$IOS_SDK" -target "$IOS_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "IPHONEOS_DEPLOYMENT_TARGET=8.0" | $PRETTYFIER
6773

6874
# Build for iOS for current deployment target
6975
rm -rf "$BUILD_DIR"
70-
xcodebuild build -sdk "$IOS_SDK" -target "$IOS_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "IPHONEOS_DEPLOYMENT_TARGET=$IOS_SDK_VERSION" > /dev/null
76+
xcodebuild build -sdk "$IOS_SDK" -target "$IOS_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "IPHONEOS_DEPLOYMENT_TARGET=$IOS_SDK_VERSION" | $PRETTYFIER
7177

7278
# Build for tvOS for current deployment target
7379
rm -rf "$BUILD_DIR"
74-
xcodebuild build -sdk "$TVOS_SDK" -target "$TVOS_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "TVOS_DEPLOYMENT_TARGET=$TVOS_SDK_VERSION" > /dev/null
80+
xcodebuild build -sdk "$TVOS_SDK" -target "$TVOS_TARGET" -configuration "$CONFIGURATION" "SYMROOT=$BUILD_DIR" "TVOS_DEPLOYMENT_TARGET=$TVOS_SDK_VERSION" | $PRETTYFIER
7581

7682
# Done
7783
echo "\nAll tests completed successfully!"

0 commit comments

Comments
 (0)