Skip to content

Instantly share code, notes, and snippets.

@dhylands
Created September 2, 2014 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhylands/428805de5971191bc171 to your computer and use it in GitHub Desktop.
Save dhylands/428805de5971191bc171 to your computer and use it in GitHub Desktop.
Script I've used for running mochitests on the emulator
#!/bin/bash
# Get full path from where the script was executed, full path is needed to run emulator succesfully
B2G_HOME=$(cd $(dirname $BASH_SOURCE); pwd)
. $B2G_HOME/load-config.sh
export DISPLAY=:0
# Other steps to do:
#
# make -C ${GECKO_OBJDIR} package-tests
#
# You may also need to update the marionette client. See:
# https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Setting_up_Marionette
make -C ${GECKO_OBJDIR} package-tests
cd ${GECKO_OBJDIR}/dist/test-package-stage/mochitest
#MANIFEST=tests/toolkit/mozapps/update/test/unit/xpcshell.ini
#TESTING_MODULES_DIR=${GECKO_OBJDIR}/dist/test-package-stage/modules
#BUSYBOX=${B2G_HOME}/busybox-armv6l
#--emulator arm
#--logcat-dir ${B2G_HOME} \
# --test-path ${B2G_HOME}/gecko/dom/devicestorage/test/ \
# NOTES:
# The mochitest test-container has the following manifest:
# https://github.com/mozilla-b2g/gaia/blob/master/test_apps/test-container/manifest.webapp
# and currently only getDeviceStorage('pictures') has readwrite access in that manifest.
#
# Also, the devicestorage tests listed in
# http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/b2g.json
# aren't run due to failures of some kind.
set -x
pwd
python runtestsb2g.py --b2gpath ${B2G_HOME} \
--xre-path /home/work/B2G-desktop/moz-central-build/dist/bin \
--console INFO \
--emulator arm \
--test-path=dom/devicestorage/test/ \
--logcat-dir ${B2G_HOME} \
| tee ${B2G_HOME}/run-mochitest.log
# Make a noise
echo -ne \\a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment