[Pkg-javascript-commits] [node-shasum] 22/23: Add test suite

Bastien Roucariès rouca at moszumanska.debian.org
Fri May 5 09:06:25 UTC 2017


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

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

commit b99e3d56f74cb62fde0c9e272fd034625e601d2b
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Sun Apr 30 23:50:16 2017 +0200

    Add test suite
---
 debian/control            |  1 +
 debian/tests/control      |  3 +++
 debian/tests/runtestsuite | 16 ++++++++++++++++
 3 files changed, 20 insertions(+)

diff --git a/debian/control b/debian/control
index 099c4ac..28ca811 100644
--- a/debian/control
+++ b/debian/control
@@ -8,6 +8,7 @@ Build-Depends:
  , dh-buildinfo
  , nodejs (>= 4.7)
  , dpkg-dev (>= 1.17.14)
+ , node-assert <!nocheck>
  , node-json-stable-stringify <!nocheck>
  , node-sha.js (>= 2.4.4) <!nocheck>
 Standards-Version: 3.9.8
diff --git a/debian/tests/control b/debian/tests/control
index 143fa08..916a459 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-shasum
+
+Tests: runtestsuite
+Depends: node-shasum, node-assert
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..4cb8c0e
--- /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='shasum'
+SEDCMD="s,'[.][.],'$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 -e "$1" < "$3" > "$2/$3"' sedtape "$SEDCMD" "$tmpdir"
+nodejs $tmpdir/test/index.js
+nodejs $tmpdir/test/index.js browser
+

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



More information about the Pkg-javascript-commits mailing list