[Pkg-javascript-commits] [node-js-yaml] 03/03: Add runtestsuite

Bastien Roucariès rouca at moszumanska.debian.org
Thu Aug 17 15:26:12 UTC 2017


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

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

commit 5e6694330562f8decfd510711a26659a8f50af86
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Thu Aug 17 17:11:26 2017 +0200

    Add runtestsuite
---
 debian/changelog          |  3 ++-
 debian/tests/control      |  3 +++
 debian/tests/runtestsuite | 17 +++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 2257f89..c0d3f00 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,8 @@ node-js-yaml (3.9.1+dfsg-1) unstable; urgency=medium
   * Team upload
   * Bump compat
   * Create build profile nodoc, nocheck to reduce
-    build loop of node-tape
+    build loop of node-tape.
+  * Run a copy of testsuite in autopkgtest
 
  -- Bastien Roucariès <rouca at debian.org>  Thu, 17 Aug 2017 16:18:15 +0200
 
diff --git a/debian/tests/control b/debian/tests/control
index d04eeab..fc769a6 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-js-yaml
+
+Tests: runtestsuite
+Depends: node-js-yaml, mocha (>= 1.20)
\ No newline at end of file
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..6391211
--- /dev/null
+++ b/debian/tests/runtestsuite
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+# notice the / at end in order to load this module
+PACKAGE='js-yaml'
+SEDCMD1="s,require\s*[(]\s*'([.][.]/)+lib,require('$PACKAGE/lib,g"
+SEDCMD2="s,require\s*[(]\s*'([.][.]/)*[.][..]/?'\s*[)],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: $4"; sed -E -e "$1" -e "$2" < "$4" > "$3/$4"' sedtape "$SEDCMD1" "$SEDCMD2" "$tmpdir"
+
+mocha -R spec $tmpdir/test/*.js

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



More information about the Pkg-javascript-commits mailing list