diff options
Diffstat (limited to 'tools/addon-sdk-1.3/python-lib/cuddlefish/tests')
121 files changed, 0 insertions, 2937 deletions
diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/__init__.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/__init__.py deleted file mode 100644 index c0b34dc..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -import os -import unittest -import doctest -import glob - -env_root = os.environ['CUDDLEFISH_ROOT'] - -def get_tests(): - import cuddlefish - import cuddlefish.tests - - tests = [] - packages = [cuddlefish, cuddlefish.tests] - for package in packages: - path = os.path.abspath(package.__path__[0]) - pynames = glob.glob(os.path.join(path, '*.py')) - for filename in pynames: - basename = os.path.basename(filename) - module_name = os.path.splitext(basename)[0] - full_name = "%s.%s" % (package.__name__, module_name) - module = __import__(full_name, fromlist=[package.__name__]) - - loader = unittest.TestLoader() - suite = loader.loadTestsFromModule(module) - for test in suite: - tests.append(test) - - finder = doctest.DocTestFinder() - doctests = finder.find(module) - for test in doctests: - if len(test.examples) > 0: - tests.append(doctest.DocTestCase(test)) - - md_dir = os.path.join(env_root, 'dev-guide') - doctest_opts = (doctest.NORMALIZE_WHITESPACE | - doctest.REPORT_UDIFF) - for dirpath, dirnames, filenames in os.walk(md_dir): - for filename in filenames: - if filename.endswith('.md'): - absname = os.path.join(dirpath, filename) - tests.append(doctest.DocFileTest( - absname, - module_relative=False, - optionflags=doctest_opts - )) - - return tests - -def run(verbose=False): - if verbose: - verbosity = 2 - else: - verbosity = 1 - - tests = get_tests() - suite = unittest.TestSuite(tests) - runner = unittest.TextTestRunner(verbosity=verbosity) - return runner.run(suite) - -if __name__ == '__main__': - run() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon.png b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon.png deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon.png +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon64.png b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon64.png deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon64.png +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/lib/main.js deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/lib/main.js +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/package.json deleted file mode 100644 index 8d56d74..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "loader": "lib/main.js", - "icon": "explicit-icon.png", - "icon64": "explicit-icon64.png" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon.png b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon.png deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon.png +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon64.png b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon64.png deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon64.png +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/lib/main.js deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/lib/main.js +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/package.json deleted file mode 100644 index 3f0e241..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loader": "lib/main.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/lib/main.js deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/lib/main.js +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/package.json deleted file mode 100644 index 3f0e241..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loader": "lib/main.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/bar/lib/bar-loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/bar/lib/bar-loader.js deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/bar/lib/bar-loader.js +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/bar/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/bar/package.json deleted file mode 100644 index e83a9d4..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/bar/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loader": "lib/bar-loader.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/foo/lib/foo-loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/foo/lib/foo-loader.js deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/foo/lib/foo-loader.js +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/foo/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/foo/package.json deleted file mode 100644 index 4648df6..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-588661-files/packages/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "loader": "lib/foo-loader.js", - "dependencies": ["bar"] -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/docs/main.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/docs/main.md deleted file mode 100644 index 916389e..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/docs/main.md +++ /dev/null @@ -1 +0,0 @@ -minimal docs diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/lib/main.js deleted file mode 100644 index 27af5dd..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/lib/main.js +++ /dev/null @@ -1,4 +0,0 @@ -exports.main = function(options, callbacks) { - console.log("minimal"); - callbacks.quit(); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/package.json deleted file mode 100644 index 45d409a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "jspath-one", - "author": "Jon Smith", - "description": "A package w/ a main module; can be built into an extension." -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/doc/foo.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/doc/foo.md deleted file mode 100644 index 2b38e6a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/doc/foo.md +++ /dev/null @@ -1 +0,0 @@ -I am documentation for foo. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/lib/foo-loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/lib/foo-loader.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/lib/foo-loader.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/package.json deleted file mode 100644 index ccc61b2..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loader": "lib/foo-loader.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/test/test-foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/test/test-foo.js deleted file mode 100644 index 3045af3..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/test/test-foo.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.testThing = function(test) { - test.assertEqual(2, 1 + 1); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/docs/foo.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/docs/foo.md deleted file mode 100644 index 2b38e6a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/docs/foo.md +++ /dev/null @@ -1 +0,0 @@ -I am documentation for foo. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/lib/foo-loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/lib/foo-loader.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/lib/foo-loader.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/package.json deleted file mode 100644 index ccc61b2..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loader": "lib/foo-loader.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/tests/test-foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/tests/test-foo.js deleted file mode 100644 index 3045af3..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/tests/test-foo.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.testThing = function(test) { - test.assertEqual(2, 1 + 1); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/doc/foo.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/doc/foo.md deleted file mode 100644 index 2b38e6a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/doc/foo.md +++ /dev/null @@ -1 +0,0 @@ -I am documentation for foo. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/lib/foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/lib/foo.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/lib/foo.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/lib/loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/lib/loader.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/lib/loader.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/package.json deleted file mode 100644 index c2d22aa..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loader": "lib/loader.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/test/test-foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/test/test-foo.js deleted file mode 100644 index 3045af3..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/test/test-foo.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.testThing = function(test) { - test.assertEqual(2, 1 + 1); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/doc/foo.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/doc/foo.md deleted file mode 100644 index 2b38e6a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/doc/foo.md +++ /dev/null @@ -1 +0,0 @@ -I am documentation for foo. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/foo.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/foo.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/loader.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/loader.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/package.json deleted file mode 100644 index 100249f..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loader": "loader.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/test/test-foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/test/test-foo.js deleted file mode 100644 index 3045af3..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/test/test-foo.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.testThing = function(test) { - test.assertEqual(2, 1 + 1); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/alt-lib/foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/alt-lib/foo.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/alt-lib/foo.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/alt-lib/loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/alt-lib/loader.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/alt-lib/loader.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/doc/foo.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/doc/foo.md deleted file mode 100644 index 2b38e6a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/doc/foo.md +++ /dev/null @@ -1 +0,0 @@ -I am documentation for foo. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/package.json deleted file mode 100644 index f79250e..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "directories": { "lib": "./alt-lib" }, - "loader": "alt-lib/loader.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/test/test-foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/test/test-foo.js deleted file mode 100644 index 3045af3..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/test/test-foo.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.testThing = function(test) { - test.assertEqual(2, 1 + 1); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/alt2-lib/foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/alt2-lib/foo.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/alt2-lib/foo.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/alt2-lib/loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/alt2-lib/loader.js deleted file mode 100644 index 8b13789..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/alt2-lib/loader.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/doc/foo.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/doc/foo.md deleted file mode 100644 index 2b38e6a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/doc/foo.md +++ /dev/null @@ -1 +0,0 @@ -I am documentation for foo. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/package.json deleted file mode 100644 index b017baa..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "lib": "./alt2-lib", - "loader": "alt2-lib/loader.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/test/test-foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/test/test-foo.js deleted file mode 100644 index 3045af3..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/test/test-foo.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.testThing = function(test) { - test.assertEqual(2, 1 + 1); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/docs/main.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/docs/main.md deleted file mode 100644 index 916389e..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/docs/main.md +++ /dev/null @@ -1 +0,0 @@ -minimal docs diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/lib/main.js deleted file mode 100644 index 27af5dd..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/lib/main.js +++ /dev/null @@ -1,4 +0,0 @@ -exports.main = function(options, callbacks) { - console.log("minimal"); - callbacks.quit(); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/package.json deleted file mode 100644 index de868f7..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "extra-options", - "author": "Jon Smith", - "description": "A package w/ a main module; can be built into an extension.", - "loader": "lib/main.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar-e10s-adapter.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar-e10s-adapter.js deleted file mode 100644 index 24095f2..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar-e10s-adapter.js +++ /dev/null @@ -1,7 +0,0 @@ -if (this.sendMessage) { -} else { - require('bar'); - - exports.register = function(process) { - }; -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar.js deleted file mode 100644 index 460045b..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar.js +++ /dev/null @@ -1 +0,0 @@ -require('chrome'); diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/foo.js deleted file mode 100644 index 2bb1e10..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/foo.js +++ /dev/null @@ -1 +0,0 @@ -require('bar'); diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/package.json deleted file mode 100644 index 0967ef4..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/package.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/five/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/five/lib/main.js deleted file mode 100644 index 1bae788..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/five/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -exports.main = "'main' mainly reigns in main(.js)"; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/five/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/five/package.json deleted file mode 100644 index 98e4b85..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/five/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name": "five", - "main": "./lib/main" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/lib/misc.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/lib/misc.js deleted file mode 100644 index 950c7b0..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/lib/misc.js +++ /dev/null @@ -1 +0,0 @@ -exports.main = 42; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/package.json deleted file mode 100644 index 3010fae..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ "name": "four-a", - "directories": {"lib": "lib"}, - "main": "./topfiles/main.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/topfiles/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/topfiles/main.js deleted file mode 100644 index 950c7b0..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/topfiles/main.js +++ /dev/null @@ -1 +0,0 @@ -exports.main = 42; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four/lib/main.js deleted file mode 100644 index d5c9345..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -var a = require("four-a"); diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four/package.json deleted file mode 100644 index 53180b9..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/four/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name": "four", - "main": "main" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/main.js deleted file mode 100644 index 85f37e3..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/main.js +++ /dev/null @@ -1,5 +0,0 @@ -var panel = require("panel"); -var two = require("two.js"); -var a = require("./two"); -var b = require("addon-kit/tabs.js"); -var c = require("./subdir/three"); diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/subdir/three.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/subdir/three.js deleted file mode 100644 index c24fdee..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/subdir/three.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.foo = 1; -var main = require("../main"); diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/two.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/two.js deleted file mode 100644 index ddc754f..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/lib/two.js +++ /dev/null @@ -1,4 +0,0 @@ - -// this ought to find our sibling, not packages/development-mode/lib/main.js -var main = require("main"); -exports.foo = 1; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/package.json deleted file mode 100644 index 0420771..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/one/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name": "one", - "main": "main" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/data/text.data b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/data/text.data deleted file mode 100644 index 1269488..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/data/text.data +++ /dev/null @@ -1 +0,0 @@ -data diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/lib/main.js deleted file mode 100644 index 7e651fb..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/lib/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var self = require("self"); // trigger inclusion of data -exports.main = function () { console.log("main"); }; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/lib/unused.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/lib/unused.js deleted file mode 100644 index d529639..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/lib/unused.js +++ /dev/null @@ -1 +0,0 @@ -exports.unused = "just pretend I'm not here"; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/package.json deleted file mode 100644 index ef14839..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/seven/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "seven", - "id": "jid1" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/lib/unused.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/lib/unused.js deleted file mode 100644 index 0fa8f43..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/lib/unused.js +++ /dev/null @@ -1 +0,0 @@ -exports.unused = "I am."; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/package.json deleted file mode 100644 index 906b249..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name": "six", - "main": "./unreachable" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/unreachable.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/unreachable.js deleted file mode 100644 index a208943..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/six/unreachable.js +++ /dev/null @@ -1 +0,0 @@ -exports.main = "I am outside lib/ and cannot be reached, yet"; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/data/msg.txt b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/data/msg.txt deleted file mode 100644 index 3b18e51..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/data/msg.txt +++ /dev/null @@ -1 +0,0 @@ -hello world diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/data/subdir/submsg.txt b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/data/subdir/submsg.txt deleted file mode 100644 index d2cfe80..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/data/subdir/submsg.txt +++ /dev/null @@ -1 +0,0 @@ -hello subdir diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/main.js deleted file mode 100644 index ed76814..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/main.js +++ /dev/null @@ -1,4 +0,0 @@ -exports.main = 42; -require("./subdir/subfile"); -require("self"); // trigger inclusion of our data/ directory - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/subdir/subfile.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/subdir/subfile.js deleted file mode 100644 index 66bff8b..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/subdir/subfile.js +++ /dev/null @@ -1 +0,0 @@ -exports.main = "I should be included in a subdir"; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/unused.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/unused.js deleted file mode 100644 index e70fe71..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/unused.js +++ /dev/null @@ -1 +0,0 @@ -exports.main = "unused, linker should not include me in the XPI"; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/package.json deleted file mode 100644 index 6b796fc..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name": "three-a", - "main": "./lib/main.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/lib/main.js deleted file mode 100644 index 950c7b0..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -exports.main = 42; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/package.json deleted file mode 100644 index c0ff5ee..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name": "three-b", - "main": "./lib/main" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/lib/main.js deleted file mode 100644 index 950c7b0..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -exports.main = 42; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/lib/sub/foo.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/lib/sub/foo.js deleted file mode 100644 index 9084831..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/lib/sub/foo.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.foo = "you found me down here"; - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/package.json deleted file mode 100644 index 169c914..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name": "three-c", - "main": "lib/main" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three/lib/main.js deleted file mode 100644 index b4fe4f5..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three/lib/main.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("three-a"); -var b = require("three-b"); -var c = require("three-c"); -var c3 = require("three-c/sub/foo"); diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three/package.json deleted file mode 100644 index cbfbc5b..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/linker-files/three/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name": "three", - "main": "main" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/dev-guide-source/no_h1.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/dev-guide-source/no_h1.md deleted file mode 100644 index 51f3108..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/dev-guide-source/no_h1.md +++ /dev/null @@ -1,3 +0,0 @@ -## A heading ## - -*Some words!* diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/dev-guide-source/welcome.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/dev-guide-source/welcome.md deleted file mode 100644 index 573822a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/dev-guide-source/welcome.md +++ /dev/null @@ -1,3 +0,0 @@ -# An Imposing Title # - -*Some words!* diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/another.html b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/another.html deleted file mode 100644 index cdcb284..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/another.html +++ /dev/null @@ -1 +0,0 @@ -another file
\ No newline at end of file diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/base.html b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/base.html deleted file mode 100644 index 8b896cd..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/base.html +++ /dev/null @@ -1,136 +0,0 @@ -<!-- modified by Noelle Murata [fiveinchpixie@gmail.com] --> -<html> -<head> - <base /> - <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> - <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.js"></script> - <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.js"></script> - <link rel="stylesheet" type="text/css" href="syntaxhighlighter/styles/shCore.css" /> - <link rel="stylesheet" type="text/css" href="syntaxhighlighter/styles/shThemeDefault.css" /> - <link rel="stylesheet" type="text/css" media="all" href="css/base.css" /> - <link rel="stylesheet" type="text/css" media="all" href="css/sdk-docs.css" /> - <link rel="stylesheet" type="text/css" media="all" href="css/api-reference.css" /> - <title></title> -</head> -<body> -<div id="container"> - <div id="columns"> - - <div id="left-column"> - - <h1 class="site-title"> - <a href="dev-guide/welcome.html" title="Return to the Add-on SDK's homepage"> - <img alt="Firefox" src="https://addons.mozilla.org/media/img/zamboni/app_icons/firefox.png"> Add-on SDK</a> - </h1> - - <div class="sidebar-section" id="addon-development"> - <h2 class="sidebar-section-header"><a href="dev-guide/addon-development/about.html">Developer Guide</a></h2> - <div class="sidebar-section-contents" id="default-section-contents"> - - <div class="sidebar-subsection"> - <h3 class="sidebar-subsection-header"><a href="dev-guide/addon-development/tutorials.html">Tutorials</a></h3> - <div class="sidebar-subsection-contents"> - <ul> - <li><h4><a href="dev-guide/addon-development/getting-started.html">Getting Started</a></h4> - <ul> - <li><a href="dev-guide/addon-development/installation.html">Installation</a></li> - <li><a href="dev-guide/addon-development/implementing-simple-addon.html">A Simple Add-on</a></li> - <li><a href="dev-guide/addon-development/commonjs.html">CommonJS</a></li> - <li><a href="dev-guide/addon-development/implementing-reusable-module.html">Reusable Modules</a></li> - <li><a href="dev-guide/addon-development/troubleshooting.html">Troubleshooting</a></li> - </ul></li> - <li><h4><a href="dev-guide/addon-development/api-intro.html" >Introducing the APIs</a></h4> - <ul> - <li><a href="dev-guide/addon-development/api-idioms.html">Common Idioms</a></li> - <li><a href="dev-guide/addon-development/api-modules.html">API Overview</a></li> - </ul></li> - </ul> - </div> - </div> - - <div class="sidebar-subsection"> - <h3 class="sidebar-subsection-header"><a href="dev-guide/addon-development/guides.html">Programming Guides</a></h3> - <div class="sidebar-subsection-contents"> - <ul> - <li><h4><a href="dev-guide/addon-development/events.html">Working with Events</a></h4></li> - <li><h4><a href="dev-guide/addon-development/web-content.html">Working with Content Scripts</a></h4></li> - <li><h4><a href="dev-guide/addon-development/program-id.html">The Program ID</a></h4></li> - </ul> - </div> - </div> - - <div class="sidebar-subsection"> - <h3 class="sidebar-subsection-header"><a href="dev-guide/addon-development/reference.html">Reference</a></h3> - <div class="sidebar-subsection-contents"> - <ul> - <li id="high-level-package-summaries"></li> - <li><h4><a href="dev-guide/addon-development/globals.html">Globals</a></h4></li> - <li><h4><a href="dev-guide/addon-development/cfx-tool.html">cfx</a></h4></li> - <li><h4><a href="dev-guide/addon-development/package-spec.html">Package Specification</a></h4></li> - </ul> - </div> - </div> - - <div class="sidebar-subsection"> - <h3 class="sidebar-subsection-header"><a href="dev-guide/addon-development/experimental.html">Experimental</a></h3> - <div class="sidebar-subsection-contents"> - <ul> - <li><h4><a href="dev-guide/addon-development/xul-extensions.html">XUL Extensions</a></h4></li> - </ul> - </div> - </div> - </div> - </div> - - <div class="sidebar-section" id="module-development"> - <h2 class="sidebar-section-header"><a href="dev-guide/module-development/about.html">Internals Guide</a></h2> - <div class="sidebar-section-contents"> - - <div class="sidebar-subsection"> - <h3 class="sidebar-subsection-header"><a href="dev-guide/module-development/guides.html">Programming Guides</a></h3> - <div class="sidebar-subsection-contents"> - <ul> - <li><h4><a href="dev-guide/module-development/best-practices.html">Low-Level Module Best Practices</a></h4> - <li><h4><a href="dev-guide/module-development/chrome.html">Chrome Authority</a></h4> - <li><h4><a href="dev-guide/module-development/xpi.html">XPI Generation</a></h4> - <li><h4><a href="dev-guide/module-development/e10s.html">Out-of-Process Add-ons</a></h4> - </ul> - </div> - </div> - - <div class="sidebar-subsection"> - <h3 class="sidebar-subsection-header"><a href="dev-guide/module-development/reference.html">Reference</a></h3> - <div class="sidebar-subsection-contents"> - <ul> - <li id="low-level-package-summaries"></li> - <li><h4><a href="dev-guide/module-development/globals.html">Globals</a></h4></li> - </ul> - </div> - </div> - </div> - </div> - - <div class="sidebar-section" id="appendices"> - <h3><a href="https://wiki.mozilla.org/Labs/Jetpack/Release_Notes">Release Notes</a></h3> - <h3><a href="dev-guide/appendices/glossary.html">Glossary</a></h3> - <h3><a href="dev-guide/appendices/credits.html">Credits</a></h3> - - </div> - - </div> - - <div id="main-content"> - <div id="right-column"> - </div> - </div> - </div> - <div id="footer"> - <span class="full-name">Add-on SDK Documentation</span> - </div> - -</div> - -</body> -<script src="js/jquery.js"></script> -<script src="js/main.js"></script> -</html> diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/index.html b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/index.html deleted file mode 100644 index b84eeec..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/doc/static-files/index.html +++ /dev/null @@ -1,23 +0,0 @@ -<html> - -<head> - - <title></title> - -</head> - -<body> - -<div id="left-column"> - -<ul><li id="high-level-package-summaries"></li></ul> - -<ul><li id="low-level-package-summaries"></li></ul> - -</div> - -<div id="right-column"></div> - -</body> - -</html> diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/docs/APIreference.html b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/docs/APIreference.html deleted file mode 100644 index a33a4f9..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/docs/APIreference.html +++ /dev/null @@ -1,465 +0,0 @@ - -<!DOCTYPE html> - -<html> - -<head> - - <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> - - <base target="_blank"/> - - <link rel="stylesheet" type="text/css" media="all" - - href="../../../css/base.css" /> - - <link rel="stylesheet" type="text/css" media="all" - - href="../../../css/apidocs.css" /> - - <title>Add-on SDK Documentation</title> - - <style type="text/css"> - - body { - - border: 50px solid #FFFFFF; - - } - - </style> - - - - <script type="text/javascript"> - - function rewrite_links() { - - var images = document.getElementsByTagName("img"); - - for (var i = 0; i < images.length; i++) { - - var before = images[i].src.split("packages/")[0]; - - var after = images[i].src.split("/docs")[1]; - - images[i].src = before + after; - - } - - } - - </script> - -</head> - - - -<body onload = "rewrite_links()"> - -<div id="APIsample_module_api_docs" class="module_api_docs"> - <h1>APIsample</h1> - <div class="module_description"><h1>Title</h1> - <p>Some text here</p> - <p>This text appears between the API blocks.</p> - <p>Wooo, more text.</p> - <p>Some more text here, at the end of the file.</p> - </div> - - <div class="api_reference"> - <h2 class="api_header">API Reference</h2> - - <div class="api_component_group"> - <h3 class="api_header">Classes</h3> - - <div class="api_component"> - <h4 class="api_name">empty-class</h4> - <p>This class contains nothing.</p> - </div> - - <div class="api_component"> - <h4 class="api_name">only-one-ctor</h4> - <p>This class contains only one constructor.</p> - <div class="api_component_group"> - <h5 class="api_header">Constructors</h5> - - <div class="api_component"> - <h6 class="api_name">one-constructor(options)</h6> - - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>An object-bag of goodies.</p> - </div> - - </div> - - </div> - - </div> - - </div> - - <div class="api_component"> - <h4 class="api_name">two-ctors</h4> - <p>This class contains two constructors.</p> - <div class="api_component_group"> - <h5 class="api_header">Constructors</h5> - - <div class="api_component"> - <h6 class="api_name">one-constructor(options)</h6> - <p>The first constructor.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>An object-bag of goodies.</p> - </div> - - </div> - - </div> - - <div class="api_component"> - <h6 class="api_name">another-constructor(options)</h6> - <p>The second constructor.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>An object-bag of goodies.</p> - </div> - - </div> - - </div> - - </div> - - </div> - - <div class="api_component"> - <h4 class="api_name">ctor-and-method</h4> - <p>This class contains one constructor and one method.</p> - <div class="api_component_group"> - <h5 class="api_header">Constructors</h5> - - <div class="api_component"> - <h6 class="api_name">one-constructor(options)</h6> - <p>The first constructor.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>An object-bag of goodies.</p> - </div> - - </div> - - </div> - - </div> - - <div class="api_component_group"> - <h5 class="api_header">Methods</h5> - - <div class="api_component"> - <h6 class="api_name">a-method(options)</h6> - <p>Does things.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>An argument.</p> - </div> - - </div> - - </div> - - </div> - - </div> - - <div class="api_component"> - <h4 class="api_name">ctor-method-prop-event</h4> - <p>This class contains one constructor, one method, one property and an event.</p> - <div class="api_component_group"> - <h5 class="api_header">Constructors</h5> - - <div class="api_component"> - <h6 class="api_name">one-constructor(options)</h6> - <p>The first constructor.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>An object-bag of goodies.</p> - </div> - - </div> - - </div> - - </div> - - <div class="api_component_group"> - <h5 class="api_header">Methods</h5> - - <div class="api_component"> - <h6 class="api_name">a-method(options)</h6> - <p>Does things.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>An argument.</p> - </div> - - </div> - - </div> - - </div> - - <div class="api_component_group"> - <h5 class="api_header">Properties</h5> - - <div class="api_component"> - <h6 class="api_name">a-property : <span class="datatype">bool</span></h6> - <p>Represents stuff.</p> - </div> - - </div> - - <div class="api_component_group"> - <h5 class="api_header">Events</h5> - - <div class="api_component"> - <h6 class="api_name">message</h6> - <p>Event emitted when the content script sends a message to the add-on.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name"><span class="datatype">JSON</span></div> - <p>The message itself as a JSON-serialized object.</p> - </div> - - </div> - - </div> - - </div> - - </div> - - </div> - - <div class="api_component_group"> - <h3 class="api_header">Functions</h3> - - <div class="api_component"> - <h4 class="api_name">test(argOne, argTwo, argThree, options)</h4> - <p>This is a function which does nothing in particular.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">argOne : <span class="datatype">string</span></div> - <p>This is the first argument.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ argTwo : <span class="datatype">bool</span> ]</div> - <p>This is the second argument.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ argThree = default : <span class="datatype">uri</span> ]</div> - <p>This is the third and final argument. And this is - a test of the ability to do multiple lines of - text.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>Options Bag</p> - <div class="api_component"> - <div class="api_name">[ style : <span class="datatype">string</span> ]</div> - <p>Some style information.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ secondToLastOption = True : <span class="datatype">bool</span> ]</div> - <p>The last property.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ lastOption : <span class="datatype">uri</span> ]</div> - <p>And this time we have - A multiline description - Written as haiku</p> - </div> - - </div> - - </div> - - <div class="returns">Returns: <span class="datatype">object</span> - </div> - - </div> - - <div class="api_component"> - <h4 class="api_name">append(options)</h4> - <p>This is a list of options to specify modifications to your slideBar instance.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">options</div> - <p>Pass in all of your options here.</p> - <div class="api_component"> - <div class="api_name">[ icon : <span class="datatype">uri</span> ]</div> - <p>The HREF of an icon to show as the method of accessing your features slideBar</p> - </div> - - <div class="api_component"> - <div class="api_name">[ html : <span class="datatype">string/xml</span> ]</div> - <p>The content of the feature, either as an HTML string, - or an E4X document fragment.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ url : <span class="datatype">uri</span> ]</div> - <p>The url to load into the content area of the feature</p> - </div> - - <div class="api_component"> - <div class="api_name">[ width : <span class="datatype">int</span> ]</div> - <p>Width of the content area and the selected slide size</p> - </div> - - <div class="api_component"> - <div class="api_name">[ persist : <span class="datatype">bool</span> ]</div> - <p>Default slide behavior when being selected as follows: - If true: blah; If false: double blah.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ autoReload : <span class="datatype">bool</span> ]</div> - <p>Automatically reload content on select</p> - </div> - - <div class="api_component"> - <div class="api_name">[ onClick : <span class="datatype">function</span> ]</div> - <p>Callback when the icon is clicked</p> - </div> - - <div class="api_component"> - <div class="api_name">[ onSelect : <span class="datatype">function</span> ]</div> - <p>Callback when the feature is selected</p> - </div> - - <div class="api_component"> - <div class="api_name">[ onReady : <span class="datatype">function</span> ]</div> - <p>Callback when featured is loaded</p> - </div> - - </div> - - </div> - - </div> - - <div class="api_component"> - <h4 class="api_name">cool-func.dot(howMuch, double, options, onemore, options2)</h4> - - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name">howMuch : <span class="datatype">string</span></div> - <p>How much cool it is.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ double = true : <span class="datatype">bool</span> ]</div> - <p>In case you just really need to double it.</p> - </div> - - <div class="api_component"> - <div class="api_name">[ options ]</div> - <p>An object-bag of goodies.</p> - <div class="api_component"> - <div class="api_name">callback : <span class="datatype">function</span></div> - <p>The callback</p> - </div> - - <div class="api_component"> - <div class="api_name">[ random : <span class="datatype">bool</span> ]</div> - <p>Do something random?</p> - </div> - - </div> - - <div class="api_component"> - <div class="api_name">[ onemore : <span class="datatype">bool</span> ]</div> - <p>One more paramater</p> - </div> - - <div class="api_component"> - <div class="api_name">[ options2 ]</div> - <p>This is a full description of something - that really sucks. Because I now have a multiline - description of this thingy.</p> - <div class="api_component"> - <div class="api_name">monkey : <span class="datatype">string</span></div> - <p>You heard me right</p> - </div> - - <div class="api_component"> - <div class="api_name">[ freak = true : <span class="datatype">bool</span> ]</div> - <p>Yes, you are a freak.</p> - </div> - - </div> - - </div> - - <div class="returns">Returns: <span class="datatype">string</span><p>A value telling you just how cool you are. - A boa-constructor! - This description can go on for a while, and can even contain - some <strong>realy</strong> fancy things. Like <code>code</code>, or even - ~~~~{.javascript} - // Some code! - ~~~~</p> - </div> - - </div> - - <div class="api_component"> - <h4 class="api_name">random()</h4> - <p>A function that returns a random integer between 0 and 10.</p> - <div class="returns">Returns: <span class="datatype">int</span><p>The random number.</p> - </div> - - </div> - - </div> - - <div class="api_component_group"> - <h3 class="api_header">Events</h3> - - <div class="api_component"> - <h4 class="api_name">open</h4> - <p>A module-level event called open.</p> - <div class="parameter_set"> - <div class="api_component"> - <div class="api_name"><span class="datatype">bool</span></div> - <p>Yes, it's open.</p> - </div> - - </div> - - </div> - - </div> - - </div> - -</div> - -</body> - - - -</html> - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/docs/APIsample.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/docs/APIsample.md deleted file mode 100644 index 24271ec..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/docs/APIsample.md +++ /dev/null @@ -1,158 +0,0 @@ -# Title # - -Some text here - -<api name="test"> -@function -This is a function which does nothing in particular. -@returns {object} - @prop firststring {string} First string - @prop firsturl {url} First URL -@param argOne {string} This is the first argument. -@param [argTwo] {bool} This is the second argument. -@param [argThree=default] {uri} - This is the third and final argument. And this is - a test of the ability to do multiple lines of - text. -@param [options] Options Bag - @prop [style] {string} Some style information. - @prop [secondToLastOption=True] {bool} The last property. - @prop [lastOption] {uri} - And this time we have - A multiline description - Written as haiku -</api> - -This text appears between the API blocks. - -<api name="append"> -@function -This is a list of options to specify modifications to your slideBar instance. -@param options - Pass in all of your options here. - @prop [icon] {uri} The HREF of an icon to show as the method of accessing your features slideBar - @prop [html] {string/xml} - The content of the feature, either as an HTML string, - or an E4X document fragment. - @prop [url] {uri} The url to load into the content area of the feature - @prop [width] {int} Width of the content area and the selected slide size - @prop [persist] {bool} - Default slide behavior when being selected as follows: - If true: blah; If false: double blah. - @prop [autoReload] {bool} Automatically reload content on select - @prop [onClick] {function} Callback when the icon is clicked - @prop [onSelect] {function} Callback when the feature is selected - @prop [onReady] {function} Callback when featured is loaded -</api> - -Wooo, more text. - -<api name="cool-func.dot"> -@function -@returns {string} A value telling you just how cool you are. -A boa-constructor! -This description can go on for a while, and can even contain -some **realy** fancy things. Like `code`, or even -~~~~{.javascript} -// Some code! -~~~~ -@param howMuch {string} How much cool it is. -@param [double=true] {bool} - In case you just really need to double it. -@param [options] An object-bag of goodies. - @prop callback {function} The callback - @prop [random] {bool} Do something random? -@param [onemore] {bool} One more paramater -@param [options2] - This is a full description of something - that really sucks. Because I now have a multiline - description of this thingy. - @prop monkey {string} You heard me right - @prop [freak=true] {bool} - Yes, you are a freak. -</api> - -<api name="random"> -@function -A function that returns a random integer between 0 and 10. -@returns {int} The random number. -</api> - -<api name="empty-class"> -@class -This class contains nothing. -</api> - -<api name="only-one-ctor"> -@class -This class contains only one constructor. -<api name="one-constructor"> -@constructor -@param [options] An object-bag of goodies. -</api> -</api> - -<api name="two-ctors"> -@class -This class contains two constructors. -<api name="one-constructor"> -@constructor -The first constructor. -@param [options] An object-bag of goodies. -</api> -<api name="another-constructor"> -@constructor -The second constructor. -@param [options] An object-bag of goodies. -</api> -</api> - -<api name="ctor-and-method"> -@class -This class contains one constructor and one method. -<api name="one-constructor"> -@constructor -The first constructor. -@param [options] An object-bag of goodies. -</api> -<api name="a-method"> -@method -Does things. -@param [options] An argument. -</api> -</api> - -<api name="ctor-method-prop-event"> -@class -This class contains one constructor, one method, one property and an event. -<api name="one-constructor"> -@constructor -The first constructor. -@param [options] An object-bag of goodies. -</api> -<api name="a-method"> -@method -Does things. -@param [options] An argument. -</api> -<api name="a-property"> -@property {bool} -Represents stuff. -</api> -<api name="message"> -@event -Event emitted when the content script sends a message to the add-on. -@argument {JSON} -The message itself as a JSON-serialized object. -</api> -</api> - -<api name="open"> -@event -A module-level event called open. -@argument {bool} -Yes, it's open. -</api> - -Some more text here, at the end of the file. - diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/doc/aardvark-feeder.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/doc/aardvark-feeder.md deleted file mode 100644 index 9f61e86..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/doc/aardvark-feeder.md +++ /dev/null @@ -1,8 +0,0 @@ -The `aardvark-feeder` module simplifies feeding aardvarks. - -<api name="feed"> -@function - Feed the aardvark. -@param food {string} - The food. Aardvarks will eat anything. -</api> diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/doc/main.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/doc/main.md deleted file mode 100644 index e69de29..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/doc/main.md +++ /dev/null diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/ignore_me b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/ignore_me deleted file mode 100644 index 014242c..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/ignore_me +++ /dev/null @@ -1,3 +0,0 @@ -The docs processor should tolerate (by ignoring) random non-.js files in lib -directories, such as those left around by editors, version-control systems, -or OS metadata like .DS_Store . This file exercises that tolerance. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/main.js deleted file mode 100644 index 0591fe0..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/main.js +++ /dev/null @@ -1,4 +0,0 @@ -exports.main = function(options, callbacks) { - console.log("1 + 1 =", require("bar-module").add(1, 1)); - callbacks.quit(); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/surprise.js/ignore_me_too b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/surprise.js/ignore_me_too deleted file mode 100644 index 066f9b5..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/surprise.js/ignore_me_too +++ /dev/null @@ -1,2 +0,0 @@ -The docs processor should also ignore directories named *.js, and their -contents. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/package.json deleted file mode 100644 index 07eb9b9..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/aardvark/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "author": "Jon Smith", - "description": "A package w/ a main module; can be built into an extension.", - "keywords": ["potato"], - "version": "1.0", - "dependencies": ["api-utils", "barbeque"] -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/anteater_files/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/anteater_files/lib/main.js deleted file mode 100644 index 0591fe0..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/anteater_files/lib/main.js +++ /dev/null @@ -1,4 +0,0 @@ -exports.main = function(options, callbacks) { - console.log("1 + 1 =", require("bar-module").add(1, 1)); - callbacks.quit(); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/anteater_files/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/anteater_files/package.json deleted file mode 100644 index 0e2b552..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/anteater_files/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "anteater", - "author": "Jon Smith", - "description": "A package w/ a main module; can be built into an extension.", - "keywords": ["potato"], - "version": "1.0", - "dependencies": ["api-utils", "barbeque"] -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/api-utils/lib/loader.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/api-utils/lib/loader.js deleted file mode 100644 index d115349..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/api-utils/lib/loader.js +++ /dev/null @@ -1,3 +0,0 @@ -// This module will be imported by the XPCOM harness/boostrapper -// via Components.utils.import() and is responsible for creating a -// CommonJS module loader. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/api-utils/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/api-utils/package.json deleted file mode 100644 index 64eb065..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/api-utils/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "description": "A foundational package that provides a CommonJS module loader implementation.", - "keywords": ["potato", "jetpack-low-level"], - "loader": "lib/loader.js" -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/barbeque/lib/bar-module.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/barbeque/lib/bar-module.js deleted file mode 100644 index 44a9a43..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/barbeque/lib/bar-module.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.add = function add(a, b) { - return a + b; -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/barbeque/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/barbeque/package.json deleted file mode 100644 index 62e3c12..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/barbeque/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "keywords": ["potato", "jetpack-low-level"], - "description": "A package used by 'aardvark' as a library." -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/docs/main.md b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/docs/main.md deleted file mode 100644 index 916389e..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/docs/main.md +++ /dev/null @@ -1 +0,0 @@ -minimal docs diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/lib/main.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/lib/main.js deleted file mode 100644 index 27af5dd..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/lib/main.js +++ /dev/null @@ -1,4 +0,0 @@ -exports.main = function(options, callbacks) { - console.log("minimal"); - callbacks.quit(); -}; diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/package.json b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/package.json deleted file mode 100644 index 530f3c2..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/packages/minimal/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "author": "Jon Smith", - "description": "A package w/ a main module; can be built into an extension." -} diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/xpi-template/components/harness.js b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/xpi-template/components/harness.js deleted file mode 100644 index 5e2d20a..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/xpi-template/components/harness.js +++ /dev/null @@ -1,4 +0,0 @@ -// This file contains XPCOM code that bootstraps an SDK-based add-on -// by loading its harness-options.json, registering all its resource -// directories, executing its loader, and then executing its program's -// main() function. diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_apiparser.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_apiparser.py deleted file mode 100644 index 1e95f4c..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_apiparser.py +++ /dev/null @@ -1,524 +0,0 @@ - -import os -import unittest -from cuddlefish.docs.apiparser import parse_hunks, ParseError - -tests_path = os.path.abspath(os.path.dirname(__file__)) -static_files_path = os.path.join(tests_path, "static-files") - -class ParserTests(unittest.TestCase): - def pathname(self, filename): - return os.path.join(static_files_path, "docs", filename) - - def parse_text(self, text): - return list(parse_hunks(text)) - - def parse(self, pathname): - return self.parse_text(open(pathname).read()) - - def test_parser(self): - parsed = self.parse(self.pathname("APIsample.md")) - #for i,h in enumerate(parsed): - # print i, h - self.assertEqual(parsed[0], - ("version", 4)) - self.assertEqual(parsed[1], - ("markdown", "# Title #\n\nSome text here\n\n")) - self.assertEqual(parsed[2][0], "api-json") - p_test = parsed[2][1] - self.assertEqual(p_test["name"], "test") - self.assertEqual(p_test["type"], "function") - self.assertEqual(p_test["signature"], "test(argOne, argTwo, \ -argThree, options)") - self.assertEqual(p_test["description"], - "This is a function which does nothing in \ -particular.") - r = p_test["returns"] - self.assertEqual(r["datatype"], "object") - self.assertEqual(r["description"], "") - self.assertEqual(len(r["props"]), 2) - self.assertEqual(r["props"][0]["datatype"], "string") - self.assertEqual(r["props"][0]["description"], "First string") - self.assertEqual(r["props"][1]["datatype"], "url") - self.assertEqual(r["props"][1]["description"], "First URL") - - self.assertEqual(p_test["params"][0], - {"name": "argOne", - "required": True, - "datatype": "string", - "description": "This is the first argument.", - "line_number": 11, - }) - - self.assertEqual(p_test["params"][1], - {"name": "argTwo", - "required": False, - "datatype": "bool", - "description": "This is the second argument.", - "line_number": 12, - }) - - self.assertEqual(p_test["params"][2], - {"name": "argThree", - "required": False, - "default": "default", - "datatype": "uri", - "line_number": 13, - "description": """\ -This is the third and final argument. And this is -a test of the ability to do multiple lines of -text.""", - }) - p3 = p_test["params"][3] - self.assertEqual(p3["name"], "options") - self.assertEqual(p3["required"], False) - self.failIf("type" in p3) - self.assertEqual(p3["description"], "Options Bag") - self.assertEqual(p3["props"][0], - {"name": "style", - "required": False, - "datatype": "string", - "description": "Some style information.", - "line_number": 18, - }) - self.assertEqual(p3["props"][1], - {"name": "secondToLastOption", - "required": False, - "default": "True", - "datatype": "bool", - "description": "The last property.", - "line_number": 19, - }) - self.assertEqual(p3["props"][2]["name"], "lastOption") - self.assertEqual(p3["props"][2]["required"], False) - self.assertEqual(p3["props"][2]["datatype"], "uri") - self.assertEqual(p3["props"][2]["description"], """\ -And this time we have -A multiline description -Written as haiku""") - - self.assertEqual(parsed[3][0], "markdown") - self.assertEqual(parsed[3][1], "\n\nThis text appears between the \ -API blocks.\n\n") - - self.assertEqual(parsed[4][0], "api-json") - p_test = parsed[4][1] - - expected = {'line_number': 28, - 'name': 'append', - 'params': [{'props':[{'line_number': 33, - 'required': False, - 'datatype': 'uri', - 'name': 'icon', - 'description': 'The HREF of an icon to show as the \ -method of accessing your features slideBar'}, - {'line_number': 34, - 'required': False, - 'datatype': 'string/xml', - 'name': 'html', - 'description': 'The content of the feature, either \ -as an HTML string,\nor an E4X document fragment.'}, - {'line_number': 37, - 'required': False, - 'datatype': 'uri', - 'name': 'url', - 'description': 'The url to load into the content area \ -of the feature'}, - {'line_number': 38, - 'required': False, - 'datatype': 'int', - 'name': 'width', - 'description': 'Width of the content area and the \ -selected slide size'}, - {'line_number': 39, - 'required': False, - 'datatype': 'bool', - 'name': 'persist', - 'description': 'Default slide behavior when being \ -selected as follows:\nIf true: blah; If false: double blah.'}, - {'line_number': 42, - 'required': False, - 'datatype': 'bool', - 'name': 'autoReload', - 'description': 'Automatically reload content on \ -select'}, - {'line_number': 43, - 'required': False, - 'datatype': 'function', - 'name': 'onClick', - 'description': 'Callback when the icon is \ -clicked'}, - {'line_number': 44, - 'required': False, - 'datatype': 'function', - 'name': 'onSelect', - 'description': 'Callback when the feature is selected'}, - {'line_number': 45, - 'required': False, - 'datatype': 'function', - 'name': 'onReady', - 'description': - 'Callback when featured is loaded'}], - 'line_number': 31, - 'required': True, - 'name': 'options', - 'description': 'Pass in all of your options here.'}], - 'signature': 'append(options)', - 'type': 'function', - 'description': 'This is a list of options to specify modifications to your \ -slideBar instance.'} - self.assertEqual(p_test, expected) - - self.assertEqual(parsed[6][0], "api-json") - p_test = parsed[6][1] - self.assertEqual(p_test["name"], "cool-func.dot") - self.assertEqual(p_test["signature"], "cool-func.dot(howMuch, double, \ -options, onemore, options2)") - self.assertEqual(p_test["returns"]["description"], - """\ -A value telling you just how cool you are. -A boa-constructor! -This description can go on for a while, and can even contain -some **realy** fancy things. Like `code`, or even -~~~~{.javascript} -// Some code! -~~~~""") - self.assertEqual(p_test["params"][2]["props"][0], - {"name": "callback", - "required": True, - "datatype": "function", - "line_number": 63, - "description": "The callback", - }) - self.assertEqual(p_test["params"][2]["props"][1], - {"name": "random", - "required": False, - "datatype": "bool", - "line_number": 64, - "description": "Do something random?", - }) - - p_test = parsed[8][1] - self.assertEqual(p_test["signature"],"random()") - - # tests for classes - #1) empty class - p_test = parsed[10][1] - self.assertEqual(len(p_test), 4) - self.assertEqual(p_test["name"], "empty-class") - self.assertEqual(p_test["description"], "This class contains nothing.") - self.assertEqual(p_test["type"], "class") - # 2) class with just one ctor - p_test = parsed[12][1] - self.assertEqual(len(p_test), 5) - self.assertEqual(p_test["name"], "only-one-ctor") - self.assertEqual(p_test["description"], "This class contains only \ -one constructor.") - self.assertEqual(p_test["type"], "class") - constructors = p_test["constructors"] - self.assertEqual(len(constructors), 1) - self._test_class_constructor(constructors[0], "one-constructor") - # 3) class with 2 ctors - p_test = parsed[14][1] - self.assertEqual(len(p_test), 5) - self.assertEqual(p_test["name"], "two-ctors") - self.assertEqual(p_test["description"], "This class contains two \ -constructors.") - self.assertEqual(p_test["type"], "class") - constructors = p_test["constructors"] - self.assertEqual(len(constructors), 2) - self._test_class_constructor(constructors[0], "one-constructor") - self._test_class_constructor(constructors[1], "another-constructor") - # 4) class with ctor + method - p_test = parsed[16][1] - self.assertEqual(len(p_test), 6) - self.assertEqual(p_test["name"], "ctor-and-method") - self.assertEqual(p_test["description"], "This class contains one \ -constructor and one method.") - self.assertEqual(p_test["type"], "class") - constructors = p_test["constructors"] - self.assertEqual(len(constructors), 1) - self._test_class_constructor(constructors[0], "one-constructor") - methods = p_test["methods"] - self.assertEqual(len(methods), 1) - self._test_class_method(methods[0]) - # 5) class with ctor + method + property - p_test = parsed[18][1] - self.assertEqual(len(p_test), 8) - self.assertEqual(p_test["name"], "ctor-method-prop-event") - self.assertEqual(p_test["description"], "This class contains one \ -constructor, one method, one property and an event.") - self.assertEqual(p_test["type"], "class") - constructors = p_test["constructors"] - self.assertEqual(len(constructors), 1) - self._test_class_constructor(constructors[0], "one-constructor") - methods = p_test["methods"] - self.assertEqual(len(methods), 1) - self._test_class_method(methods[0]) - properties = p_test["properties"] - self.assertEqual(len(properties), 1) - self._test_class_property(properties[0]) - events = p_test["events"] - self.assertEqual(len(events), 1) - self._test_class_event(events[0]) - - self.assertEqual(parsed[-1][0], "markdown") - self.assertEqual(parsed[-1][1], "\n\nSome more text here, \ -at the end of the file.\n\n") - - def _test_class_constructor(self, constructor, name): - self.assertEqual(constructor["type"], "constructor") - self.assertEqual(constructor["name"], name) - params = constructor["params"] - self.assertEqual(len(params), 1) - self.assertEqual(params[0]["name"], "options") - self.assertEqual(params[0]["description"], "An object-bag of goodies.") - - def _test_class_method(self, method): - self.assertEqual(method["type"], "method") - self.assertEqual(method["name"], "a-method") - self.assertEqual(method["description"], "Does things.") - params = method["params"] - self.assertEqual(len(params), 1) - self.assertEqual(params[0]["name"], "options") - self.assertEqual(params[0]["description"], "An argument.") - - def _test_class_property(self, prop): - self.assertEqual(prop["type"], "property") - self.assertEqual(prop["name"], "a-property") - self.assertEqual(prop["description"], "Represents stuff.") - self.assertEqual(prop["datatype"], "bool") - - def _test_class_event(self, event): - self.assertEqual(event["type"], "event") - self.assertEqual(event["name"], "message") - self.assertEqual(event["description"], "Event emitted when the \ -content script sends a message to the add-on.") - arguments = event["arguments"] - self.assertEqual(len(arguments), 1) - argument = arguments[0] - self.assertEqual(argument["datatype"], "JSON") - self.assertEqual(argument["description"], "The message itself as a \ -JSON-serialized object.") - - def test_missing_return_propname(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@returns {object} - @prop {string} First string, but the property name is missing - @prop {url} First URL, same problem -@param argOne {string} This is the first argument. -</api> -''' - self.assertRaises(ParseError, self.parse_text, md) - - def test_missing_return_proptype(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@returns {object} - @prop untyped It is an error to omit the type of a return property. -@param argOne {string} This is the first argument. -@param [argTwo=True] {bool} This is the second argument. -</api> -''' - self.assertRaises(ParseError, self.parse_text, md) - - def test_return_propnames(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@returns {object} - @prop firststring {string} First string. - @prop [firsturl] {url} First URL, not always provided. -@param argOne {string} This is the first argument. -@param [argTwo=True] {bool} This is the second argument. -</api> -''' - parsed = self.parse_text(md) - r = parsed[1][1]["returns"] - self.assertEqual(r["props"][0]["name"], "firststring") - self.assertEqual(r["props"][0], - {"name": "firststring", - "datatype": "string", - "description": "First string.", - "required": True, - "line_number": 5, # 1-indexed - }) - self.assertEqual(r["props"][1], - {"name": "firsturl", - "datatype": "url", - "description": "First URL, not always provided.", - "required": False, - "line_number": 6, - }) - - def test_return_description_1(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@returns {object} A one-line description. - @prop firststring {string} First string. - @prop [firsturl] {url} First URL, not always provided. -@param argOne {string} This is the first argument. -@param [argTwo=True] {bool} This is the second argument. -</api> -''' - parsed = self.parse_text(md) - r = parsed[1][1]["returns"] - self.assertEqual(r["description"], "A one-line description.") - - def test_return_description_2(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@returns {object} A six-line description - which is consistently indented by two spaces - except for this line - and preserves the following empty line - - from which a two-space indentation will be removed. - @prop firststring {string} First string. - @prop [firsturl] {url} First URL, not always provided. -@param argOne {string} This is the first argument. -@param [argTwo=True] {bool} This is the second argument. -</api> -''' - parsed = self.parse_text(md) - r = parsed[1][1]["returns"] - self.assertEqual(r["description"], - "A six-line description\n" - "which is consistently indented by two spaces\n" - " except for this line\n" - "and preserves the following empty line\n" - "\n" - "from which a two-space indentation will be removed.") - - def test_return_description_3(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@returns A one-line untyped description. -@param argOne {string} This is the first argument. -@param [argTwo=True] {bool} This is the second argument. -</api> -''' - parsed = self.parse_text(md) - r = parsed[1][1]["returns"] - self.assertEqual(r["description"], "A one-line untyped description.") - - # if the return value was supposed to be an array, the correct syntax - # would not have any @prop tags: - # @returns {array} - # Array consists of two elements, a string and a url... - - def test_return_array(self): - md = '''\ -<api name="test"> -@method -This is a function which returns an array. -@returns {array} - Array consists of two elements, a string and a url. -@param argOne {string} This is the first argument. -@param [argTwo=True] {bool} This is the second argument. -</api> -''' - parsed = self.parse_text(md) - r = parsed[1][1]["returns"] - self.assertEqual(r["description"], - "Array consists of two elements, a string and a url.") - - def test_bad_default_on_required_parameter(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@returns something -@param argOne=ILLEGAL {string} Mandatory parameters do not take defaults. -@param [argTwo=Chicago] {string} This is the second argument. -</api> -''' - self.assertRaises(ParseError, self.parse_text, md) - - def test_missing_apitype(self): - md = '''\ -<api name="test"> -Sorry, you must have a @method or something before the description. -Putting it after the description is not good enough -@method -@returns something -</api> -''' - self.assertRaises(ParseError, self.parse_text, md) - - def test_missing_param_propname(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@param p1 {object} This is a parameter. - @prop {string} Oops, props must have a name. -</api> -''' - self.assertRaises(ParseError, self.parse_text, md) - - def test_missing_param_proptype(self): - md = '''\ -<api name="test"> -@method -This is a function which does nothing in particular. -@param p1 {object} This is a parameter. - @prop name Oops, props must have a type. -</api> -''' - self.assertRaises(ParseError, self.parse_text, md) - - def test_property(self): - md = '''\ -<api name="test"> -@property {foo} -An object property named test of type foo. -</api> -''' - parsed = self.parse_text(md) - self.assertEqual(parsed[1][0], 'api-json') - actual_api_json_obj = parsed[1][1] - expected_api_json_obj = { - 'line_number': 1, - 'datatype': 'foo', - 'type': 'property', - 'name': 'test', - 'description': "An object property named test of type foo." - } - self.assertEqual(actual_api_json_obj, expected_api_json_obj) - - def test_property_no_type(self): - md = '''\ -<api name="test"> -@property -This property needs to specify a type! -</api> -''' - self.assertRaises(ParseError, self.parse_text, md) - - def test_missing_api_closing_tag(self): - md = '''\ -<api name="test"> -@class -This is a class with a missing closing tag. -<api name="doStuff" -@method -This method does stuff. -</api> -''' - self.assertRaises(ParseError, self.parse_text, md) - -if __name__ == "__main__": - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_apirenderer.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_apirenderer.py deleted file mode 100644 index 43ee872..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_apirenderer.py +++ /dev/null @@ -1,28 +0,0 @@ - -import os -import unittest -from cuddlefish.docs.apiparser import parse_hunks, ParseError -from cuddlefish.docs.apirenderer import md_to_html - -tests_path = os.path.abspath(os.path.dirname(__file__)) -static_files_path = os.path.join(tests_path, "static-files") - -class ParserTests(unittest.TestCase): - def pathname(self, filename): - return os.path.join(static_files_path, "docs", filename) - - def render_markdown(self, pathname): - return md_to_html(pathname) - - def test_renderer(self): - test = self.render_markdown(self.pathname("APIsample.md")) - reference = open(self.pathname("APIreference.html")).read() - test_lines = test.splitlines(True) - reference_lines = reference.splitlines(True) - for x in range(len(test_lines)): - self.assertEqual(test_lines[x], reference_lines[x], - "line %d: expected '%s', got '%s'" - % (x+1, reference_lines[x], test_lines[x])) - -if __name__ == "__main__": - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_generate.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_generate.py deleted file mode 100644 index 72a4487..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_generate.py +++ /dev/null @@ -1,76 +0,0 @@ -import os -import shutil -import unittest -import StringIO - -from cuddlefish.docs import generate -from cuddlefish.tests import env_root - -INITIAL_FILESET = [ ["static-files", "base.html"], \ - ["dev-guide", "welcome.html"], \ - ["packages", "aardvark", "aardvark.html"] ] - -EXTENDED_FILESET = [ ["static-files", "base.html"], \ - ["dev-guide", "extra.html"], \ - ["dev-guide", "welcome.html"], \ - ["packages", "aardvark", "aardvark.html"] ] - -EXTRAFILE = ["dev-guide", "extra.html"] - -class Generate_Docs_Tests(unittest.TestCase): - def test_generate_static_docs_does_not_smoke(self): - filename = 'testdocs.tgz' - if os.path.exists(filename): - os.remove(filename) - filename = generate.generate_static_docs(env_root) - self.assertTrue(os.path.exists(filename)) - os.remove(filename) - - def test_generate_docs_does_not_smoke(self): - test_root = os.path.join(env_root, "python-lib", "cuddlefish", "tests", "static-files") - docs_root = os.path.join(test_root, "doc") - generate.clean_generated_docs(docs_root) - new_digest = self.check_generate_regenerate_cycle(test_root, INITIAL_FILESET) - # touching an MD file under packages **does** cause a regenerate - os.utime(os.path.join(test_root, "packages", "aardvark", "doc", "main.md"), None) - new_digest = self.check_generate_regenerate_cycle(test_root, INITIAL_FILESET, new_digest) - # touching a non MD file under packages **does not** cause a regenerate - os.utime(os.path.join(test_root, "packages", "aardvark", "lib", "main.js"), None) - self.check_generate_is_skipped(test_root, INITIAL_FILESET, new_digest) - # touching a non MD file under static-files **does not** cause a regenerate - os.utime(os.path.join(docs_root, "static-files", "another.html"), None) - new_digest = self.check_generate_is_skipped(test_root, INITIAL_FILESET, new_digest) - # touching an MD file under dev-guide **does** cause a regenerate - os.utime(os.path.join(docs_root, "dev-guide-source", "welcome.md"), None) - new_digest = self.check_generate_regenerate_cycle(test_root, INITIAL_FILESET, new_digest) - # adding a file **does** cause a regenerate - open(os.path.join(docs_root, "dev-guide-source", "extra.md"), "w").write("some content") - new_digest = self.check_generate_regenerate_cycle(test_root, EXTENDED_FILESET, new_digest) - # deleting a file **does** cause a regenerate - os.remove(os.path.join(docs_root, "dev-guide-source", "extra.md")) - new_digest = self.check_generate_regenerate_cycle(test_root, INITIAL_FILESET, new_digest) - # remove the files - generate.clean_generated_docs(docs_root) - - def check_generate_is_skipped(self, test_root, files_to_expect, initial_digest): - generate.generate_docs(test_root, stdout=StringIO.StringIO()) - docs_root = os.path.join(test_root, "doc") - for file_to_expect in files_to_expect: - self.assertTrue(os.path.exists(os.path.join(docs_root, *file_to_expect))) - self.assertTrue(initial_digest == open(os.path.join(docs_root, "status.md5"), "r").read()) - - def check_generate_regenerate_cycle(self, test_root, files_to_expect, initial_digest = None): - # test that if we generate, files are getting generated - generate.generate_docs(test_root, stdout=StringIO.StringIO()) - docs_root = os.path.join(test_root, "doc") - for file_to_expect in files_to_expect: - self.assertTrue(os.path.exists(os.path.join(docs_root, *file_to_expect))) - if initial_digest: - self.assertTrue(initial_digest != open(os.path.join(docs_root, "status.md5"), "r").read()) - # and that if we regenerate, nothing changes... - new_digest = open(os.path.join(docs_root, "status.md5"), "r").read() - self.check_generate_is_skipped(test_root, files_to_expect, new_digest) - return new_digest - -if __name__ == '__main__': - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_init.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_init.py deleted file mode 100644 index f11ce2c..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_init.py +++ /dev/null @@ -1,85 +0,0 @@ -import os, unittest, shutil -from StringIO import StringIO -from cuddlefish import initializer -from cuddlefish.templates import MAIN_JS, TEST_MAIN_JS, PACKAGE_JSON - -class TestInit(unittest.TestCase): - - def run_init_in_subdir(self, dirname, f, *args, **kwargs): - top = os.path.abspath(os.getcwd()) - basedir = os.path.abspath(os.path.join(".test_tmp",self.id(),dirname)) - if os.path.isdir(basedir): - assert basedir.startswith(top) - shutil.rmtree(basedir) - os.makedirs(basedir) - try: - os.chdir(basedir) - return f(basedir, *args, **kwargs) - finally: - os.chdir(top) - - def do_test_init(self,basedir): - # Let's init the addon, no error admited - f = open(".ignoreme","w") - f.write("stuff") - f.close() - - out, err = StringIO(), StringIO() - init_run = initializer(None, ["init"], out, err) - out, err = out.getvalue(), err.getvalue() - self.assertEqual(init_run, 0) - self.assertTrue("* lib directory created" in out) - self.assertTrue("* data directory created" in out) - self.assertTrue("Have fun!" in out) - self.assertEqual(err,"") - self.assertTrue(len(os.listdir(basedir))>0) - main_js = os.path.join(basedir,"lib","main.js") - package_json = os.path.join(basedir,"package.json") - test_main_js = os.path.join(basedir,"test","test-main.js") - self.assertTrue(os.path.exists(main_js)) - self.assertTrue(os.path.exists(package_json)) - self.assertTrue(os.path.exists(test_main_js)) - self.assertEqual(open(main_js,"r").read(),MAIN_JS) - self.assertEqual(open(package_json,"r").read(), - PACKAGE_JSON % {"name":"tmp_addon_sample", - "fullName": "tmp_addon_SAMPLE" }) - self.assertEqual(open(test_main_js,"r").read(),TEST_MAIN_JS) - - # Let's check that the addon is initialized - out, err = StringIO(), StringIO() - init_run = initializer(None, ["init"], out, err) - out, err = out.getvalue(), err.getvalue() - self.failIfEqual(init_run,0) - self.assertTrue("This command must be run in an empty directory." in err) - - def test_initializer(self): - self.run_init_in_subdir("tmp_addon_SAMPLE",self.do_test_init) - - def do_test_args(self, basedir): - # check that running it with spurious arguments will fail - out,err = StringIO(), StringIO() - init_run = initializer(None, ["init", "ignored-dirname"], out, err) - out, err = out.getvalue(), err.getvalue() - self.failIfEqual(init_run, 0) - self.assertTrue("Too many arguments" in err) - - def test_args(self): - self.run_init_in_subdir("tmp_addon_sample", self.do_test_args) - - def _test_existing_files(self, basedir): - f = open("pay_attention_to_me","w") - f.write("stuff") - f.close() - out,err = StringIO(), StringIO() - rc = initializer(None, ["init"], out, err) - out, err = out.getvalue(), err.getvalue() - self.assertEqual(rc, 1) - self.failUnless("This command must be run in an empty directory" in err, - err) - self.failIf(os.path.exists("lib")) - - def test_existing_files(self): - self.run_init_in_subdir("existing_files", self._test_existing_files) - -if __name__ == "__main__": - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_linker.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_linker.py deleted file mode 100755 index b2e4f19..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_linker.py +++ /dev/null @@ -1,200 +0,0 @@ -import os.path -import shutil -import zipfile -from StringIO import StringIO -import unittest -import cuddlefish -from cuddlefish import packaging, manifest - -def up(path, generations=1): - for i in range(generations): - path = os.path.dirname(path) - return path - -ROOT = up(os.path.abspath(__file__), 4) -def get_linker_files_dir(name): - return os.path.join(up(os.path.abspath(__file__)), "linker-files", name) - -class Basic(unittest.TestCase): - def get_pkg(self, name): - d = get_linker_files_dir(name) - return packaging.get_config_in_dir(d) - - def test_deps(self): - target_cfg = self.get_pkg("one") - pkg_cfg = packaging.build_config(ROOT, target_cfg) - deps = packaging.get_deps_for_targets(pkg_cfg, ["one"]) - self.failUnlessEqual(deps, ["one"]) - deps = packaging.get_deps_for_targets(pkg_cfg, - [target_cfg.name, "addon-kit"]) - self.failUnlessEqual(deps, ["addon-kit", "api-utils", "one"]) - - def test_manifest(self): - target_cfg = self.get_pkg("one") - pkg_cfg = packaging.build_config(ROOT, target_cfg) - deps = packaging.get_deps_for_targets(pkg_cfg, - [target_cfg.name, "addon-kit"]) - self.failUnlessEqual(deps, ["addon-kit", "api-utils", "one"]) - # target_cfg.dependencies is not provided, so we'll search through - # all known packages (everything in 'deps'). - m = manifest.build_manifest(target_cfg, pkg_cfg, deps, - "P/", scan_tests=False) - m = m.get_harness_options_manifest("P/") - - def assertReqIs(modname, reqname, uri): - reqs = m["P/one-lib/%s.js" % modname]["requirements"] - self.failUnlessEqual(reqs[reqname]["uri"], uri) - assertReqIs("main", "panel", "P/addon-kit-lib/panel.js") - assertReqIs("main", "two.js", "P/one-lib/two.js") - assertReqIs("main", "./two", "P/one-lib/two.js") - assertReqIs("main", "addon-kit/tabs.js", "P/addon-kit-lib/tabs.js") - assertReqIs("main", "./subdir/three", "P/one-lib/subdir/three.js") - assertReqIs("two", "main", "P/one-lib/main.js") - assertReqIs("subdir/three", "../main", "P/one-lib/main.js") - - target_cfg.dependencies = [] - # now, because .dependencies *is* provided, we won't search 'deps', - # so we'll get a link error - self.assertRaises(manifest.ModuleNotFoundError, - manifest.build_manifest, - target_cfg, pkg_cfg, deps, "P/", scan_tests=False) - - def test_main_in_deps(self): - target_cfg = self.get_pkg("three") - package_path = [get_linker_files_dir("three-deps")] - pkg_cfg = packaging.build_config(ROOT, target_cfg, - packagepath=package_path) - deps = packaging.get_deps_for_targets(pkg_cfg, - [target_cfg.name, "addon-kit"]) - self.failUnlessEqual(deps, ["addon-kit", "api-utils", "three"]) - m = manifest.build_manifest(target_cfg, pkg_cfg, deps, - "P/", scan_tests=False) - m = m.get_harness_options_manifest("P/") - def assertReqIs(modname, reqname, uri): - reqs = m["P/three-lib/%s.js" % modname]["requirements"] - self.failUnlessEqual(reqs[reqname]["uri"], uri) - assertReqIs("main", "three-a", "P/three-a-lib/main.js") - assertReqIs("main", "three-b", "P/three-b-lib/main.js") - assertReqIs("main", "three-c", "P/three-c-lib/main.js") - - def test_relative_main_in_top(self): - target_cfg = self.get_pkg("five") - package_path = [] - pkg_cfg = packaging.build_config(ROOT, target_cfg, - packagepath=package_path) - deps = packaging.get_deps_for_targets(pkg_cfg, - [target_cfg.name, "addon-kit"]) - self.failUnlessEqual(deps, ["addon-kit", "api-utils", "five"]) - # all we care about is that this next call doesn't raise an exception - m = manifest.build_manifest(target_cfg, pkg_cfg, deps, - "P/", scan_tests=False) - m = m.get_harness_options_manifest("P/") - reqs = m["P/five-lib/main.js"]["requirements"] - self.failUnlessEqual(reqs, {}); - - def test_unreachable_relative_main_in_top(self): - target_cfg = self.get_pkg("six") - package_path = [] - pkg_cfg = packaging.build_config(ROOT, target_cfg, - packagepath=package_path) - deps = packaging.get_deps_for_targets(pkg_cfg, - [target_cfg.name, "addon-kit"]) - self.failUnlessEqual(deps, ["addon-kit", "api-utils", "six"]) - self.assertRaises(manifest.UnreachablePrefixError, - manifest.build_manifest, - target_cfg, pkg_cfg, deps, - "P/", scan_tests=False) - - def test_unreachable_in_deps(self): - target_cfg = self.get_pkg("four") - package_path = [get_linker_files_dir("four-deps")] - pkg_cfg = packaging.build_config(ROOT, target_cfg, - packagepath=package_path) - deps = packaging.get_deps_for_targets(pkg_cfg, - [target_cfg.name, "addon-kit"]) - self.failUnlessEqual(deps, ["addon-kit", "api-utils", "four"]) - self.assertRaises(manifest.UnreachablePrefixError, - manifest.build_manifest, - target_cfg, pkg_cfg, deps, - "P/", scan_tests=False) - -class Contents(unittest.TestCase): - - def run_in_subdir(self, dirname, f, *args, **kwargs): - top = os.path.abspath(os.getcwd()) - basedir = os.path.abspath(os.path.join(".test_tmp",self.id(),dirname)) - if os.path.isdir(basedir): - assert basedir.startswith(top) - shutil.rmtree(basedir) - os.makedirs(basedir) - try: - os.chdir(basedir) - return f(basedir, *args, **kwargs) - finally: - os.chdir(top) - - def assertIn(self, what, inside_what): - self.failUnless(what in inside_what, inside_what) - - def test_strip_default(self): - seven = get_linker_files_dir("seven") - # now run 'cfx xpi' in that directory, except put the generated .xpi - # elsewhere - def _test(basedir): - stdout = StringIO() - shutil.copytree(seven, "seven") - os.chdir("seven") - try: - # regrettably, run() always finishes with sys.exit() - cuddlefish.run(["xpi"], # --strip-xpi is now the default - stdout=stdout) - except SystemExit, e: - self.failUnlessEqual(e.args[0], 0) - zf = zipfile.ZipFile("seven.xpi", "r") - names = zf.namelist() - # the first problem found in bug 664840 was that cuddlefish.js - # (the loader) was stripped out on windows, due to a /-vs-\ bug - self.assertIn("resources/jid1-at-jetpack-api-utils-lib/cuddlefish.js", names) - self.assertIn("resources/jid1-at-jetpack-api-utils-lib/securable-module.js", names) - # the second problem found in bug 664840 was that an addon - # without an explicit tests/ directory would copy all files from - # the package into a bogus JID-PKGNAME-tests/ directory, so check - # for that - testfiles = [fn for fn in names if "jid1-at-jetpack-seven-tests" in fn] - self.failUnlessEqual([], testfiles) - # the third problem was that data files were being stripped from - # the XPI. Note that data/ is only supposed to be included if a - # module that actually gets used does a require("self") . - self.assertIn("resources/jid1-at-jetpack-seven-data/text.data", - names) - self.failIf("resources/jid1-at-jetpack-seven-lib/unused.js" - in names, names) - self.run_in_subdir("x", _test) - - def test_no_strip(self): - seven = get_linker_files_dir("seven") - def _test(basedir): - stdout = StringIO() - shutil.copytree(seven, "seven") - os.chdir("seven") - try: - # regrettably, run() always finishes with sys.exit() - cuddlefish.run(["xpi", "--no-strip-xpi"], - stdout=stdout) - except SystemExit, e: - self.failUnlessEqual(e.args[0], 0) - zf = zipfile.ZipFile("seven.xpi", "r") - names = zf.namelist() - self.assertIn("resources/jid1-at-jetpack-api-utils-lib/cuddlefish.js", names) - self.assertIn("resources/jid1-at-jetpack-api-utils-lib/securable-module.js", names) - testfiles = [fn for fn in names if "jid1-at-jetpack-seven-tests" in fn] - self.failUnlessEqual([], testfiles) - self.assertIn("resources/jid1-at-jetpack-seven-data/text.data", - names) - self.failUnless("resources/jid1-at-jetpack-seven-lib/unused.js" - in names, names) - self.run_in_subdir("x", _test) - - -if __name__ == '__main__': - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_manifest.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_manifest.py deleted file mode 100644 index c9324ee..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_manifest.py +++ /dev/null @@ -1,256 +0,0 @@ - -import unittest -from StringIO import StringIO -from cuddlefish.manifest import scan_module - -class Extra: - def failUnlessKeysAre(self, d, keys): - self.failUnlessEqual(sorted(d.keys()), sorted(keys)) - -class Require(unittest.TestCase, Extra): - def scan(self, text): - lines = StringIO(text).readlines() - requires, problems, locations = scan_module("fake.js", lines) - self.failUnlessEqual(problems, False) - return requires - - def scan_locations(self, text): - lines = StringIO(text).readlines() - requires, problems, locations = scan_module("fake.js", lines) - self.failUnlessEqual(problems, False) - return requires, locations - - def test_modules(self): - mod = """var foo = require('one');""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["one"]) - - mod = """var foo = require(\"one\");""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["one"]) - - mod = """var foo=require( 'one' ) ; """ - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["one"]) - - mod = """var foo = require('o'+'ne'); // tricky, denied""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, []) - - mod = """require('one').immediately.do().stuff();""" - requires, locations = self.scan_locations(mod) - self.failUnlessKeysAre(requires, ["one"]) - self.failUnlessEqual(locations, {"one": 1}) - - # these forms are commented out, and thus ignored - - mod = """// var foo = require('one');""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, []) - - mod = """/* var foo = require('one');""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, []) - - mod = """ * var foo = require('one');""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, []) - - mod = """ ' var foo = require('one');""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["one"]) - - mod = """ \" var foo = require('one');""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["one"]) - - # multiple requires - - mod = """const foo = require('one'); - const foo = require('two');""" - requires, locations = self.scan_locations(mod) - self.failUnlessKeysAre(requires, ["one", "two"]) - self.failUnlessEqual(locations["one"], 1) - self.failUnlessEqual(locations["two"], 2) - - mod = """const foo = require('repeated'); - const bar = require('repeated'); - const baz = require('repeated');""" - requires, locations = self.scan_locations(mod) - self.failUnlessKeysAre(requires, ["repeated"]) - self.failUnlessEqual(locations["repeated"], 1) # first occurrence - - mod = """const foo = require('one'); const foo = require('two');""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["one", "two"]) - - # define calls - - mod = """define('one', ['two', 'numbers/three'], function(t, th) {});""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["two", "numbers/three"]) - - mod = """define( - ['odd', - "numbers/four"], function() {});""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["odd", "numbers/four"]) - - mod = """define(function(require, exports, module) { - var a = require("some/module/a"), - b = require('b/v1'); - exports.a = a; - //This is a fakeout: require('bad'); - /* And another var bad = require('bad2'); */ - require('foo').goFoo(); - });""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["some/module/a", "b/v1", "foo"]) - - mod = """define ( - "foo", - ["bar"], function (bar) { - var me = require("me"); - } - )""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["bar", "me"]) - - mod = """define(['se' + 'ven', 'eight', nine], function () {});""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["eight"]) - - # async require calls - - mod = """require(['one'], function(one) {var o = require("one");});""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["one"]) - - mod = """require([ 'one' ], function(one) {var t = require("two");});""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["one", "two"]) - - mod = """require ( ['two', 'numbers/three'], function(t, th) {});""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["two", "numbers/three"]) - - mod = """require ( - ["bar", "fa" + 'ke' ], function (bar) { - var me = require("me"); - // require("bad").doBad(); - } - )""" - requires = self.scan(mod) - self.failUnlessKeysAre(requires, ["bar", "me"]) - -def scan2(text, fn="fake.js"): - stderr = StringIO() - lines = StringIO(text).readlines() - requires, problems, locations = scan_module(fn, lines, stderr) - stderr.seek(0) - return requires, problems, stderr.readlines() - -class Chrome(unittest.TestCase, Extra): - - def test_ignore_loader(self): - # we specifically ignore the two loader files - mod = """let {Cc,Ci} = require('chrome');""" - requires, problems, err = scan2(mod, "blah/cuddlefish.js") - self.failUnlessKeysAre(requires, ["chrome"]) - self.failUnlessEqual(problems, False) - self.failUnlessEqual(err, []) - - mod = """let {Cc,Ci} = require('chrome');""" - requires, problems, err = scan2(mod, "securable-module.js") - self.failUnlessKeysAre(requires, ["chrome"]) - self.failUnlessEqual(problems, False) - self.failUnlessEqual(err, []) - - def test_chrome(self): - mod = """let {Cc,Ci} = require('chrome');""" - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, ["chrome"]) - self.failUnlessEqual(problems, False) - self.failUnlessEqual(err, []) - - mod = """var foo = require('foo'); - let {Cc,Ci} = require('chrome');""" - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, ["foo", "chrome"]) - self.failUnlessEqual(problems, False) - self.failUnlessEqual(err, []) - - mod = """let c = require('chrome');""" - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, ["chrome"]) - self.failUnlessEqual(problems, False) - self.failUnlessEqual(err, []) - - mod = """var foo = require('foo'); - let c = require('chrome');""" - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, ["foo", "chrome"]) - self.failUnlessEqual(problems, False) - self.failUnlessEqual(err, []) - - def test_chrome_components(self): - # Bug 663541: tolerate "Components" if you're marked with - # require("chrome"), to avoid requiring module authors to rewrite a - # lot of code. Once bug 636145 is fixed, such code will break. To fix - # it, add {Components}=require("chrome"), but that won't work until - # after 636145 is fixed. - mod = """require("chrome"); - var ios = Components.classes['@mozilla.org/network/io-service;1'];""" - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, ["chrome"]) - self.failUnlessEqual((problems, err), (False, [])) - - def test_not_chrome(self): - # from bug 596595 - mod = r'soughtLines: new RegExp("^\\s*(\\[[0-9 .]*\\])?\\s*\\(\\((EE|WW)\\)|.* [Cc]hipsets?: \\)|\\s*Backtrace")' - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, []) - self.failUnlessEqual((problems,err), (False, [])) - - def test_not_chrome2(self): - # from bug 655788 - mod = r"var foo = 'some stuff Cr';" - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, []) - self.failUnlessEqual((problems,err), (False, [])) - -class BadChrome(unittest.TestCase, Extra): - def test_bad_alias(self): - # using Components.* gets you an error, with a message that teaches - # you the correct approach. - mod = """let Cc = Components.classes; - let Cu = Components.utils; - """ - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, []) - self.failUnlessEqual(problems, True) - self.failUnlessEqual(err[1], "The following lines from file fake.js:\n") - self.failUnlessEqual(err[2], " 1: let Cc = Components.classes;\n") - self.failUnlessEqual(err[3], " 2: let Cu = Components.utils;\n") - self.failUnlessEqual(err[4], "use 'Components' to access chrome authority. To do so, you need to add a\n") - self.failUnlessEqual(err[5], "line somewhat like the following:\n") - self.failUnlessEqual(err[7], ' const {Cc,Cu} = require("chrome");\n') - self.failUnlessEqual(err[9], "Then you can use 'Components' as well as any shortcuts to its properties\n") - - def test_bad_misc(self): - # If it looks like you're using something that doesn't have an alias, - # the warning also suggests a better way. - mod = """if (Components.isSuccessCode(foo)) - """ - requires, problems, err = scan2(mod) - self.failUnlessKeysAre(requires, []) - self.failUnlessEqual(problems, True) - self.failUnlessEqual(err[1], "The following lines from file fake.js:\n") - self.failUnlessEqual(err[2], " 1: if (Components.isSuccessCode(foo))\n") - self.failUnlessEqual(err[3], "use 'Components' to access chrome authority. To do so, you need to add a\n") - self.failUnlessEqual(err[4], "line somewhat like the following:\n") - self.failUnlessEqual(err[6], ' const {components} = require("chrome");\n') - self.failUnlessEqual(err[8], "Then you can use 'Components' as well as any shortcuts to its properties\n") - -if __name__ == '__main__': - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_packaging.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_packaging.py deleted file mode 100644 index aa21131..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_packaging.py +++ /dev/null @@ -1,105 +0,0 @@ -import os -import unittest - -from cuddlefish import packaging -from cuddlefish.bunch import Bunch - -tests_path = os.path.abspath(os.path.dirname(__file__)) -static_files_path = os.path.join(tests_path, 'static-files') - -def get_configs(pkg_name, dirname='static-files'): - root_path = os.path.join(tests_path, dirname) - pkg_path = os.path.join(root_path, 'packages', pkg_name) - if not (os.path.exists(pkg_path) and os.path.isdir(pkg_path)): - raise Exception('path does not exist: %s' % pkg_path) - target_cfg = packaging.get_config_in_dir(pkg_path) - pkg_cfg = packaging.build_config(root_path, target_cfg) - deps = packaging.get_deps_for_targets(pkg_cfg, [pkg_name]) - build = packaging.generate_build_for_target( - pkg_cfg=pkg_cfg, - target=pkg_name, - deps=deps, - prefix='guid-' - ) - return Bunch(target_cfg=target_cfg, pkg_cfg=pkg_cfg, build=build) - -class PackagingTests(unittest.TestCase): - def test_bug_588661(self): - configs = get_configs('foo', 'bug-588661-files') - self.assertEqual(configs.build.loader, - 'resource://guid-foo-lib/foo-loader.js') - - def test_bug_614712(self): - configs = get_configs('commonjs-naming', 'bug-614712-files') - packages = configs.pkg_cfg.packages - base = os.path.join(tests_path, 'bug-614712-files', 'packages') - self.assertEqual(packages['original-naming'].tests, - [os.path.join(base, 'original-naming', 'tests')]) - self.assertEqual(packages['commonjs-naming'].tests, - [os.path.join(base, 'commonjs-naming', 'test')]) - - def test_basic(self): - configs = get_configs('aardvark') - packages = configs.pkg_cfg.packages - - self.assertTrue('api-utils' in packages) - self.assertTrue('aardvark' in packages) - self.assertTrue('api-utils' in packages.aardvark.dependencies) - self.assertEqual(packages['api-utils'].loader, 'lib/loader.js') - self.assertTrue(packages.aardvark.main == 'main') - self.assertTrue(packages.aardvark.version == "1.0") - -class PackagePath(unittest.TestCase): - def test_packagepath(self): - root_path = os.path.join(tests_path, 'static-files') - pkg_path = os.path.join(root_path, 'packages', 'minimal') - target_cfg = packaging.get_config_in_dir(pkg_path) - pkg_cfg = packaging.build_config(root_path, target_cfg) - base_packages = set(pkg_cfg.packages.keys()) - ppath = [os.path.join(tests_path, 'bug-611495-files')] - pkg_cfg2 = packaging.build_config(root_path, target_cfg, packagepath=ppath) - all_packages = set(pkg_cfg2.packages.keys()) - self.assertEqual(sorted(["jspath-one"]), - sorted(all_packages - base_packages)) - -class Directories(unittest.TestCase): - # for bug 652227 - packages_path = os.path.join(tests_path, "bug-652227-files", "packages") - def get_config(self, pkg_name): - pkg_path = os.path.join(tests_path, "bug-652227-files", "packages", - pkg_name) - return packaging.get_config_in_dir(pkg_path) - - def test_explicit_lib(self): - # package.json provides .lib - p = self.get_config('explicit-lib') - self.assertEqual(os.path.abspath(p.lib[0]), - os.path.abspath(os.path.join(self.packages_path, - "explicit-lib", - "alt2-lib"))) - - def test_directories_lib(self): - # package.json provides .directories.lib - p = self.get_config('explicit-dir-lib') - self.assertEqual(os.path.abspath(p.lib[0]), - os.path.abspath(os.path.join(self.packages_path, - "explicit-dir-lib", - "alt-lib"))) - - def test_lib(self): - # package.json is empty, but lib/ exists - p = self.get_config("default-lib") - self.assertEqual(os.path.abspath(p.lib[0]), - os.path.abspath(os.path.join(self.packages_path, - "default-lib", - "lib"))) - - def test_root(self): - # package.json is empty, no lib/, so files are in root - p = self.get_config('default-root') - self.assertEqual(os.path.abspath(p.lib[0]), - os.path.abspath(os.path.join(self.packages_path, - "default-root"))) - -if __name__ == "__main__": - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_preflight.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_preflight.py deleted file mode 100644 index a71afbc..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_preflight.py +++ /dev/null @@ -1,143 +0,0 @@ - -import os, shutil -import simplejson as json -import unittest -import hashlib -import base64 -from cuddlefish import preflight -from StringIO import StringIO - -class Util(unittest.TestCase): - def get_basedir(self): - return os.path.join(".test_tmp", self.id()) - def make_basedir(self): - basedir = self.get_basedir() - if os.path.isdir(basedir): - here = os.path.abspath(os.getcwd()) - assert os.path.abspath(basedir).startswith(here) # safety - shutil.rmtree(basedir) - os.makedirs(basedir) - return basedir - - def test_base62(self): - for i in range(1000): - h = hashlib.sha1(str(i)).digest() - s1 = base64.b64encode(h, "AB").strip("=") - s2 = base64.b64encode(h).strip("=").replace("+","A").replace("/","B") - self.failUnlessEqual(s1, s2) - - def write(self, config): - basedir = self.get_basedir() - fn = os.path.join(basedir, "package.json") - open(fn,"w").write(config) - def read(self): - basedir = self.get_basedir() - fn = os.path.join(basedir, "package.json") - return open(fn,"r").read() - - def get_cfg(self): - cfg = json.loads(self.read()) - if "name" not in cfg: - # the cfx parser always provides a name, even if package.json - # doesn't contain one - cfg["name"] = "pretend name" - return cfg - - def parse(self, keydata): - fields = {} - fieldnames = [] - for line in keydata.split("\n"): - if line.strip(): - k,v = line.split(":", 1) - k = k.strip() ; v = v.strip() - fields[k] = v - fieldnames.append(k) - return fields, fieldnames - - def test_preflight(self): - basedir = self.make_basedir() - fn = os.path.join(basedir, "package.json") - - # empty config is not ok: need id (name is automatically supplied) - config_orig = "{}" - self.write(config_orig) - out = StringIO() - cfg = self.get_cfg() - config_was_ok, modified = preflight.preflight_config(cfg, fn, - stderr=out) - self.failUnlessEqual(config_was_ok, False) - self.failUnlessEqual(modified, True) - backup_fn = os.path.join(basedir, "package.json.backup") - config_backup = open(backup_fn,"r").read() - self.failUnlessEqual(config_backup, config_orig) - config = json.loads(self.read()) - self.failIf("name" in config) - self.failUnless("id" in config) - self.failUnless(config["id"].startswith("jid1-"), config["id"]) - self.failUnlessEqual(out.getvalue().strip(), - "No 'id' in package.json: creating a new ID for you.") - os.unlink(backup_fn) - - # just a name? we add the id - config_orig = '{"name": "my-awesome-package"}' - self.write(config_orig) - out = StringIO() - cfg = self.get_cfg() - config_was_ok, modified = preflight.preflight_config(cfg, fn, - stderr=out) - self.failUnlessEqual(config_was_ok, False) - self.failUnlessEqual(modified, True) - backup_fn = os.path.join(basedir, "package.json.backup") - config_backup = open(backup_fn,"r").read() - self.failUnlessEqual(config_backup, config_orig) - config = json.loads(self.read()) - self.failUnlessEqual(config["name"], "my-awesome-package") - self.failUnless("id" in config) - self.failUnless(config["id"].startswith("jid1-"), config["id"]) - jid = str(config["id"]) - self.failUnlessEqual(out.getvalue().strip(), - "No 'id' in package.json: creating a new ID for you.") - os.unlink(backup_fn) - - # name and valid id? great! ship it! - config2 = '{"name": "my-awesome-package", "id": "%s"}' % jid - self.write(config2) - out = StringIO() - cfg = self.get_cfg() - config_was_ok, modified = preflight.preflight_config(cfg, fn, - stderr=out) - self.failUnlessEqual(config_was_ok, True) - self.failUnlessEqual(modified, False) - config2a = self.read() - self.failUnlessEqual(config2a, config2) - self.failUnlessEqual(out.getvalue().strip(), "") - - # name and anonymous ID? without asking to see its papers, ship it - config3 = '{"name": "my-old-skool-package", "id": "anonid0-deadbeef"}' - self.write(config3) - out = StringIO() - cfg = self.get_cfg() - config_was_ok, modified = preflight.preflight_config(cfg, fn, - stderr=out) - self.failUnlessEqual(config_was_ok, True) - self.failUnlessEqual(modified, False) - config3a = self.read() - self.failUnlessEqual(config3a, config3) - self.failUnlessEqual(out.getvalue().strip(), "") - - # name and old-style ID? with nostalgic trepidation, ship it - config4 = '{"name": "my-old-skool-package", "id": "foo@bar.baz"}' - self.write(config4) - out = StringIO() - cfg = self.get_cfg() - config_was_ok, modified = preflight.preflight_config(cfg, fn, - stderr=out) - self.failUnlessEqual(config_was_ok, True) - self.failUnlessEqual(modified, False) - config4a = self.read() - self.failUnlessEqual(config4a, config4) - self.failUnlessEqual(out.getvalue().strip(), "") - - -if __name__ == '__main__': - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_rdf.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_rdf.py deleted file mode 100644 index 4585143..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_rdf.py +++ /dev/null @@ -1,15 +0,0 @@ -import unittest -import xml.dom.minidom - -from cuddlefish import rdf - - -class RDFTests(unittest.TestCase): - def testBug567660(self): - obj = rdf.RDF() - data = u'\u2026'.encode('utf-8') - x = '<?xml version="1.0" encoding="utf-8"?><blah>%s</blah>' % data - obj.dom = xml.dom.minidom.parseString(x) - self.assertEqual(obj.dom.documentElement.firstChild.nodeValue, - u'\u2026') - self.assertEqual(str(obj).replace("\n",""), x.replace("\n","")) diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_runner.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_runner.py deleted file mode 100644 index 15ec8d2..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_runner.py +++ /dev/null @@ -1,24 +0,0 @@ -import sys - -from cuddlefish import runner - -def xulrunner_app_runner_doctests(): - """ - >>> runner.XulrunnerAppRunner(binary='foo') - Traceback (most recent call last): - ... - Exception: Binary path does not exist foo - - >>> runner.XulrunnerAppRunner(binary=sys.executable) - Traceback (most recent call last): - ... - ValueError: application.ini not found in cmdargs - - >>> runner.XulrunnerAppRunner(binary=sys.executable, - ... cmdargs=['application.ini']) - Traceback (most recent call last): - ... - ValueError: file does not exist: 'application.ini' - """ - - pass diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_util.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_util.py deleted file mode 100644 index 8f5e697..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_util.py +++ /dev/null @@ -1,18 +0,0 @@ - -import unittest -from cuddlefish.manifest import filter_filenames, filter_dirnames - -class Filter(unittest.TestCase): - def test_filter_filenames(self): - names = ["foo", "bar.js", "image.png", - ".hidden", "foo~", ".foo.swp", "bar.js.swp"] - self.failUnlessEqual(sorted(filter_filenames(names)), - sorted(["foo", "bar.js", "image.png"])) - - def test_filter_dirnames(self): - names = ["subdir", "data", ".git", ".hg", ".svn", "defaults"] - self.failUnlessEqual(sorted(filter_dirnames(names)), - sorted(["subdir", "data", "defaults"])) - -if __name__ == '__main__': - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_version.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_version.py deleted file mode 100644 index 2fb32f3..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_version.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -import unittest -import shutil - -from cuddlefish.version import get_version - -class Version(unittest.TestCase): - def get_basedir(self): - return os.path.join(".test_tmp", self.id()) - def make_basedir(self): - basedir = self.get_basedir() - if os.path.isdir(basedir): - here = os.path.abspath(os.getcwd()) - assert os.path.abspath(basedir).startswith(here) # safety - shutil.rmtree(basedir) - os.makedirs(basedir) - return basedir - - def test_current_version(self): - # the SDK should be able to determine its own version. We don't care - # what it is, merely that it can be computed. - env_root = os.environ.get('CUDDLEFISH_ROOT') - version = get_version(env_root) - self.failUnless(isinstance(version, str), (version, type(version))) - self.failUnless(len(version) > 0, version) - def test_read(self): - basedir = self.make_basedir() - f = open(os.path.join(basedir, ".version"), "w") - f.write("versioniffic\n") - f.close() - sdk_version = get_version(basedir) - self.failUnlessEqual(sdk_version, "versioniffic") diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_webdocs.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_webdocs.py deleted file mode 100644 index c8d66d4..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_webdocs.py +++ /dev/null @@ -1,92 +0,0 @@ -import os, re -import unittest - -from cuddlefish.docs import webdocs -from cuddlefish.tests import env_root - -class WebDocTests(unittest.TestCase): - def test_create_package_doc(self): - root = os.path.join(os.getcwd() + \ - '/python-lib/cuddlefish/tests/static-files') - web_docs = webdocs.WebDocs(root) - aarvark_package = web_docs.create_package_page('aardvark') - self._test_common_contents(aarvark_package) - self.assertTrue('<h1>aardvark</h1>'\ - in aarvark_package) - self.assertTrue(\ - '<span class="meta-header">Author</span>'\ - in aarvark_package) - self.assertTrue(\ - '<span class="author">Jon Smith</span>'\ - in aarvark_package) - self.assertTrue(\ - '<title>aardvark - Add-on SDK Documentation</title>'\ - in aarvark_package) - - def test_create_guide1_doc(self): - root = os.path.join(os.getcwd() + \ - '/python-lib/cuddlefish/tests/static-files') - web_docs = webdocs.WebDocs(root) - guide = web_docs.create_guide_page(os.path.join(\ - root + '/doc/dev-guide-source/welcome.blah')) - self._test_common_contents(guide) - self.assertTrue(\ - '<title>An Imposing Title - Add-on SDK Documentation</title>'\ - in guide) - self.assertTrue('<p><em>Some words!</em></p>'\ - in guide) - - def test_create_guide2_doc(self): - root = os.path.join(os.getcwd() + \ - '/python-lib/cuddlefish/tests/static-files') - web_docs = webdocs.WebDocs(root) - guide = web_docs.create_guide_page(os.path.join(\ - root + '/doc/dev-guide-source/no_h1.blah')) - self._test_common_contents(guide) - self.assertTrue('<title>Add-on SDK Documentation</title>'\ - in guide) - self.assertTrue('<h2>A heading</h2>'\ - in guide) - - def test_create_module_doc(self): - root = os.path.join(os.getcwd() + \ - '/python-lib/cuddlefish/tests/static-files') - web_docs = webdocs.WebDocs(root) - module = web_docs.create_module_page(os.path.join(\ - root + '/packages/aardvark/doc/aardvark-feeder.blah')) - self._test_common_contents(module) - self.assertTrue(\ - '<title>aardvark-feeder - Add-on SDK Documentation</title>'\ - in module) - self.assertTrue(\ - '<h1>aardvark-feeder</h1>'\ - in module) - self.assertTrue(\ - '<div class="module_description">'\ - in module) - self.assertTrue(\ - '<p>The <code>aardvark-feeder</code> module simplifies feeding aardvarks.</p>'\ - in module) - self.assertTrue(\ - '<h2 class="api_header">API Reference</h2>'\ - in module) - self.assertTrue(\ - '<h3 class="api_header">Functions</h3>'\ - in module) - self.assertTrue(\ - '<h4 class="api_name">feed(food)</h4>'\ - in module) - self.assertTrue( - '<p>Feed the aardvark.</p>'\ - in module) - - def _test_common_contents(self, doc): - self.assertTrue(\ - '<a href="packages/aardvark/aardvark.html"' in doc) - self.assertTrue(\ - '<a href="packages/anteater_files/anteater.html"' in doc) - self.assertTrue(\ - '<a href="packages/aardvark/doc/main.html">main</a>' in doc) - -if __name__ == "__main__": - unittest.main() diff --git a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_xpi.py b/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_xpi.py deleted file mode 100644 index d824392..0000000 --- a/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/test_xpi.py +++ /dev/null @@ -1,253 +0,0 @@ -import os -import unittest -import zipfile -import pprint -import shutil - -import simplejson as json -from cuddlefish import xpi, packaging, manifest -from cuddlefish.tests import test_packaging -from test_linker import up - -xpi_template_path = os.path.join(test_packaging.static_files_path, - 'xpi-template') - -fake_manifest = '<RDF><!-- Extension metadata is here. --></RDF>' - -class Bug588119Tests(unittest.TestCase): - def makexpi(self, pkg_name): - self.xpiname = "%s.xpi" % pkg_name - create_xpi(self.xpiname, pkg_name, 'bug-588119-files') - self.xpi = zipfile.ZipFile(self.xpiname, 'r') - options = self.xpi.read('harness-options.json') - self.xpi_harness_options = json.loads(options) - - def setUp(self): - self.xpiname = None - self.xpi = None - - def tearDown(self): - if self.xpi: - self.xpi.close() - if self.xpiname and os.path.exists(self.xpiname): - os.remove(self.xpiname) - - def testPackageWithImplicitIcon(self): - self.makexpi('implicit-icon') - assert 'icon.png' in self.xpi.namelist() - - def testPackageWithImplicitIcon64(self): - self.makexpi('implicit-icon') - assert 'icon64.png' in self.xpi.namelist() - - def testPackageWithExplicitIcon(self): - self.makexpi('explicit-icon') - assert 'icon.png' in self.xpi.namelist() - - def testPackageWithExplicitIcon64(self): - self.makexpi('explicit-icon') - assert 'icon64.png' in self.xpi.namelist() - - def testPackageWithNoIcon(self): - self.makexpi('no-icon') - assert 'icon.png' not in self.xpi.namelist() - - def testIconPathNotInHarnessOptions(self): - self.makexpi('implicit-icon') - assert 'icon' not in self.xpi_harness_options - - def testIcon64PathNotInHarnessOptions(self): - self.makexpi('implicit-icon') - assert 'icon64' not in self.xpi_harness_options - -class ExtraHarnessOptions(unittest.TestCase): - def setUp(self): - self.xpiname = None - self.xpi = None - - def tearDown(self): - if self.xpi: - self.xpi.close() - if self.xpiname and os.path.exists(self.xpiname): - os.remove(self.xpiname) - - def testOptions(self): - pkg_name = "extra-options" - self.xpiname = "%s.xpi" % pkg_name - create_xpi(self.xpiname, pkg_name, "bug-669274-files", - extra_harness_options={"builderVersion": "futuristic"}) - self.xpi = zipfile.ZipFile(self.xpiname, 'r') - options = self.xpi.read('harness-options.json') - hopts = json.loads(options) - self.failUnless("builderVersion" in hopts) - self.failUnlessEqual(hopts["builderVersion"], "futuristic") - - def testBadOptionName(self): - pkg_name = "extra-options" - self.xpiname = "%s.xpi" % pkg_name - self.failUnlessRaises(xpi.HarnessOptionAlreadyDefinedError, - create_xpi, - self.xpiname, pkg_name, "bug-669274-files", - extra_harness_options={"main": "already in use"}) - -class SmallXPI(unittest.TestCase): - def setUp(self): - self.root = up(os.path.abspath(__file__), 4) - def get_linker_files_dir(self, name): - return os.path.join(up(os.path.abspath(__file__)), "linker-files", name) - def get_pkg(self, name): - d = self.get_linker_files_dir(name) - return packaging.get_config_in_dir(d) - - def get_basedir(self): - return os.path.join(".test_tmp", self.id()) - def make_basedir(self): - basedir = self.get_basedir() - if os.path.isdir(basedir): - here = os.path.abspath(os.getcwd()) - assert os.path.abspath(basedir).startswith(here) # safety - shutil.rmtree(basedir) - os.makedirs(basedir) - return basedir - - def test_contents(self): - target_cfg = self.get_pkg("three") - package_path = [self.get_linker_files_dir("three-deps")] - pkg_cfg = packaging.build_config(self.root, target_cfg, - packagepath=package_path) - deps = packaging.get_deps_for_targets(pkg_cfg, - [target_cfg.name, "addon-kit"]) - m = manifest.build_manifest(target_cfg, pkg_cfg, deps, - "P/", scan_tests=False) - used_files = list(m.get_used_files()) - here = up(os.path.abspath(__file__)) - def absify(*parts): - fn = os.path.join(here, "linker-files", *parts) - return os.path.abspath(fn) - expected = [absify(*parts) for parts in - [("three", "lib", "main.js"), - ("three-deps", "three-a", "lib", "main.js"), - ("three-deps", "three-a", "lib", "subdir", "subfile.js"), - ("three-deps", "three-a", "data", "msg.txt"), - ("three-deps", "three-a", "data", "subdir", "submsg.txt"), - ("three-deps", "three-b", "lib", "main.js"), - ("three-deps", "three-c", "lib", "main.js"), - ("three-deps", "three-c", "lib", "sub", "foo.js"), - ]] - missing = set(expected) - set(used_files) - extra = set(used_files) - set(expected) - self.failUnlessEqual((list(missing), list(extra)), ([], [])) - used_deps = m.get_used_packages() - - build = packaging.generate_build_for_target(pkg_cfg, target_cfg.name, - used_deps, - prefix="p-", - include_tests=False) - options = {'main': target_cfg.main} - options.update(build) - basedir = self.make_basedir() - xpi_name = os.path.join(basedir, "contents.xpi") - xpi.build_xpi(template_root_dir=xpi_template_path, - manifest=fake_manifest, - xpi_path=xpi_name, - harness_options=options, - limit_to=used_files) - x = zipfile.ZipFile(xpi_name, "r") - names = x.namelist() - expected = ["components/", - "components/harness.js", - # the real template also has 'bootstrap.js', but the fake - # one in tests/static-files/xpi-template doesn't - "harness-options.json", - "install.rdf", - "resources/", - "resources/p-api-utils-data/", - "resources/p-api-utils-lib/", - "resources/p-three-lib/", - "resources/p-three-lib/main.js", - "resources/p-three-a-data/", - "resources/p-three-a-data/msg.txt", - "resources/p-three-a-data/subdir/", - "resources/p-three-a-data/subdir/submsg.txt", - "resources/p-three-a-lib/", - "resources/p-three-a-lib/main.js", - "resources/p-three-a-lib/subdir/", - "resources/p-three-a-lib/subdir/subfile.js", - "resources/p-three-b-lib/", - "resources/p-three-b-lib/main.js", - "resources/p-three-c-lib/", - "resources/p-three-c-lib/main.js", - "resources/p-three-c-lib/sub/", - "resources/p-three-c-lib/sub/foo.js", - # notably absent: p-three-a-lib/unused.js - ] - # showing deltas makes failures easier to investigate - missing = set(expected) - set(names) - extra = set(names) - set(expected) - self.failUnlessEqual((list(missing), list(extra)), ([], [])) - self.failUnlessEqual(sorted(names), sorted(expected)) - - - -def document_dir(name): - if name in ['packages', 'xpi-template']: - dirname = os.path.join(test_packaging.static_files_path, name) - document_dir_files(dirname) - elif name == 'xpi-output': - create_xpi('test-xpi.xpi') - document_zip_file('test-xpi.xpi') - os.remove('test-xpi.xpi') - else: - raise Exception('unknown dir: %s' % name) - -def normpath(path): - """ - Make a platform-specific relative path use '/' as a separator. - """ - - return path.replace(os.path.sep, '/') - -def document_zip_file(path): - zip = zipfile.ZipFile(path, 'r') - for name in sorted(zip.namelist()): - contents = zip.read(name) - lines = contents.splitlines() - if len(lines) == 1 and name.endswith('.json') and len(lines[0]) > 75: - # Ideally we would json-decode this, but it results - # in an annoying 'u' before every string literal, - # since json decoding makes all strings unicode. - contents = eval(contents) - contents = pprint.pformat(contents) - lines = contents.splitlines() - contents = "\n ".join(lines) - print "%s:\n %s" % (normpath(name), contents) - zip.close() - -def document_dir_files(path): - filename_contents_tuples = [] - for dirpath, dirnames, filenames in os.walk(path): - relpath = dirpath[len(path)+1:] - for filename in filenames: - abspath = os.path.join(dirpath, filename) - contents = open(abspath, 'r').read() - contents = "\n ".join(contents.splitlines()) - relfilename = os.path.join(relpath, filename) - filename_contents_tuples.append((normpath(relfilename), contents)) - filename_contents_tuples.sort() - for filename, contents in filename_contents_tuples: - print "%s:" % filename - print " %s" % contents - -def create_xpi(xpiname, pkg_name='aardvark', dirname='static-files', - extra_harness_options={}): - configs = test_packaging.get_configs(pkg_name, dirname) - options = {'main': configs.target_cfg.main} - options.update(configs.build) - xpi.build_xpi(template_root_dir=xpi_template_path, - manifest=fake_manifest, - xpi_path=xpiname, - harness_options=options, - extra_harness_options=extra_harness_options) - -if __name__ == '__main__': - unittest.main() |