[Pkg-javascript-commits] [node-log-driver] 14/15: Add autopkgtestsuite

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:49:11 UTC 2017


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

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

commit a520bfa5c9d20f5ba016e5549db3d5050dfe0a0d
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Thu Aug 24 22:54:20 2017 +0200

    Add autopkgtestsuite
---
 debian/tests/control      |  6 ++++++
 debian/tests/require      |  2 +-
 debian/tests/runtestsuite | 16 ++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/debian/tests/control b/debian/tests/control
index 929b7d5..871462f 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,8 @@
 Tests: require
+Depends: node-log-driver, nodejs (>= 6)
+
+Tests: runtestsuite
 Depends: node-log-driver
+ , mocha (>= 1.20)
+ , node-sinon (>= 1.5.2)
+ , node-should (>= 1.1.0)
diff --git a/debian/tests/require b/debian/tests/require
index 51a3e7e..cad5050 100644
--- a/debian/tests/require
+++ b/debian/tests/require
@@ -1,3 +1,3 @@
 #!/bin/sh
 set -e
-nodejs -e "require('log-driver');"
+node -e "require('log-driver');"
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..52dd922
--- /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='log-driver'
+SEDCMD="s,require\s*[(]['][.][.]/index['][)],require('$PACKAGE'),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"
+cd $tmpdir
+bash
+mocha -R xunit
\ No newline at end of file

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



More information about the Pkg-javascript-commits mailing list