[Pkg-javascript-commits] [node-tap-mocha-reporter] 119/137: Use testsuite
Bastien Roucariès
rouca at moszumanska.debian.org
Thu Sep 7 09:49:32 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-tap-mocha-reporter.
commit 11a0b8ef40d8bdfcf991d031aa44425d2bfc35e9
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date: Tue Aug 22 14:44:04 2017 +0200
Use testsuite
---
debian/rules | 46 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/debian/rules b/debian/rules
index de57af0..c2af535 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,12 +4,54 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+# run the test using local copy instead of installed one
+RUN_TEST_LOCAL?=1
+
+ifeq ($(RUN_TEST_LOCAL),1)
+TAP_MOCHA_JSPATH?=./index.js
+TAP_MOCHA_INSTALL_PATH?=./index.js
+else
+TAP_MOCHA_JSPATH?= tap-mocha-reporter
+TAP_MOCHA_INSTALL_PATH?=/usr/bin/tap-mocha-reporter
+endif
+
+# newline for make
+define newline
+
+
+endef
+
+# find all reporter supported
+define FIND_REPORTER_JS
+ 'use strict';
+ try {
+ var F = require('$(TAP_MOCHA_JSPATH)');
+ process.stdout.write(F.types.join(' '));
+ process.exit(0);
+ }
+ catch (e) {
+ process.exit(1);
+ }
+endef
+
+
%:
dh $@
#override_dh_auto_build:
-#override_dh_auto_test:
-
+override_dh_auto_test: run_test_suite
+# run a smoke test
+run_test_suite:
+ set -e; \
+ LIST=`set -e; node -pe "$(subst $(newline),,$(FIND_REPORTER_JS))"`; \
+ echo "List of reporter: $$LIST"; \
+ for r in $$LIST; do \
+ echo "Use reporter $$r"; \
+ echo "=========================================================" ; \
+ tap test/*.js | $(TAP_MOCHA_INSTALL_PATH) $$r ; \
+ echo "=========================================================" ; \
+ done
+#.PHONY run_test_suite
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-tap-mocha-reporter.git
More information about the Pkg-javascript-commits
mailing list