Separate build and test steps in xcode to reduce chance of hitting "Early unexpected exit"
This commit is contained in:
parent
d04a45b8d1
commit
f3f51ece76
|
@ -122,13 +122,18 @@ xctest() {
|
||||||
echo " done"
|
echo " done"
|
||||||
|
|
||||||
# - Run the build and test
|
# - Run the build and test
|
||||||
|
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$IOS_SIM_DEVICE" build || {
|
||||||
|
EXITCODE=$?
|
||||||
|
echo "*** Failure (exit code $EXITCODE). ***"
|
||||||
|
exit $EXITCODE
|
||||||
|
}
|
||||||
if [ -n "$XCPRETTY" ]; then
|
if [ -n "$XCPRETTY" ]; then
|
||||||
log_temp=$(mktemp build.log.XXXXXX)
|
log_temp=$(mktemp build.log.XXXXXX)
|
||||||
if [ -e "$log_temp" ]; then
|
if [ -e "$log_temp" ]; then
|
||||||
rm "$log_temp"
|
rm "$log_temp"
|
||||||
fi
|
fi
|
||||||
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination name="iPhone 5s" build test 2>&1 | tee "$log_temp" | "$XCPRETTY" -c --no-utf --report junit --output build/reports/junit.xml || {
|
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination name="iPhone 5s" test 2>&1 | tee "$log_temp" | "$XCPRETTY" -c --no-utf --report junit --output build/reports/junit.xml || {
|
||||||
EXITCODE=$?
|
EXITCODE=$?
|
||||||
printf "*** Xcode Failure (exit code %s). The full xcode log follows: ***\n\n" "$EXITCODE"
|
printf "*** Xcode Failure (exit code %s). The full xcode log follows: ***\n\n" "$EXITCODE"
|
||||||
cat "$log_temp"
|
cat "$log_temp"
|
||||||
printf "\n\n*** End Xcode Failure ***\n"
|
printf "\n\n*** End Xcode Failure ***\n"
|
||||||
|
@ -136,11 +141,11 @@ xctest() {
|
||||||
}
|
}
|
||||||
rm "$log_temp"
|
rm "$log_temp"
|
||||||
else
|
else
|
||||||
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$IOS_SIM_DEVICE" build test || {
|
xcrun xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$IOS_SIM_DEVICE" test || {
|
||||||
EXITCODE=$?
|
EXITCODE=$?
|
||||||
echo "*** Failure (exit code $EXITCODE). ***"
|
echo "*** Failure (exit code $EXITCODE). ***"
|
||||||
exit $EXITCODE
|
exit $EXITCODE
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue