mirror of
https://github.com/status-im/react-native.git
synced 2025-01-17 21:11:45 +00:00
3ddf3db551
Summary: - kill -9 SERVER_PID does not work for packager currently because it is started as daemon. - And lego tests just hang until they are killed e.g. intern/sandcastle/1952254070/187417721/ - fixed bezier test because it annoyed me with random breaks because of precision Reviewed By: davidaurelio Differential Revision: D3528588 fbshipit-source-id: 87e5b4330fa69bc9a8a7f48e2250f3c2239f2b35
54 lines
1.3 KiB
Bash
Executable File
54 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
ROOT=$(dirname $SCRIPTS)
|
|
|
|
cd $ROOT
|
|
|
|
function cleanup {
|
|
EXIT_CODE=$?
|
|
set +e
|
|
|
|
if [ $EXIT_CODE -ne 0 ];
|
|
then
|
|
WATCHMAN_LOGS=/usr/local/Cellar/watchman/3.1/var/run/watchman/$USER.log
|
|
[ -f $WATCHMAN_LOGS ] && cat $WATCHMAN_LOGS
|
|
fi
|
|
# kill whatever is occupying port 8081
|
|
lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
XCODE_PROJECT="Examples/UIExplorer/UIExplorer.xcodeproj"
|
|
XCODE_SCHEME="UIExplorer"
|
|
XCODE_SDK="iphonesimulator"
|
|
if [ -z "$XCODE_DESTINATION" ]; then
|
|
XCODE_DESTINATION="platform=iOS Simulator,name=iPhone 5,OS=9.3"
|
|
fi
|
|
|
|
# Support for environments without xcpretty installed
|
|
set +e
|
|
OUTPUT_TOOL=$(which xcpretty)
|
|
set -e
|
|
|
|
# TODO: We use xcodebuild because xctool would stall when collecting info about
|
|
# the tests before running them. Switch back when this issue with xctool has
|
|
# been resolved.
|
|
if [ -z "$OUTPUT_TOOL" ]; then
|
|
xcodebuild \
|
|
-project $XCODE_PROJECT \
|
|
-scheme $XCODE_SCHEME \
|
|
-sdk $XCODE_SDK \
|
|
-destination "$XCODE_DESTINATION" \
|
|
test
|
|
else
|
|
xcodebuild \
|
|
-project $XCODE_PROJECT \
|
|
-scheme $XCODE_SCHEME \
|
|
-sdk $XCODE_SDK \
|
|
-destination "$XCODE_DESTINATION" \
|
|
test | $OUTPUT_TOOL && exit ${PIPESTATUS[0]}
|
|
fi
|