Mozilla code is covered by a large number of automated unit- and regression tests. These tests are run on Tinderbox constantly and developers are expected to make sure their changes do not break the automated test-suites.
Mozilla uses several home-grown automated testing frameworks, an overview of each framework with links to detailed documentation is available at Mozilla automated testing.
This page lists the steps to run the automated tests.
Configuring the build
In order to run most tests, you must have a properly configured build. Platform (Gecko, Toolkit) tests, as well as Firefox-specific tests, are usually run on a Firefox build.
Build Documentation has the general instructions on building Firefox. The default build options are suitable for running the automated tests. The tests can be run on both debug and release builds, but due to bugs in some tests, they may die because of an assertion failure. (XXX find/file a bug that tracks such tests.)
$ cd <OBJ_DIR> $ make check
If any of the tests fail, you get a message like:
make: *** [check] Error 2
If <tt>make</tt> exits without an error, all the tests passed.
_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 %
% sh $ $ <executable> --reftest layout/reftests/reftest.list ... $ exit %
Other tests not covered in this document
- Tinderbox performance tests - Tp, Txul, Ts, etc.
- running the above tests with/without leak, assertion checks