[Pkg-javascript-commits] [node-process-nextick-args] 04/05: Add testsuite
Bastien Roucariès
rouca at moszumanska.debian.org
Mon Mar 12 10:05:32 UTC 2018
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-process-nextick-args.
commit 8ba98f8bf1a817554f9bcbc16ffa7c9963dad09f
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date: Mon Mar 12 10:55:06 2018 +0100
Add testsuite
---
debian/control | 6 +++---
debian/rules | 6 ++++++
debian/tests/control | 5 ++++-
debian/tests/require | 2 +-
debian/tests/runtestsuite | 17 +++++++++++++++++
5 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/debian/control b/debian/control
index 4441ee1..d11178c 100644
--- a/debian/control
+++ b/debian/control
@@ -4,10 +4,10 @@ Priority: optional
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
Uploaders: Ross Gammon <rossgammon at mail.dk>
Build-Depends: debhelper (>= 11),
+ dpkg-dev (>= 1.17.14),
dh-buildinfo,
- nodejs,
- node-tap
-Standards-Version: 3.9.8
+ node-tap (>=0.2.6) <!nocheck>
+Standards-Version: 4.1.3
Homepage: https://github.com/calvinmetcalf/process-nextick-args
Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-process-nextick-args.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-process-nextick-args.git
diff --git a/debian/rules b/debian/rules
index e4da2e3..6adff34 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,4 +8,10 @@
dh $@
override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
tap -R spec test.js
+else
+ @echo '**********************************************************'
+ @echo 'Skip test suite '
+ @echo '**********************************************************'
+endif
diff --git a/debian/tests/control b/debian/tests/control
index 1b5340d..d5f0df5 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
Tests: require
-Depends: node-process-nextick-args
+Depends: node-process-nextick-args, nodejs (>=6)
+
+Tests: runtestsuite
+Depends: node-process-nextick-args, nodejs (>=6), node-tap (>=0.2.6)
diff --git a/debian/tests/require b/debian/tests/require
old mode 100644
new mode 100755
index 4c0dace..80baf4a
--- a/debian/tests/require
+++ b/debian/tests/require
@@ -1,3 +1,3 @@
#!/bin/sh
set -e
-nodejs -e "require('process-nextick-args');"
+node -e "require('process-nextick-args');"
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..1133883
--- /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='process-nextick-args'
+SEDCMD="s,(require|resolve)\s*[(]\s*'[.]/,\\1('$PACKAGE/,g"
+
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP
+
+cp -r test* $tmpdir/test*
+echo test.js | \
+ xargs -n1 \
+ sh -c 'set -e; echo "TESTING: $3"; sed -E "$1" < "$3" > "$2/$3"' sedtape "$SEDCMD" "$tmpdir"
+cd $tmpdir
+
+tap -R spec test.js
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-process-nextick-args.git
More information about the Pkg-javascript-commits
mailing list