gecko-dev/testing/xpcshell
Ricky Stewart 31755b431d Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj
Today we don't require that `mach` `CommandProvider`s subclass from any particular parent class and we're very lax about the requirements they must meet. While that's convenient in certain circumstances, it has some unfortunate implications for feature development.

Today the only requirements that we have for `CommandProvider`s are that they have an `__init__()` method that takes either 1 or 2 arguments, the second of which must be called `context` and is populated with the `mach` `CommandContext`. Again, while this flexibility is occasionally convenient, it is limiting. As we add features to `mach`, having a better idea what the shape of our `CommandProvider`s are and how we can instantiate them and use them is increasingly important, and this gives us additional control when having `mach` configure `CommandProvider`s based on data that is only available at the `mach` level. In particular, we plan to leverage this in bugs 985141 and 1654074.

Here we add validation to the `CommandProvider` decorator to ensure all classes inherit from `MachCommandBase`, update all `CommandProvider`s in-tree to inherit from `MachCommandBase`, and update source and test code accordingly.

Follow-up work: we now require (de facto) that the `context` be populated with a `topdir` attribute by the `populate_context_handler` function, since instantiating the `MachCommandBase` requires a `topdir` be provided. This is fine for now in the interest of keeping this patch reasonably sized, but some additional refactoring could make this cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D86255
2020-08-07 18:24:59 +00:00
..
dns-packet Bug 1652106 - Add support for the mandatory SvcParamKey r=kershaw,necko-reviewers 2020-08-05 13:40:33 +00:00
example Bug 1651165 - Rename idle service r=Gijs,geckoview-reviewers,snorp 2020-07-20 16:06:59 +00:00
moz-http2 Bug 1652106 - Rename esniconfig to echconfig and add HTTPS RR type r=kershaw,necko-reviewers 2020-08-05 13:39:53 +00:00
node-http2 Bug 1598971 - codespell: Fix typos in the doc r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,ato 2019-11-25 10:06:12 +00:00
node-ip Bug 1582051 - Use Buffer.from and Buffer.alloc in moz-http2.js & friends r=kershaw 2019-09-18 13:44:16 +00:00
README
dbg-actors.js Bug 1614791 - Rename DebuggerServer to DevToolsServer. r=jdescottes 2020-02-17 10:28:24 +00:00
head.js Backed out 10 changesets (bug 1589102) for failure at browser_saveHeapSnapshot_e10s_01.js CLOSED TREE 2020-08-05 21:47:50 +03:00
mach_commands.py Bug 1654319 - Remove some flake8 exclusions; r=jmaher 2020-07-21 17:10:51 +00:00
mach_test_package_commands.py Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj 2020-08-07 18:24:59 +00:00
moz.build Bug 1614626 - Move xpcshell selftests to before running actual xpcshell tests. r=gbrown 2020-07-30 20:27:14 +00:00
remotexpcshelltests.py Bug 1486004 - Part 17 - Update remote xpcshell-tests to support unrooted android devices using mozdevice 4.0.0, r=gbrown 2020-07-18 03:36:23 +00:00
runxpcshelltests.py Bug 1614626 - Move xpcshell selftests to before running actual xpcshell tests. r=gbrown 2020-07-30 20:27:14 +00:00
selftest.py Bug 1614626 - Move xpcshell selftests to before running actual xpcshell tests. r=gbrown 2020-07-30 20:27:14 +00:00
xpcshellcommandline.py Bug 1614626 - Move xpcshell selftests to before running actual xpcshell tests. r=gbrown 2020-07-30 20:27:14 +00:00

README

Simple xpcshell-based test harness

converted from netwerk/test/unit

Some documentation at http://developer.mozilla.org/en/docs/Writing_xpcshell-based_unit_tests
See also http://wiki.mozilla.org/SoftwareTesting:Tools:Simple_xpcshell_test_harness