[Pkg-javascript-commits] [node-convert-source-map] 09/11: Add cli test

Bastien Roucariès rouca at moszumanska.debian.org
Sun Apr 16 17:39:26 UTC 2017


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

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

commit ccb455b704b9a28ffff68b7f279ab4a2b14eccf0
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Sun Apr 16 15:50:06 2017 +0200

    Add cli test
---
 debian/changelog          |  3 ++-
 debian/tests/control      |  8 ++++++++
 debian/tests/run-examples |  3 +++
 debian/tests/runtestsuite | 15 +++++++++++++++
 4 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 2c894e3..1d2d9b6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,12 +2,13 @@ node-convert-source-map (1.5.0-1) unstable; urgency=medium
 
   * Team upload.
   * New upstream version (Closes: #859098).
-    Needed for browserify.
+    Needed for browserify and fix testsuite.
   * Enable testsuite (Closes: #818319).
   * Update standards version. No change.
   * Bump compat version.
   * Fix example installation. Replace require('../') by
     require('convert-source-map').
+  * Run improved cli test.
 
  -- Bastien Roucariès <rouca at debian.org>  Sun, 16 Apr 2017 15:33:49 +0200
 
diff --git a/debian/tests/control b/debian/tests/control
index 0cdb8f9..7e8739c 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,10 @@
 Tests: require
 Depends: node-convert-source-map
+
+Tests: run-examples
+Depends: node-convert-source-map
+
+Tests: runtestsuite
+Depends:  node-convert-source-map
+        , node-tap (>= 9.0)
+        , node-inline-source-map (>= 0.6.2)
\ No newline at end of file
diff --git a/debian/tests/run-examples b/debian/tests/run-examples
new file mode 100644
index 0000000..2a17161
--- /dev/null
+++ b/debian/tests/run-examples
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+nodejs /usr/share/doc/node-convert-source-map/examples/*.js
\ No newline at end of file
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..89a07b5
--- /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='convert-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-convert-source-map.git



More information about the Pkg-javascript-commits mailing list