[Pkg-javascript-commits] [node-inline-source-map] 02/03: Improve autopkgtest

Bastien Roucariès rouca at moszumanska.debian.org
Thu Aug 17 09:51:05 UTC 2017


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

rouca pushed a commit to branch master
in repository node-inline-source-map.

commit 404bc5dba76a23e86acfa1ce2cfba7873d699cc5
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Sun Apr 16 23:12:15 2017 +0200

    Improve autopkgtest
---
 debian/changelog          |  4 +++-
 debian/tests/control      |  6 ++++++
 debian/tests/run-examples |  4 ++++
 debian/tests/runtestsuite | 15 +++++++++++++++
 4 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 84e9e73..3f2d9dc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 node-inline-source-map (0.6.1-3) experimental; urgency=medium
 
-  * Fix example.
+  * Team upload.
+  * Fix examples.
+  * Improve autopkgtest.
 
  -- Bastien Roucariès <rouca at debian.org>  Sun, 16 Apr 2017 23:06:11 +0200
 
diff --git a/debian/tests/control b/debian/tests/control
index 691944e..613ac98 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,8 @@
 Tests: require
 Depends: node-inline-source-map
+
+Tests: run-examples
+Depends: node-inline-source-map
+
+Tests: runtestsuite
+Depends: node-inline-source-map, node-tap (>= 8.0)
diff --git a/debian/tests/run-examples b/debian/tests/run-examples
new file mode 100644
index 0000000..4d8af07
--- /dev/null
+++ b/debian/tests/run-examples
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+PACKAGE=node-inline-source-map
+find  "/usr/share/doc/$PACKAGE/examples/" -name '*.js' -print0 | xargs -0 -n1 nodejs
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..d81de24
--- /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='inline-source-map'
+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
+tap $tmpdir/test/*.js

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-inline-source-map.git



More information about the Pkg-javascript-commits mailing list