Automated testing is an increasingly significant and important part of MailNews development. It allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases.
This page and its sub-pages describe (and link to) the available test mechanisms within MailNews, and provide supporting information for developers and testers.
xpcshell-tests and make check
xpcshell-testsare the quickest tests to run. MailNews provides additional facilities as described on the MailNews automated testing page (see below).
make check" is used to run compiled code tests. These tests can go beyond the limitations of
xpcshell-tests(for example, access c++ code) and other testing options that don't test at the right level.
The AsyncTestUtils Extended Framework supports:
- Asynchronous test operation: A reasonably convenient means of writing tests that involve asynchronous operations by using generators. In the long term we would like to lose this extra complexity in favor of the event-loop-spinning style of operation used by mozmill.
- Message synthesis: Create messages by specifying what properties the messages should have.
- Message injection: Inject synthesized messages via local or IMAP (using a fake server).
- Message manipulation: Mark messages as read, tag them, untag them, move them to other folders, trash them, etc.
- Enhanced logging: Supports generating rich JSON streams to disk or over the network for consumption by LogSploder or other tools.
Mail leak and bloat tests
These tests start up Thunderbird or SeaMonkey and record any leaks found, as well as the total memory requirement. Although currently based on simple tests, these are useful for determining if new leaks have been introduced.
For more information, see Leak and Bloat Tests.
MailNews provides some additional facilities to aid the testing of MailNews protocols.