[Pkg-javascript-commits] [acorn] 02/03: run testsuite on installed package
Bastien Roucariès
rouca at moszumanska.debian.org
Sat Aug 19 14:21:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository acorn.
commit d6f5fe6e5d0f40cc93755947e0b0bca080d96397
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date: Sat Aug 19 16:15:46 2017 +0200
run testsuite on installed package
---
debian/tests/control | 3 +++
debian/tests/runtestsuite | 16 ++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/debian/tests/control b/debian/tests/control
index 97f52e2..a545b0c 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -3,3 +3,6 @@ Depends: node-acorn
Tests: smoketest
Depends: node-acorn
+
+Tests: runtestsuite
+Depends: node-acorn
diff --git a/debian/tests/runtestsuite b/debian/tests/runtestsuite
new file mode 100755
index 0000000..5418a61
--- /dev/null
+++ b/debian/tests/runtestsuite
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -e
+# notice the / at end in order to load this module
+PACKAGE='acorn'
+SEDCMD1="s,require\s*[(]\s*[\"][.][.]/dist/acorn[\"'],require(\"$PACKAGE/\",g"
+SEDCMD2="s,require\s*[(]\s*[\"][.][.]/dist/acorn_loose[\"'],require(\"$PACKAGE/loose\",g"
+SEDCMD3="s,require\s*[(]\s*[\"'][.][.][\"'],require('$PACKAGE',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: $5"; sed -E -e "$1" -e "$2" -e "$3" < "$5" > "$4/$5"' sedtape "$SEDCMD1" "$SEDCMD2" "$SEDCMD3" "$tmpdir"
+nodejs $tmpdir/test/run.js
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/acorn.git
More information about the Pkg-javascript-commits
mailing list