[Pkg-javascript-commits] [node-hash.js] 29/29: Run testsuite

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


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

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

commit cfdd617d1019b77f63de1603f38fd218a8d29f66
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Thu Apr 13 00:28:29 2017 +0200

    Run testsuite
---
 debian/tests/control      |  3 +++
 debian/tests/runtestsuite | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
index d14ef5d..59c8dde 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-hash.js
+
+Tests: runtestsuite
+Depends: node-hash.js, mocha (>= 1.18.4)
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..625613f
--- /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='hash.js'
+SEDCMD="s,require\s*[(]\s*'[.][.]/?([^']*)'\s*[)],require('$PACKAGE/\1'),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"
+# avoid false that does not work outside build dir
+find $tmpdir/test -name '*.js' -maxdepth 1 -print0 | xargs -0 -n1 mocha -R spec

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



More information about the Pkg-javascript-commits mailing list