[Pkg-javascript-commits] [node-object-inspect] 03/03: Fix autopkgtest and examples

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


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

rouca pushed a commit to branch master
in repository node-object-inspect.

commit 8846158c7969483be669ecefd9fa395c26d73c9b
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Thu Aug 17 14:32:24 2017 +0200

    Fix autopkgtest and examples
---
 debian/changelog          |  2 ++
 debian/rules              |  6 ++++++
 debian/tests/control      |  4 ++++
 debian/tests/runtestsuite | 15 +++++++++++++++
 4 files changed, 27 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index e32da45..3f9749e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ node-object-inspect (1.3.0-1) unstable; urgency=medium
   * Use <!nocheck> profile in order to avoid a depends
     loop on node-tape
   * Use compat 10.
+  * Fix examples
+  * Run testsuite under autopkgtest
 
  -- Bastien Roucariès <rouca at debian.org>  Thu, 17 Aug 2017 14:26:17 +0200
 
diff --git a/debian/rules b/debian/rules
index 50ebe31..9ac9839 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,3 +17,9 @@ else
 	@echo '**********************************************************'
 endif
 
+override_dh_installexamples:
+	dh_installexamples
+        # patch example
+	find $(CURDIR)/debian/node-object-inspect/usr/share/doc/node-object-inspect/examples/ -name '*.js' -exec \
+                sed -i "s,require\s*[(]\s*'[.][.][^']*'\s*[)],require('node-object-inspect'),g" {} \;
+
diff --git a/debian/tests/control b/debian/tests/control
index eff01c6..4d6faca 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,6 @@
 Tests: require
 Depends: node-object-inspect
+
+Tests: runtestsuite
+Depends: node-object-inspect,
+ node-tape (>= 4.6)
\ No newline at end of file
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..ba9054d
--- /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='object-inspect'
+SEDCMD="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-object-inspect.git



More information about the Pkg-javascript-commits mailing list