[Pkg-javascript-commits] [node-sha.js] 236/237: Add testsuite cli

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


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

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

commit 9d17ee5cee5965d8fc52b4ef16fa13c3a071e57a
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Thu Apr 20 21:54:20 2017 +0200

    Add testsuite cli
---
 debian/control            |  1 +
 debian/tests/control      |  3 +++
 debian/tests/runtestsuite | 14 ++++++++++++++
 3 files changed, 18 insertions(+)

diff --git a/debian/control b/debian/control
index 62dd700..26457ac 100644
--- a/debian/control
+++ b/debian/control
@@ -10,6 +10,7 @@ Build-Depends:
  , dpkg-dev (>= 1.17.14)
  , node-tape (>= 3.0.1) <!nocheck>
  , node-inherits (>= 2.0.1) <!nocheck>
+ , node-hash-test-vectors <!nocheck>
 Standards-Version: 3.9.8
 Homepage: https://github.com/crypto-browserify/sha.js
 Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-sha.js.git
diff --git a/debian/tests/control b/debian/tests/control
index 699245d..ed7e453 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-sha.js
+
+Tests: runtestsuite
+Depends: node-sha.js, node-tape (>= 3.0.1), node-hash-test-vectors
\ No newline at end of file
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..434ee01
--- /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='sha.js'
+SEDCMD="s,require\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"
+tape $tmpdir/test/*.js

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



More information about the Pkg-javascript-commits mailing list