[Pkg-javascript-commits] [node-asn1.js] 201/202: Add autopkgtest

Bastien Roucariès rouca at moszumanska.debian.org
Thu Apr 20 19:19:08 UTC 2017


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

rouca pushed a commit to branch master
in repository node-asn1.js.

commit a6a5cc755f676ddc98262919beda225a44ceb466
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Mon Apr 17 22:01:06 2017 +0200

    Add autopkgtest
---
 debian/tests/control      |  3 +++
 debian/tests/runtestsuite | 14 ++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
index 3e54b4e..f5a842f 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-asn1.js
+
+Tests: runtestsuite
+Depends: node-asn1.js, mocha (>= 1.2)
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..042a23c
--- /dev/null
+++ b/debian/tests/runtestsuite
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+# notice the / at end in order to load this module
+PACKAGE='asn1.js'
+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/ -maxdepth 1 -name '*.js' -print0 | \
+    xargs -0 -n1  \
+	  sh -c 'set -e; echo "TESTING: $3"; sed "$1" < "$3" > "$2/$3"' sedtape "$SEDCMD" "$tmpdir"
+mocha -R spec $tmpdir/test

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



More information about the Pkg-javascript-commits mailing list