Mobile/Fennec/Android: Difference between revisions

Line 429: Line 429:
* Ensure that the device and host machine are on the same network.
* Ensure that the device and host machine are on the same network.


=== Mochitests ===
=== mochitest-plain ===
Linux:
Pre-requisites:
* Ensure that MOZ_HOST_BIN has been set according to the [[Mobile/Fennec/Android#Host_Builds_.28MOZ_HOST_BIN.29|directions above]].
* Ensure your device is connected and visible with "adb devices".
* '''Ensure that the device and host machine are on the same network''' <-- This is important. The device and the host need to communicate over the network to run the tests. Having the device connected to the host via USB is '''not''' sufficient.


First, ensure that MOZ_HOST_BIN has been set according to the [[Mobile/Fennec/Android#Host_Builds_.28MOZ_HOST_BIN.29|directions above]].
Running tests:
  mach mochitest-plain
  OR mach mochitest-plain <test-dir>
  OR mach mochitest-plain <test-dir>/<test-name>


  TEST_PATH=<path> make -C <objdir-droid> mochitest-remote
Use "find -name mochitest.ini" to find valid test directories.
Mac:
  MOZ_HOST_BIN="<abspath-to-objdir-desktop>/dist/Nightly.app/Contents/MacOS/" TEST_PATH=<path> make -C <objdir-droid> mochitest-remote
Notes:
* Currently the mach command only supports the adb device manager.
* You can also run tests using make -C $OBJDIR mochitest-remote, but this is deprecated. Use TEST_PATH=<test-dir>/<test-name> or TEST_PATH=<test-dir> to run a subset of tests.
** A rooted device is required to run the unit tests using the SUT Agent. Use ADB for unrooted devices (see [[https://wiki.mozilla.org/Mobile/Fennec/Android#Device_Managers]]).
** Currently using ADB and using /data/local/tests on a non-rooted phone causes setting TEST_PATH to a directory rather than an individual HTML file to fail, and SpecialPowers tests to fail too - filed as {{bug|822652}}


Note that as of this writing (September 2011) many mochitests will not complete successfully. Try setting your TEST_PATH to "intl/uconv" if you want to restrict yourself to a subset of tests that are known to pass.
=== mochitest-chrome  ===
Pre-requisites:
* Ensure that MOZ_HOST_BIN has been set according to the [[Mobile/Fennec/Android#Host_Builds_.28MOZ_HOST_BIN.29|directions above]].
* Ensure your device is connected and visible with "adb devices".
* '''Ensure that the device and host machine are on the same network''' <-- This is important. The device and the host need to communicate over the network to run the tests. Having the device connected to the host via USB is '''not''' sufficient.


Some examples of possible TEST_PATH values are (beware -- this list may be out of date now!):
Running tests:
Harness_sanity
  mach mochitest-chrome
MochiKit-1.4.2/tests
  OR mach mochitest-chrome <test-dir>
content/smil/test
  OR mach mochitest-chrome <test-dir>/<test-name>
content/xml/document/test
content/xslt/tests/mochitest
dom/src/json/test
dom/src/jsurl/test
dom/tests/mochitest/ajax/jquery
dom/tests/mochitest/ajax/mochikit
dom/tests/mochitest/ajax/scriptaculous
dom/tests/mochitest/dom-level0
dom/tests/mochitest/dom-level1-core
dom/tests/mochitest/dom-level2-core
dom/tests/mochitest/dom-level2-html
dom/tests/mochitest/orientation
dom/tests/mochitest/storageevent
editor/composer/test
intl/uconv/tests
js
layout/inspector/tests
layout/xul/test
modules/libjar/test/mochitest
parser/htmlparser/tests/mochitest
toolkit/components/microformats/tests
toolkit/xre/test


Use "find -name chrome.ini" to find valid test directories.
Notes:
Notes:
* A rooted device is required to run the unit tests using the SUT Agent. Use ADB for unrooted devices (see [[https://wiki.mozilla.org/Mobile/Fennec/Android#Device_Managers]]).
* Currently the mach command only supports the adb device manager.
* Currently using ADB and using /data/local/tests on a non-rooted phone causes setting TEST_PATH to a directory rather than an individual HTML file to fail, and SpecialPowers tests to fail too - filed as {{bug|822652}}
* You can also run tests using make -C $OBJDIR mochitest-remote, but this is deprecated. Use TEST_PATH=<test-dir>/<test-name> or TEST_PATH=<test-dir> to run a subset of tests.
* '''Ensure that the device and host machine are on the same network''' <-- This is important. The device and the host need to communicate over the network to run the tests. Having the device connected to the host via USB is '''not''' sufficient.
* mochitest-chrome on Android is not run in continuous integration on treeherder; many tests may fail.


=== Robocop ===
=== Robocop ===
Confirmed users
1,759

edits