[Pkg-javascript-commits] [jquery] 06/18: Copy and adapt autopkgtest tests from experimental branch
Antonio Terceiro
terceiro at moszumanska.debian.org
Sat Apr 9 13:59:24 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch debian/1.x
in repository jquery.
commit 01d8e4d4ee163a37baa27071ac9cc37d5331a2f3
Author: Antonio Terceiro <terceiro at debian.org>
Date: Fri Apr 8 19:03:33 2016 -0300
Copy and adapt autopkgtest tests from experimental branch
---
debian/changelog | 1 +
debian/tests/check-against-upstream-build | 28 ++++++++++++++++++++++++++++
debian/tests/check-minification | 18 ++++++++++++++++++
debian/tests/control | 2 ++
4 files changed, 49 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 96988c2..8f44494 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ jquery (1.12.3-1) UNRELEASED; urgency=medium
it complies with the DFSG. Anyway, the files removed are documented in
debian/copyright.
- debian/watch: remove version mangling options.
+ * Copy and adapt autopkgtest tests from experimental branch
-- Antonio Terceiro <terceiro at debian.org> Fri, 08 Apr 2016 18:24:58 -0300
diff --git a/debian/tests/check-against-upstream-build b/debian/tests/check-against-upstream-build
new file mode 100755
index 0000000..2075edc
--- /dev/null
+++ b/debian/tests/check-against-upstream-build
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+exec 2>&1
+
+set -ex
+
+version=$(dpkg-parsechangelog -SVersion | cut -d - -f 1 | sed 's/~/-/')
+
+main_build="$1"
+if [ -z "$main_build" ]; then
+ main_build='/usr/share/javascript/jquery/jquery.js'
+fi
+
+upstream_cache="$ADTTMP"
+if [ -z "$upstream_cache" ]; then
+ upstream_cache=$HOME/.cache/jquery-debian
+ mkdir -p "$upstream_cache"
+fi
+upstream_main_build=$upstream_cache/jquery-${version}.js
+
+if [ ! -f "$upstream_main_build" ]; then
+ wget --output-document="$upstream_main_build" \
+ http://code.jquery.com/jquery-${version}.js
+fi
+
+diff --ignore-blank-lines \
+ --ignore-matching-lines=Date:.*Z \
+ -u "$upstream_main_build" "$main_build"
diff --git a/debian/tests/check-minification b/debian/tests/check-minification
new file mode 100755
index 0000000..15f13de
--- /dev/null
+++ b/debian/tests/check-minification
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+rc=0
+
+if [ $# -eq 0 ]; then
+ eval set -- /usr/share/javascript/jquery/jquery.min.js
+fi
+
+for minjs in "$@"; do
+ if grep -q '^..# sourceMappingURL=' $minjs; then
+ echo "E: $minjs contains '//# sourceMappingURL=.*'"
+ rc=1
+ fi
+done
+
+exit $rc
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..33c37c1
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: check-against-upstream-build, check-minification
+Depends: @, wget
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/jquery.git
More information about the Pkg-javascript-commits
mailing list