MailNews:Xpcshell tests

From MozillaWiki
Revision as of 15:36, 20 April 2008 by Standard8 (talk | contribs) (First version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<< Back to MailNews:Automated Testing

The xpcshell unit tests are probably the easiest test to write, requiring no UI and being written in javascript. They are very useful for testing interfaces and back-end functionality.

MailNews has a growing set of xpcshell tests. Developers and contributors should consider adding tests within MailNews where possible.

xpcshell tests within MailNews

xpcshell tests can be run in a variety of different ways, the devmo wiki page describes these best.

When developing new tests it is useful to look at cumentation for writing xpcshell-based unit tests]

  • existing tests and also the various support frameworks that have been written:
  • mailDirService.js provides:
    • Provides: an nsIDirectoryServiceProvider implementation which ensures that the user "profile" directory is defined for xpcshell test implementations.
    • "Profile" Directory exists in the directory of the executable, it is called "mailtest"
    • Can be imported via do_import_script
    • Should be used to provide a profile directory for all MailNews tests.

xpcshell test reporting

These currently run on the SeaMonkey tinderboxes, and report as TUnit. Thunderbird hopes to pick running of these up soon (bug 422817).

Useful Links