forked from mozilla-b2g/B2G
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·51 lines (41 loc) · 1.28 KB
/
test.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
#!/bin/bash
. setup.sh
# Determine the absolute path of our location.
B2G_HOME=$(cd `dirname $0`; pwd)
# Use default Gecko location if it's not provided in .config.
if [ -z $GECKO_PATH ]; then
GECKO_PATH=$B2G_HOME/gecko
fi
# Run standard set of tests by default. Command line arguments can be
# specified to run specific tests (an individual test file, a directory,
# or an .ini file).
TEST_PATH=$GECKO_PATH/testing/marionette/client/marionette/tests/unit-tests.ini
MARIONETTE_FLAGS+=" --homedir=$B2G_HOME --type=b2g"
USE_EMULATOR=yes
# Allow other marionette arguments to override the default --emulator argument
while [ $# -gt 0 ]; do
case "$1" in
--address=*|--emulator=*)
MARIONETTE_FLAGS+=" $1"
USE_EMULATOR=no ;;
--*)
MARIONETTE_FLAGS+=" $1" ;;
*)
MARIONETTE_TESTS+=" $1" ;;
esac
shift
done
if [ "$USE_EMULATOR" = "yes" ]; then
if [ "$DEVICE" = "generic_x86" ]; then
ARCH=x86
else
ARCH=arm
fi
MARIONETTE_FLAGS+=" --emulator=$ARCH"
fi
MARIONETTE_TESTS=${MARIONETTE_TESTS:-$TEST_PATH}
echo "Running tests: $MARIONETTE_TESTS"
SCRIPT=$GECKO_PATH/testing/marionette/client/marionette/venv_test.sh
PYTHON=`which python`
echo bash $SCRIPT "$PYTHON" $MARIONETTE_FLAGS $MARIONETTE_TESTS
bash $SCRIPT "$PYTHON" $MARIONETTE_FLAGS $MARIONETTE_TESTS