[Pkg-javascript-commits] [node-shell-quote] 130/137: Add autokgtest

Bastien Roucariès rouca at moszumanska.debian.org
Fri Aug 25 19:19:46 UTC 2017


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

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

commit 934dc0ef0e20a419da9a2d3445644fa54905144c
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Mon Aug 21 14:39:35 2017 +0200

    Add autokgtest
---
 debian/tests/control      |  6 ++++++
 debian/tests/runexamples  |  3 +++
 debian/tests/runtestsuite | 15 +++++++++++++++
 3 files changed, 24 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
index 111f9a9..2cb6efa 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,8 @@
 Tests: require
 Depends: node-shell-quote
+
+Tests: runexamples
+Depends: node-shell-quote
+
+Tests: runtestsuite
+Depends: node-shell-quote
diff --git a/debian/tests/runexamples b/debian/tests/runexamples
new file mode 100755
index 0000000..0dab1cf
--- /dev/null
+++ b/debian/tests/runexamples
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+find /usr/share/doc/node-shell-quote/examples/ -name '*.js' -exec node {} \;
\ No newline at end of file
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..d569960
--- /dev/null
+++ b/debian/tests/runtestsuite
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+# notice the / at end in order to load this module
+PACKAGE='shell-quote'
+SEDCMD="-e s,require\s*[(]\s*'[.][.]/?([^']*)'\s*[)],require('$PACKAGE/\1'),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"
+# avoid false that does not work outside build dir
+tape $tmpdir/test/*.js

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



More information about the Pkg-javascript-commits mailing list