[Pkg-javascript-commits] [node-deps-sort] 77/79: Add autopkgtestsuite

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:41:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-deps-sort.

commit f7b62c577e84c85ac2e7f506f628161e247fd1f1
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Sun Aug 27 16:20:19 2017 +0200

    Add autopkgtestsuite
---
 debian/tests/control      |  7 ++++++-
 debian/tests/runtestsuite | 16 ++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/debian/tests/control b/debian/tests/control
index d3e0f46..331f807 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,7 @@
 Tests: require
-Depends: node-deps-sort
+Depends: node-deps-sort, nodejs (>=6)
+
+Tests: runtestsuite
+Depends: node-deps-sort,
+ nodejs (>= 6)
+ node-tap (>= 2.2)
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..bc78c42
--- /dev/null
+++ b/debian/tests/runtestsuite
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -e
+# notice the / at end in order to load this module
+PACKAGE='deps-sort'
+SEDCMD="s,require\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"
+
+cd $tmpdir
+tap test/*.js

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-deps-sort.git



More information about the Pkg-javascript-commits mailing list