summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@ubuntu.com>2011-07-09 20:22:00 +0200
committerBenjamin Drung <bdrung@ubuntu.com>2011-07-09 20:22:00 +0200
commitc5178d7b50957a9f54f9bed8a6d7ccf081798118 (patch)
tree5a69ef5711c18b80607bcec84bc52ead63934450 /tests
parentdf58f3a3d891a494232d6e49a5a1862a557e8930 (diff)
Add an --all parameter to dh_xul-ext to make packages that work with every
browser they can actually work with (Closes: #610499).
Diffstat (limited to 'tests')
-rw-r--r--tests/dh_xul-ext/all/debian/changelog5
-rw-r--r--tests/dh_xul-ext/all/debian/compat1
-rw-r--r--tests/dh_xul-ext/all/debian/control17
-rwxr-xr-xtests/dh_xul-ext/all/debian/rules8
-rw-r--r--tests/dh_xul-ext/all/install.rdf40
-rw-r--r--tests/dh_xul-ext/debian/debian/changelog5
-rw-r--r--tests/dh_xul-ext/debian/debian/compat1
-rw-r--r--tests/dh_xul-ext/debian/debian/control17
-rwxr-xr-xtests/dh_xul-ext/debian/debian/rules8
-rw-r--r--tests/dh_xul-ext/debian/install.rdf40
-rw-r--r--tests/dh_xul-ext/expected_result/all.substvars4
-rw-r--r--tests/dh_xul-ext/expected_result/debian.substvars4
-rw-r--r--tests/dh_xul-ext/expected_result/ubuntu.substvars4
-rwxr-xr-xtests/dh_xul-ext/test78
-rw-r--r--tests/dh_xul-ext/ubuntu/debian/changelog5
-rw-r--r--tests/dh_xul-ext/ubuntu/debian/compat1
-rw-r--r--tests/dh_xul-ext/ubuntu/debian/control17
-rwxr-xr-xtests/dh_xul-ext/ubuntu/debian/rules8
-rw-r--r--tests/dh_xul-ext/ubuntu/install.rdf40
19 files changed, 303 insertions, 0 deletions
diff --git a/tests/dh_xul-ext/all/debian/changelog b/tests/dh_xul-ext/all/debian/changelog
new file mode 100644
index 0000000..1b45ee9
--- /dev/null
+++ b/tests/dh_xul-ext/all/debian/changelog
@@ -0,0 +1,5 @@
+test-package (1.0-1) UNRELEASED; urgency=low
+
+ * Initial release.
+
+ -- Benjamin Drung <bdrung@debian.org> Sat, 09 Jul 2011 12:55:23 +0200
diff --git a/tests/dh_xul-ext/all/debian/compat b/tests/dh_xul-ext/all/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/tests/dh_xul-ext/all/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/tests/dh_xul-ext/all/debian/control b/tests/dh_xul-ext/all/debian/control
new file mode 100644
index 0000000..346ceba
--- /dev/null
+++ b/tests/dh_xul-ext/all/debian/control
@@ -0,0 +1,17 @@
+Source: test-package
+Section: web
+Priority: extra
+Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam@lists.ubuntu.com>
+Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~)
+Standards-Version: 3.9.2
+
+Package: xul-ext-test-package
+Architecture: all
+Depends: ${misc:Depends}, ${xpi:Depends}
+Recommends: ${xpi:Recommends}
+Provides: ${xpi:Provides}
+Enhances: ${xpi:Enhances}
+Description: mozilla-devscripts test package
+ This is a test package designed to test some scripts in mozilla-devscripts.
+ It is part of the mozilla-devscripts test suite and may do very odd things. It
+ should not be installed like a regular package. It may be an empty package.
diff --git a/tests/dh_xul-ext/all/debian/rules b/tests/dh_xul-ext/all/debian/rules
new file mode 100755
index 0000000..d69fe4a
--- /dev/null
+++ b/tests/dh_xul-ext/all/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+override_dh_install:
+ dh_install install.rdf /usr/share/xul-ext/test-package/
+ ../../../src/dh_xul-ext -a
diff --git a/tests/dh_xul-ext/all/install.rdf b/tests/dh_xul-ext/all/install.rdf
new file mode 100644
index 0000000..773eaa0
--- /dev/null
+++ b/tests/dh_xul-ext/all/install.rdf
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>{deadda7a-fee1-dead-coo1-d00ddeadc0de}</em:id>
+ <em:version>1.0</em:version>
+ <em:name>mozilla-devscripts test package</em:name>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceweasel/Firefox -->
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+ <em:minVersion>3.5</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Icedove/Thunderbird -->
+ <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
+ <em:minVersion>3.0</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceape/Seamonkey -->
+ <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
+ <em:minVersion>2.0</em:minVersion>
+ <em:maxVersion>2.4a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Conkeror -->
+ <em:id>{a79fe89b-6662-4ff4-8e88-09950ad4dfde}</em:id>
+ <em:minVersion>0.1</em:minVersion>
+ <em:maxVersion>100.0</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ </Description>
+</RDF>
diff --git a/tests/dh_xul-ext/debian/debian/changelog b/tests/dh_xul-ext/debian/debian/changelog
new file mode 100644
index 0000000..1b45ee9
--- /dev/null
+++ b/tests/dh_xul-ext/debian/debian/changelog
@@ -0,0 +1,5 @@
+test-package (1.0-1) UNRELEASED; urgency=low
+
+ * Initial release.
+
+ -- Benjamin Drung <bdrung@debian.org> Sat, 09 Jul 2011 12:55:23 +0200
diff --git a/tests/dh_xul-ext/debian/debian/compat b/tests/dh_xul-ext/debian/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/tests/dh_xul-ext/debian/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/tests/dh_xul-ext/debian/debian/control b/tests/dh_xul-ext/debian/debian/control
new file mode 100644
index 0000000..346ceba
--- /dev/null
+++ b/tests/dh_xul-ext/debian/debian/control
@@ -0,0 +1,17 @@
+Source: test-package
+Section: web
+Priority: extra
+Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam@lists.ubuntu.com>
+Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~)
+Standards-Version: 3.9.2
+
+Package: xul-ext-test-package
+Architecture: all
+Depends: ${misc:Depends}, ${xpi:Depends}
+Recommends: ${xpi:Recommends}
+Provides: ${xpi:Provides}
+Enhances: ${xpi:Enhances}
+Description: mozilla-devscripts test package
+ This is a test package designed to test some scripts in mozilla-devscripts.
+ It is part of the mozilla-devscripts test suite and may do very odd things. It
+ should not be installed like a regular package. It may be an empty package.
diff --git a/tests/dh_xul-ext/debian/debian/rules b/tests/dh_xul-ext/debian/debian/rules
new file mode 100755
index 0000000..2872153
--- /dev/null
+++ b/tests/dh_xul-ext/debian/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+override_dh_install:
+ dh_install install.rdf /usr/share/xul-ext/test-package/
+ DEB_VENDOR=Debian ../../../src/dh_xul-ext
diff --git a/tests/dh_xul-ext/debian/install.rdf b/tests/dh_xul-ext/debian/install.rdf
new file mode 100644
index 0000000..773eaa0
--- /dev/null
+++ b/tests/dh_xul-ext/debian/install.rdf
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>{deadda7a-fee1-dead-coo1-d00ddeadc0de}</em:id>
+ <em:version>1.0</em:version>
+ <em:name>mozilla-devscripts test package</em:name>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceweasel/Firefox -->
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+ <em:minVersion>3.5</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Icedove/Thunderbird -->
+ <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
+ <em:minVersion>3.0</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceape/Seamonkey -->
+ <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
+ <em:minVersion>2.0</em:minVersion>
+ <em:maxVersion>2.4a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Conkeror -->
+ <em:id>{a79fe89b-6662-4ff4-8e88-09950ad4dfde}</em:id>
+ <em:minVersion>0.1</em:minVersion>
+ <em:maxVersion>100.0</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ </Description>
+</RDF>
diff --git a/tests/dh_xul-ext/expected_result/all.substvars b/tests/dh_xul-ext/expected_result/all.substvars
new file mode 100644
index 0000000..0b86163
--- /dev/null
+++ b/tests/dh_xul-ext/expected_result/all.substvars
@@ -0,0 +1,4 @@
+xpi:Depends=iceweasel (>= 3.5) | icedove (>= 3.0) | iceape (>= 2.0) | conkeror | firefox | thunderbird (>= 3.0) | seamonkey (>= 2.0)
+xpi:Recommends=
+xpi:Enhances=conkeror, firefox, iceape, icedove, iceweasel, seamonkey, thunderbird
+xpi:Provides=conkeror-test-package, firefox-test-package, iceape-test-package, icedove-test-package, iceweasel-test-package, seamonkey-test-package, test-package, thunderbird-test-package
diff --git a/tests/dh_xul-ext/expected_result/debian.substvars b/tests/dh_xul-ext/expected_result/debian.substvars
new file mode 100644
index 0000000..923b41b
--- /dev/null
+++ b/tests/dh_xul-ext/expected_result/debian.substvars
@@ -0,0 +1,4 @@
+xpi:Depends=iceweasel (>= 3.5) | icedove (>= 3.0) | iceape (>= 2.0) | conkeror
+xpi:Recommends=
+xpi:Enhances=conkeror, iceape, icedove, iceweasel
+xpi:Provides=conkeror-test-package, iceape-test-package, icedove-test-package, iceweasel-test-package, test-package
diff --git a/tests/dh_xul-ext/expected_result/ubuntu.substvars b/tests/dh_xul-ext/expected_result/ubuntu.substvars
new file mode 100644
index 0000000..6f7e3be
--- /dev/null
+++ b/tests/dh_xul-ext/expected_result/ubuntu.substvars
@@ -0,0 +1,4 @@
+xpi:Depends=firefox | thunderbird (>= 3.0) | seamonkey (>= 2.0)
+xpi:Recommends=
+xpi:Enhances=firefox, seamonkey, thunderbird
+xpi:Provides=firefox-test-package, seamonkey-test-package, test-package, thunderbird-test-package
diff --git a/tests/dh_xul-ext/test b/tests/dh_xul-ext/test
new file mode 100755
index 0000000..9936ca6
--- /dev/null
+++ b/tests/dh_xul-ext/test
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+
+# Copyright (c) 2011, Benjamin Drung <bdrung@debian.org>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+import os
+import sys
+import subprocess
+
+TESTS = ("all", "debian", "ubuntu")
+
+class TestError(Exception):
+ pass
+
+def escape_arg(arg):
+ "Shell-escpae arg, if necessary"
+ if ' ' not in arg:
+ return arg
+ return '"%s"' % arg.replace('\\', r'\\').replace('"', r'\"')
+
+def fail(message):
+ print >> sys.stderr, "dh_xul-ext test error: " + message
+ sys.exit(1)
+
+def check_call(cmd, cwd=None):
+ return_code = subprocess.call(cmd, cwd=cwd)
+ if return_code != 0:
+ raise TestError("'" + " ".join(escape_arg(cmd)) + "' returned " +
+ str(return_code) + ".")
+
+def compare_files(file1, file2):
+ actual = open(file1).read().strip()
+ expected = open(file2).read().strip()
+ if actual != expected:
+ raise TestError("Actual substvars files differs from expected file.\n"
+ "Expected content:\n" + expected + "\n" + \
+ "Actual content:\n" + actual)
+
+def test_dh_xul_ext(test):
+ basedir = os.path.dirname(__file__)
+ testdir = os.path.join(basedir, test)
+ clean_cmd = ["fakeroot", "debian/rules", "clean"]
+ check_call(clean_cmd, cwd=testdir)
+ try:
+ cmd = ["fakeroot", "debian/rules", "install"]
+ check_call(cmd, cwd=testdir)
+ substvars = os.path.join(testdir, "debian",
+ "xul-ext-test-package.substvars")
+ expected = os.path.join(basedir, "expected_result", test + ".substvars")
+ compare_files(substvars, expected)
+ finally:
+ check_call(clean_cmd, cwd=testdir)
+
+def main():
+ errors = 0
+ for test in TESTS:
+ try:
+ test_dh_xul_ext(test)
+ except TestError, error:
+ errors += 1
+ print >> sys.stderr, "dh_xul-ext error in " + test + " test: " + \
+ str(error)
+ if errors > 0:
+ sys.exit(1)
+
+if __name__ == "__main__":
+ main()
diff --git a/tests/dh_xul-ext/ubuntu/debian/changelog b/tests/dh_xul-ext/ubuntu/debian/changelog
new file mode 100644
index 0000000..1b45ee9
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/debian/changelog
@@ -0,0 +1,5 @@
+test-package (1.0-1) UNRELEASED; urgency=low
+
+ * Initial release.
+
+ -- Benjamin Drung <bdrung@debian.org> Sat, 09 Jul 2011 12:55:23 +0200
diff --git a/tests/dh_xul-ext/ubuntu/debian/compat b/tests/dh_xul-ext/ubuntu/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/tests/dh_xul-ext/ubuntu/debian/control b/tests/dh_xul-ext/ubuntu/debian/control
new file mode 100644
index 0000000..346ceba
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/debian/control
@@ -0,0 +1,17 @@
+Source: test-package
+Section: web
+Priority: extra
+Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam@lists.ubuntu.com>
+Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~)
+Standards-Version: 3.9.2
+
+Package: xul-ext-test-package
+Architecture: all
+Depends: ${misc:Depends}, ${xpi:Depends}
+Recommends: ${xpi:Recommends}
+Provides: ${xpi:Provides}
+Enhances: ${xpi:Enhances}
+Description: mozilla-devscripts test package
+ This is a test package designed to test some scripts in mozilla-devscripts.
+ It is part of the mozilla-devscripts test suite and may do very odd things. It
+ should not be installed like a regular package. It may be an empty package.
diff --git a/tests/dh_xul-ext/ubuntu/debian/rules b/tests/dh_xul-ext/ubuntu/debian/rules
new file mode 100755
index 0000000..0d70add
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+override_dh_install:
+ dh_install install.rdf /usr/share/xul-ext/test-package/
+ DEB_VENDOR=Ubuntu ../../../src/dh_xul-ext
diff --git a/tests/dh_xul-ext/ubuntu/install.rdf b/tests/dh_xul-ext/ubuntu/install.rdf
new file mode 100644
index 0000000..773eaa0
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/install.rdf
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>{deadda7a-fee1-dead-coo1-d00ddeadc0de}</em:id>
+ <em:version>1.0</em:version>
+ <em:name>mozilla-devscripts test package</em:name>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceweasel/Firefox -->
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+ <em:minVersion>3.5</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Icedove/Thunderbird -->
+ <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
+ <em:minVersion>3.0</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceape/Seamonkey -->
+ <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
+ <em:minVersion>2.0</em:minVersion>
+ <em:maxVersion>2.4a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Conkeror -->
+ <em:id>{a79fe89b-6662-4ff4-8e88-09950ad4dfde}</em:id>
+ <em:minVersion>0.1</em:minVersion>
+ <em:maxVersion>100.0</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ </Description>
+</RDF>