forked from ruboto/ruboto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.sh
executable file
·70 lines (61 loc) · 1.11 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash -el
echo "Starting tests..."
# BEGIN TIMEOUT #
TIMEOUT=2700 # 45 minutes
BOSSPID=$$
(
sleep $TIMEOUT
echo
echo "Test timed out after $TIMEOUT seconds."
echo
kill -9 $BOSSPID
echo
echo Emulator log:
echo
cat adb_logcat.log
echo
echo "Test timed out after $TIMEOUT seconds."
)&
TIMERPID=$!
echo "PIDs: Boss: $BOSSPID, Timer: $TIMERPID"
trap "kill -9 $TIMERPID" EXIT
# END TIMEOUT #
if [ ! $(command -v ant) ] ; then
if [ -e /etc/profile.d/ant.sh ] ; then
. /etc/profile.d/ant.sh
else
echo Apache ANT is missing!
exit 2
fi
fi
ant -version
if [ "$RUBY_IMPL" != "" ] ; then
if [ -e /etc/profile.d/rvm.sh ] ; then
. /etc/profile.d/rvm.sh
fi
if [ ! $(command -v rvm) ] ; then
echo RVM is missing!
exit 2
fi
rvm --version
unset JRUBY_HOME
rvm install $RUBY_IMPL
rvm use $RUBY_IMPL
echo -n
fi
export NOEXEC_DISABLE=1
rake clean
set +e
rake test $*
TEST_RC=$?
set -e
echo Tests exited with code $TEST_RC
if [ "$TEST_RC" != "0" ] ; then
echo
echo Emulator log:
echo
cat adb_logcat.log
echo
echo Tests failed with exit code $TEST_RC
fi
exit $TEST_RC