MailNews automated testing 编辑

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.

Functional testing

xpcshell-tests and make check

These are core test harnesses to which MailNews adds its own tests. These tests are run against almost every changeset that gets committed to the Thunderbird and SeaMonkey code bases.

  • xpcshell-tests are run in JavaScript without any chrome present. This makes them especially useful for testing at the component / module level. xpcshell-tests are 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.

Testing frameworks

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.

Performance testing

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 facilities

MailNews provides some additional facilities to aid the testing of MailNews protocols.

  • Fake servers: these are JavaScript-written servers that can be used to simulate IMAP, POP, SMTP and NNTP servers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:29 次

字数:3776

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文