DHylands updater xpcshell: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 27: Line 27:
==Package the tests==
==Package the tests==
<pre>make -C ${GECKO_OBJDIR} package-tests</pre>
<pre>make -C ${GECKO_OBJDIR} package-tests</pre>
==Install busybox (if testing on a real device)==
If you're trying to run xpcshell tests on a real device, then the process will be sped up dramatically by installing busybox on the device. See: [https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/XPCShell#Installing_busybox_manually] for a link to script which will automate this process for you. You'll need to reinstall busybox each time you reflash your device.


==Run the updater tests==
==Run the updater tests==
Line 52: Line 55:


The export DISPLAY=:0 is needed for me, since I typically ssh -X into my development machine and the emulator won't run if the display is directed to the machine where you're running ssh from.
The export DISPLAY=:0 is needed for me, since I typically ssh -X into my development machine and the emulator won't run if the display is directed to the machine where you're running ssh from.
==Running on the device instead of in the emulator==
I used the following script when running xpcshell updater tests on a real device:
<pre>
#!/bin/bash
. ./load-config.sh
make -C ${GECKO_OBJDIR} package-tests
# Install busybox if needed
if [ "$(adb shell 'test -f /system/bin/cp; echo -n $?')" == "1" ]; then
  echo "Installing BusyBox ..."
  install-busybox.sh
else
  echo "BusyBox already installed ..."
fi
# Marshall said he used:
#./test.sh xpcshell --test-path toolkit/mozapps/update/test/unit/test_bug833708.js --no-clean
adb shell log "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
adb shell log "%%%%% Starting tests"
adb shell log "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
./test.sh xpcshell --test-path toolkit/mozapps/update/test/unit/test_gonk_general.js --no-clean
# Make a noise
echo -ne \\a
</pre>
The install-busybox.sh script comes from [https://github.com/mozilla/Negatus/blob/master/setup-tools.sh].
Confirmed users
69

edits

Navigation menu