Mobile/Fennec Reftests: Difference between revisions

Jump to navigation Jump to search
no edit summary
(New page: ==Getting the Tests== Edit your mozconfig to contain the following lines: <pre> ac_add_options --enable-tests ac_add_options --enable-mochitest </pre> Get the source and build according ...)
 
No edit summary
Line 1: Line 1:
==Getting the Tests==
==Getting the Tests==
Edit your mozconfig to contain the following lines:
An overview of what [[https://developer.mozilla.org/En/Mozilla_automated_testing reftests]] are.


<pre>
The tests are included in the source tree (mozilla-central) inside reftest or crashtest directories.  The tests have a master include file (layout/reftest/reftests.list, testing/crashtest/crashtests.list) which include all other tests throughout the source tree.
ac_add_options --enable-tests
 
ac_add_options --enable-mochitest
Since we don't have the source tree on the mobile device, we need to extract all the related tests and .list files from the source tree and put them on the device.  This has to be done while preserving directories since relative paths are used.  We have developed a [[http://people.mozilla.com/~jmaher/fennec/reftest_extract.py python script]] which will create two tarballs (reftests_.tar, crashtests_.tar) if you edit it to point at your mozilla-central source directory. 
</pre>


Get the source and build according to [[Mobile/Build/Fennec|instructions]].
Get the source and build according to [[Mobile/Build/Fennec|instructions]].
Line 32: Line 31:
python runtests.py --appname=<fennec executable>
python runtests.py --appname=<fennec executable>
</pre>
</pre>
where fennec executable is the absolute path to the fennec executable, /root/fennec/fennec, e.g. Additional arguments like individual test files can be specified, general Mochitest instructions can be found here [http://developer.mozilla.org/en/docs/Mochitest].
note: The tests are flakey on mobile devices, so use the --test-path, --autorun, and --log-file options.
==Adding tests==
Add a directory named "tests" to the component. In the Makefile.in for the tests directory add a _TEST_FILES section with a list of the files in this directory needed to run the mochitest (the mochitest html file itself and any helper files). Then add this line to the bottom of the Makefile.in:
if test is in central code:
<pre>
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
</pre>
if test is in mobile:
<pre>
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/../xulrunner/_tests/testing/mochitest/tests/$(relativesrcdir)
</pre>
When you build, the tests will be added to the xulrunner application's mochitest set.
Confirmed users
3,376

edits

Navigation menu