diff --git a/.travis.yml b/.travis.yml index 2ece3da0225e65..35a0f0ef105db3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,17 +16,7 @@ script: if [ "$TEST_TYPE" = objc ] then - (npm start > packager.log 2>&1 &) - echo $! > packager.pid - - xctool \ - -project Examples/UIExplorer/UIExplorer.xcodeproj \ - -scheme UIExplorer -sdk iphonesimulator8.1 \ - test - - pkill -9 -F packager.pid - cat packager.log - rm packager.log packager.pid + ./scripts/objc-test.sh elif [ "$TEST_TYPE" = js ] then diff --git a/Examples/UIExplorer/UIExplorerTests/ReferenceImages/Examples-UIExplorer-UIExplorerApp/testTabBarExampleSnapshot_1@2x.png b/Examples/UIExplorer/UIExplorerTests/ReferenceImages/Examples-UIExplorer-UIExplorerApp/testTabBarExampleSnapshot_1@2x.png index d3e66652b5c01b..1d7d2c479eb760 100644 Binary files a/Examples/UIExplorer/UIExplorerTests/ReferenceImages/Examples-UIExplorer-UIExplorerApp/testTabBarExampleSnapshot_1@2x.png and b/Examples/UIExplorer/UIExplorerTests/ReferenceImages/Examples-UIExplorer-UIExplorerApp/testTabBarExampleSnapshot_1@2x.png differ diff --git a/scripts/objc-test.sh b/scripts/objc-test.sh new file mode 100755 index 00000000000000..6cf9a7592ca1f2 --- /dev/null +++ b/scripts/objc-test.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +ROOT=$(dirname $SCRIPTS) + +export REACT_PACKAGER_LOG="$ROOT/server.log" + +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 + + [ -f $REACT_PACKAGER_LOG ] && cat $REACT_PACKAGER_LOG + fi +} +trap cleanup EXIT + +xctool \ + -project Examples/UIExplorer/UIExplorer.xcodeproj \ + -scheme UIExplorer -sdk iphonesimulator8.1 \ + test