Merge pull request #680 from realm/larkost/639-report-xctest-errors
better report errors in test/build
This commit is contained in:
commit
537e3824be
|
@ -83,13 +83,21 @@ start_packager() {
|
||||||
xctest() {
|
xctest() {
|
||||||
local dest="$(xcrun simctl list devices | grep -v unavailable | grep -m 1 -o '[0-9A-F\-]\{36\}')"
|
local dest="$(xcrun simctl list devices | grep -v unavailable | grep -m 1 -o '[0-9A-F\-]\{36\}')"
|
||||||
if [ -n "$XCPRETTY" ]; then
|
if [ -n "$XCPRETTY" ]; then
|
||||||
mkdir -p build
|
LOGTEMP=`mktemp build.log.XXXXXX`
|
||||||
xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$dest" build test | tee build/build.log | "$XCPRETTY" -c --no-utf --report junit --output build/reports/junit.xml || {
|
trap "rm $LOGTEMP" EXIT
|
||||||
echo "The raw xcodebuild output is available in build/build.log"
|
xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$dest" build test 2>&1 | tee "$LOGTEMP" | "$XCPRETTY" -c --no-utf --report junit --output build/reports/junit.xml || {
|
||||||
exit 1
|
EXITCODE=$?
|
||||||
|
printf "*** Xcode Failure (exit code $EXITCODE). The full xcode log follows: ***\n\n"
|
||||||
|
cat "$LOGTEMP"
|
||||||
|
printf "\n\n*** End Xcode Failure ***\n"
|
||||||
|
exit $EXITCODE
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$dest" build test
|
xcodebuild -scheme "$1" -configuration "$CONFIGURATION" -sdk iphonesimulator -destination id="$dest" build test || {
|
||||||
|
EXITCODE=$?
|
||||||
|
echo "*** Failure (exit code $EXITCODE). ***"
|
||||||
|
exit $EXITCODE
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue