[Pkg-javascript-commits] [node-detective] 119/119: Add autopkgtest
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:44:41 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-detective.
commit 07a1a0e639aa0b189aaad672b62d49f9fba449ab
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date: Mon Aug 28 15:45:07 2017 +0200
Add autopkgtest
---
debian/rules | 12 ++++++++++++
debian/tests/control | 6 ++++++
debian/tests/require | 2 +-
debian/tests/runexamples | 3 +++
4 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/debian/rules b/debian/rules
index d93b07a..d8c36ed 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,3 +18,15 @@ else
@echo '**********************************************************'
endif
+override_dh_installexamples:
+ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
+ dh_installexamples
+ # patch example
+ find $(CURDIR)/debian/node-detective/usr/share/doc/node-detective/examples/ -name '*.js' -exec \
+ sed -i "s,require\s*[(]\s*'[.][.][^']*'\s*[)],require('detective'),g" {} \;
+else
+ @echo '**********************************************************'
+ @echo 'Skip example '
+ @echo '**********************************************************'
+endif
+
diff --git a/debian/tests/control b/debian/tests/control
index a811eac..ccfcd3b 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,8 @@
Tests: require
Depends: node-detective
+
+Tests: runexamples
+Depends: node-detective
+
+Tests: runtestsuite
+Depends: node-detective, node-tap (>= 5.1.2)
diff --git a/debian/tests/require b/debian/tests/require
index 3f4f435..1d457a3 100644
--- a/debian/tests/require
+++ b/debian/tests/require
@@ -1,3 +1,3 @@
#!/bin/sh
set -e
-nodejs -e "require('detective');"
+node -e "require('detective');"
diff --git a/debian/tests/runexamples b/debian/tests/runexamples
new file mode 100755
index 0000000..6103d4c
--- /dev/null
+++ b/debian/tests/runexamples
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+node "/usr/share/doc/node-detective/examples/strings.js"
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-detective.git
More information about the Pkg-javascript-commits
mailing list