Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 775281: New xpcshell test frontend for B2G. r=dhylands
Browse files Browse the repository at this point in the history
  • Loading branch information
marshall committed Jan 9, 2013
1 parent 0975518 commit fb1b36d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
56 changes: 56 additions & 0 deletions scripts/xpcshell.sh
@@ -0,0 +1,56 @@
#!/bin/bash

B2G_DIR=$(cd `dirname $0`/..; pwd)
. $B2G_DIR/load-config.sh

# Use default Gecko location if it's not provided in .config.
if [ -z $GECKO_PATH ]; then
GECKO_PATH=$B2G_DIR/gecko
fi

BUSYBOX=$B2G_DIR/gaia/build/busybox-armv6l
TEST_PACKAGE_STAGE_DIR=$GECKO_OBJDIR/dist/test-package-stage
TESTING_MODULES_DIR=$TEST_PACKAGE_STAGE_DIR/modules

XPCSHELL_FLAGS+=" --b2gpath $B2G_DIR \
--use-device-libs \
--busybox $BUSYBOX \
--testing-modules-dir $TESTING_MODULES_DIR"

OUT_HOST=$B2G_DIR/out/host/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86
ADB=${ADB:-$OUT_HOST/bin/adb}
XPCSHELL_FLAGS+=" --adbpath $ADB"

if [ "$DEVICE" = "generic" ]; then
XPCSHELL_FLAGS+=" --emulator arm"
elif [ "$DEVICE" = "generic_x86" ]; then
XPCSHELL_FLAGS+=" --emulator x86"
fi

XPCSHELL_MANIFEST=tests/xpcshell_b2g.ini
while [ $# -gt 0 ]; do
case "$1" in
--manifest)
shift; XPCSHELL_MANIFEST=$1 ;;
--manifest=*)
XPCSHELL_MANIFEST=${1:11} ;;
*)
XPCSHELL_FLAGS+=" $1" ;;
esac
shift
done

XPCSHELL_FLAGS+=" --manifest $XPCSHELL_MANIFEST"
SCRIPT=$GECKO_PATH/testing/marionette/client/marionette/venv_mochitest.sh
PYTHON=`which python`

set -e
if [ ! -d "$TEST_PACKAGE_STAGE_DIR" ]; then
cd $GECKO_OBJDIR
make package-tests
fi

set -x
GECKO_OBJDIR=$GECKO_OBJDIR \
TEST_PWD=$TEST_PACKAGE_STAGE_DIR/xpcshell \
bash $SCRIPT "$PYTHON" $XPCSHELL_FLAGS $@
4 changes: 3 additions & 1 deletion test.sh
Expand Up @@ -3,7 +3,7 @@
B2G_HOME=$(dirname $BASH_SOURCE)

usage() {
echo "Usage: $0 [marionette|mochitest|updates] (frontend-args)"
echo "Usage: $0 [marionette|mochitest|updates|xpcshell] (frontend-args)"
echo ""
echo "'marionette' is the default frontend"
}
Expand All @@ -22,6 +22,8 @@ case "$FRONTEND" in
SCRIPT=$B2G_HOME/scripts/marionette.sh ;;
updates)
SCRIPT=$B2G_HOME/scripts/updates.sh ;;
xpcshell)
SCRIPT=$B2G_HOME/scripts/xpcshell.sh ;;
--help|-h|help)
usage
exit 0;;
Expand Down

0 comments on commit fb1b36d

Please sign in to comment.