Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests runner #975

Merged
merged 2 commits into from
Apr 22, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions scripts/objc-test.sh
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe * instead of 3.1?

[ -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