[Pkg-javascript-commits] [node-minimatch] 05/05: Run autopkg testsuite in isolation
Bastien Roucariès
rouca at moszumanska.debian.org
Sun Aug 13 21:31:47 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-minimatch.
commit 04c1b6c2349176d97a8ac45b36210ff7f9324a92
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date: Sun Aug 13 22:56:11 2017 +0200
Run autopkg testsuite in isolation
---
debian/changelog | 1 +
debian/tests/control | 7 +++++--
debian/tests/require | 3 +++
debian/tests/runtestsuite | 15 +++++++++++++++
4 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 4ef9a5c..c1d513d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ node-minimatch (3.0.4-1) unstable; urgency=medium
* Bump policy no change
* Bump compat
* Enable testsuite
+ * Run autopkgtest suite in isolation
-- Bastien Roucariès <rouca at debian.org> Sun, 13 Aug 2017 22:44:56 +0200
diff --git a/debian/tests/control b/debian/tests/control
index a1b181d..0527bf4 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
-Test-Command: tap test/*.js
-Depends: @, node-tap
+Tests: require
+Depends: node-minimatch
+
+Tests: runtestsuite
+Depends: node-minimatch, node-tap (>= 8.0)
\ No newline at end of file
diff --git a/debian/tests/require b/debian/tests/require
new file mode 100644
index 0000000..e281cbd
--- /dev/null
+++ b/debian/tests/require
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+nodejs -e "require('minimatch');"
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..c5165be
--- /dev/null
+++ b/debian/tests/runtestsuite
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+# notice the / at end in order to load this module
+PACKAGE='minimatch'
+SEDCMD="s,require\s*[(]\s*'[.][.]/?'\s*[)],require('$PACKAGE'),g"
+
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP
+
+cp -r test/ $tmpdir/test
+find test/ -name '*.js' -print0 | \
+ xargs -0 -n1 \
+ sh -c 'set -e; echo "Create: $3"; sed -E "$1" < "$3" > "$2/$3"' sedtape "$SEDCMD" "$tmpdir"
+
+tap $tmpdir/test/*.js
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-minimatch.git
More information about the Pkg-javascript-commits
mailing list