Running Mozilla Tests
From MDC
In order to run most tests, one should have built a copy of Firefox which was built within certain flags are set. Some tests can be run on a regular "as shipped" copy of Firefox, but one may not be able to see any output. It is usually just better to build the application.
See Build Documentation for instructions on building Firefox. One can use these flags in the browser/config/mozconfig file:
mk_add_options MOZ_CO_PROJECT=browser ac_add_options --enable-debug ac_add_options --enable-application=browser ac_add_options --enable-test ac_add_options --enable-mochitest
Other flags that may be needed to run some of the tests (YMMV) are:
ac_add_options --enable-gtktest ac_add_options --enable-libIDLtest ac_add_options --enable-glibtest
[edit] Standalone Tests
Once one has built Firefox with these options, there is a dist/ directory. This is one place to start. In the dist/bin/ directory, one will find links to executables that start with "Test". Some of these come with instructions, and some do not.
% cd dist/bin % % ls Test* TestAutoPtr@ TestCookie@ TestIncrementalDownload@ TestParser@ TestTXMgr@ TestBlockingSocket@ TestDNS@ TestLineBreak@ TestServ@ TestURLParser@ TestCOMPtr@ TestFactory@ TestMinStringAPI@ TestServMgr@ TestUpload@ TestCOMPtrEq@ TestHashtables@ TestObserverService@ TestStandardURL@ TestVersionComparator@ TestCallTemplates@ TestID@ TestOpen@ TestStreamConv@ TestXMLExtras@ TestCallbacks@ TestINIParser@ TestPageLoad@ TestStreamLoader@ TestXPC@ % % ./TestBlockingSocket usage: ./TestBlockingSocket <host> <port> <file-to-read> % % ./TestID %
[edit] MochiTests
If a _tests/ directory exists under the top-level source directory, then the MochiTests have been built. In order to run them, one can run:
% cd _tests/testing/mochitest % % sh $ perl ./runtests.pl --autorun --close-when-done --appname=<executable> --console-level=INFO | grep '^REFTEST ' ... $ perl ./runtests.pl --autorun --close-when-done --appname=<executable> --console-level=INFO -chrome | grep '^REFTEST ' ... $ exit %
[edit] Reftests
% sh $ $ <executable> --reftest layout/reftests/reftest.list ... $ exit %