How to add your own tests for Thunderbird.
Generally, tests live near the code they are testing, however some old tests are in a separate test directory.
This document doesn't cover actually writing tests, for that see this page for Mochitests:
And also these pages:
(Just note that these pages are Firefox-centric and include some ancient ideas and practices.)
Tests should be added to a directory near the code they are located. For example, code in
mail/components/extensionsis tested by tests in
mail/components/extensions/test. Inside the
testdirectory is a subdirectory named after the type of test:
browserfor mochitests (as in Firefox terms they are "browser-chrome" mochitests), and
unitfor XPCShell tests.
A new directory needs a test manifest:
The default section isn't even necessary here, but you probably want to add a
head.jsfile if you're going to have more than one test.
The calendar preferences in line 3 is unnecessary outside of the calendar tests. Calendar tests always run in UTC.
Mochitest needs some prefs set, or automated testing will fail.
subsuite = thunderbird
The calendar preferences in lines 3-4 are unnecessary outside of the calendar tests. Calendar tests always run in UTC with the week starting on Sunday.
The next thing you need to do is tell mach about your new test manifest. In the nearest
moz.buildfile, add these lines as appropriate:
BROWSER_CHROME_MANIFESTS += [
XPCSHELL_TESTS_MANIFESTS += [