[Pkg-javascript-commits] [node-errno] 01/05: enable tests

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Thu Apr 13 10:34:25 UTC 2017


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

praveen pushed a commit to branch master
in repository node-errno.

commit dd85fae82c6a6c5bad791974b8c98d57f5fb0d46
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Thu Apr 13 13:39:03 2017 +0530

    enable tests
---
 debian/tests/control      |  3 +++
 debian/tests/runtestsuite | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
index 0fb4c36..be97dbe 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-errno
+
+Test-Command: runtestsuite
+Depends: @
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..fd33c15
--- /dev/null
+++ b/debian/tests/runtestsuite
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -e
+# adapted from node-bn.js
+# notice the / at end in order to load this module
+PACKAGE='errno'
+SEDCMD="s,require\s*[(]\s*'[.]/?([^']*)'\s*[)],require('$PACKAGE/\1'),g"
+
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP
+
+cp -r test.js $tmpdir
+find . -name 'test.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 -name 'test.js' -maxdepth 1 -print0 | xargs -0 -n1 nodejs

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



More information about the Pkg-javascript-commits mailing list