mozilla/addon-sdk — pull request #249 by warner (2011-10-25 21:12:46+00:00)
Title: Bug 691865: No runtime search

@gozala : this is the cleanup required for your https://github.com/mozilla/addon-sdk/pull/247 pull request. All tests pass, but I deleted test-securable-module (and the whole tests/interoperablejs-read-only suite) (neither of which passed after my patch) in anticipation of your loader changes.

This branch removes the runtime module search, by doing the following:

linker:
* scan all unit test files, just like normal lib/ files
* add all tests as fake dependencies to "api-utils/lib/unit-test-finder"
* add test-harness/lib/run-tests to the manifest (which includes unit-test-finder), to include all tests in the XPI and the manifest
* add a list of tests to harness-options.json, in .allTestFiles
* change unit-test-finder to use that list, instead of scanning the source tree
* change the way 'cfx testall' works, to remove the fake 'testpkgs' package
* pass the entry-point URI (either main.js or test-harness/lib/run-tests.js) in harness-options.json as mainURI

loader:
* use mainURI instead of searching for main
* remove runtime search
* load helper modules by URI instead of by search
* add "packaging" module, with myURI and harnessOptions
* add requireURI() method for entrypoint and helper modules

tests:
* pass myURI into createSandboxedLoader(), so it can use the manifest correctly

Some of this is a bit ugly, but will be cleaned up by Irakli's new loader once it lands, which should be shortly after this one lands.