forked from ruboto/ruboto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrix_tests.sh
executable file
·85 lines (73 loc) · 2.77 KB
/
matrix_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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash -e
if [ `find . -maxdepth 1 -name "jruby-jars-*.gem" | wc -l` -lt 2 ] ; then
echo JRuby-jars gems are missing.
rake get_jruby_jars_snapshots
else
if [ `find . -maxdepth 1 -mtime +1 -name "jruby-jars-*.gem" | wc -l` -ne 0 ] ; then
echo jruby-jars are old.
rake get_jruby_jars_snapshots
fi
fi
ANDROID_TARGETS="L 19 17 16 15 10" # We should cover at least 90% of the market
PLATFORM_MODES="CURRENT FROM_GEM STANDALONE"
STABLE=`ls jruby-jars-*.gem | head -n 1 | cut -f 3 -d'-' | sed s/\\.gem//`
MASTER=`ls jruby-jars-*.gem | tail -n 1 | cut -f 3 -d'-' | sed s/\\.gem//`
STANDALONE_JRUBY_VERSIONS="$MASTER $STABLE 1.7.16 1.7.13"
RUBOTO_UPDATE_EXAMPLES=1
# STRIP_INVOKERS=1
# TEST_PART=4of5
export ANDROID_OS ANDROID_TARGET RUBOTO_PLATFORM RUBOTO_UPDATE_EXAMPLES
export STRIP_INVOKERS TEST_PART
for ANDROID_TARGET in $ANDROID_TARGETS ; do
ANDROID_OS=$ANDROID_TARGET
ruboto setup -y -t 10 -t $ANDROID_OS
source ~/.rubotorc
ruboto emulator -t $ANDROID_OS
for RUBOTO_PLATFORM in $PLATFORM_MODES ; do
if [ "$RUBOTO_PLATFORM" == "STANDALONE" ] ; then
jruby_versions=$STANDALONE_JRUBY_VERSIONS
elif [ "$RUBOTO_PLATFORM" == "FROM_GEM" ] ; then
jruby_versions="$MASTER"
elif [ "$RUBOTO_PLATFORM" == "CURRENT" ] ; then
jruby_versions="CURRENT"
fi
for JRUBY_JARS_VERSION in $jruby_versions ; do
if [ $RUBOTO_PLATFORM == "CURRENT" ] ; then
unset JRUBY_JARS_VERSION
else
export JRUBY_JARS_VERSION
if [ $RUBOTO_PLATFORM == "FROM_GEM" ] ; then
rake platform:clean
fi
fi
echo ""
echo "********************************************************************************"
echo "ANDROID_TARGET: $ANDROID_TARGET"
echo "RUBOTO_PLATFORM: $RUBOTO_PLATFORM"
echo "JRUBY_JARS_VERSION: $JRUBY_JARS_VERSION"
echo ""
echo -ne "\033]0;$ANDROID_TARGET $RUBOTO_PLATFORM $JRUBY_JARS_VERSION\007"
set +e
./run_tests.sh
# testrb test/ruboto_gen_test.rb -n test_new_apk_size_is_within_limits
# ACTIVITY_TEST_PATTERN=subclass testrb test/ruboto_gen_test.rb -n test_activity_tests
TEST_RC=$?
set -e
echo ""
echo "ANDROID_TARGET: $ANDROID_TARGET"
echo "RUBOTO_PLATFORM: $RUBOTO_PLATFORM"
echo "JRUBY_JARS_VERSION: $JRUBY_JARS_VERSION"
echo "********************************************************************************"
echo ""
if [ "$TEST_RC" != "0" ] ; then
echo Tests exited with code $TEST_RC
exit $TEST_RC
fi
done
done
done
echo
echo '/-------------------------------------------------------------------------\'
echo '| Matrix tests completed OK! |'
echo '\-------------------------------------------------------------------------/'
echo