[Pkg-javascript-commits] [node-browser-pack] 06/07: Add autopkgtest

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 12:25:00 UTC 2017


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

rouca pushed a commit to tag debian-6.0.2+ds-1
in repository node-browser-pack.

commit 959a253296d9db067dca75d1f60b5a0908d470c7
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Fri Sep 15 12:13:14 2017 +0200

    Add autopkgtest
---
 debian/browser-pack.1                 | 36 +++++++++++++++++++++++++++++++++++
 debian/tests/control                  | 19 ++++++++++++++++++
 debian/tests/require                  |  0
 debian/tests/runexamples              |  4 ++++
 debian/tests/runtestsuite             | 15 +++++++++++++++
 debian/tests/runtestsuitelocalrebuilt | 15 +++++++++++++++
 6 files changed, 89 insertions(+)

diff --git a/debian/browser-pack.1 b/debian/browser-pack.1
new file mode 100644
index 0000000..ecf7d50
--- /dev/null
+++ b/debian/browser-pack.1
@@ -0,0 +1,36 @@
+.Dd 8/4/17
+.Dt browser-pack 1
+.Sh NAME
+.Nm browser-pack
+.Nd pack Node.js source file information for browserify uses
+.Sh SYNOPSIS
+.Nm
+.Op Ar file
+.Sh DESCRIPTION
+.Nm 
+pack node-style source files from a json stream into a browser bundle.
+.Nm
+will input a json file and output a javascript file.
+.Nm
+will read by default STDIN.
+.Sh EXAMPLES
+.nf
+browser-pack <<EOF
+[
+  {
+    "id": "a1b5af78",
+    "source": "console.log(require('./foo')(5))",
+    "deps": { "./foo": "b8f69fa5" },
+    "entry": true
+  },
+  {
+    "id": "b8f69fa5",
+    "source": "module.exports = function (n) { return n * 111 }",
+    "deps": {}
+  }
+]
+EOF
+.fi
+.Sh SEE ALSO
+.Xr browserify 1 ,
+.Xr nodejs 1 ,
diff --git a/debian/tests/control b/debian/tests/control
index febd805..c7625be 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,21 @@
 Tests: require
 Depends: node-browser-pack
+
+Tests: runexamples
+Depends: node-browser-pack
+
+Tests: runtestsuite
+Depends: node-browser-pack
+ , node-tap (>= 2.2.0)
+ , node-concat-stream (>= 1.5.1)
+ , node-convert-source-map (>= 1.1.0)
+ , node-parse-base64vlq-mappings (>= 0.1.1)
+
+Tests: runtestsuitelocalrebuilt
+Depends: node-browser-pack
+ , node-tap (>= 2.2.0)
+ , node-concat-stream (>= 1.5.1)
+ , node-convert-source-map (>= 1.1.0)
+ , node-parse-base64vlq-mappings (>= 0.1.1)
+ , build-essential
+ , node-uglify (>= 1.3.5)
diff --git a/debian/tests/require b/debian/tests/require
old mode 100644
new mode 100755
diff --git a/debian/tests/runexamples b/debian/tests/runexamples
new file mode 100755
index 0000000..67e3607
--- /dev/null
+++ b/debian/tests/runexamples
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+JSON=/usr/share/doc/browser-pack/examples/input.json
+browser-pack < "$JSON"
\ No newline at end of file
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..238c65f
--- /dev/null
+++ b/debian/tests/runtestsuite
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+PACKAGE=browser-pack
+SEDCMD="-e s,require[\(][[\'][.][.]/[\'][\)],require\(\'browser-pack\'\),g"
+
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP
+
+cp -r test $tmpdir
+find test -name '*.js' -print0 | \
+    xargs -n1 -0 \
+	  sh -c 'set -e; echo "TESTING: $3"; sed $1 < $3 > $2/$3' sedtape "$SEDCMD" "$tmpdir"
+
+cd $tmpdir
+tap test/*.js
diff --git a/debian/tests/runtestsuitelocalrebuilt b/debian/tests/runtestsuitelocalrebuilt
new file mode 100755
index 0000000..548aed1
--- /dev/null
+++ b/debian/tests/runtestsuitelocalrebuilt
@@ -0,0 +1,15 @@
+#!/bin/sh
+# _prelude is so that we will try to rebuilt
+set -e
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP
+
+cp -r test "$tmpdir"
+cp -r debian "$tmpdir"
+cp *.js "$tmpdir"
+
+cd $tmpdir
+rm -f _prelude.js || true
+# rebuild
+make -f debian/rules _prelude.js
+tap test/*.js

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



More information about the Pkg-javascript-commits mailing list