[Pkg-javascript-commits] [node-dargs] 54/54: Finalize package

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:41:06 UTC 2017


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

rouca pushed a commit to branch master
in repository node-dargs.

commit 6e3aaf52eb0a45203afa8d3748b098981c69e0d4
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Mon Aug 21 22:20:45 2017 +0200

    Finalize package
---
 debian/clean                   |  1 +
 debian/copyright               |  1 +
 debian/examples                |  1 +
 debian/examples.d/smoketest.js | 19 +++++++++++++++++++
 debian/rules                   | 14 +++++++++++---
 debian/tests/control           |  3 +++
 debian/tests/runexamples       |  4 ++++
 7 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..9726f48
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1 @@
+smoketest.js
\ No newline at end of file
diff --git a/debian/copyright b/debian/copyright
index b3966eb..f1498f1 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -4,6 +4,7 @@ Upstream-Contact: https://github.com/sindresorhus/dargs/issues
 Source: https://github.com/sindresorhus/dargs#readme
 
 Files: *
+ debian/examples.d/*
 Copyright: 2013-2017 Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)
 License: Expat
 
diff --git a/debian/examples b/debian/examples
new file mode 100644
index 0000000..ce43bba
--- /dev/null
+++ b/debian/examples
@@ -0,0 +1 @@
+debian/examples.d/smoketest.js
\ No newline at end of file
diff --git a/debian/examples.d/smoketest.js b/debian/examples.d/smoketest.js
new file mode 100644
index 0000000..76bd835
--- /dev/null
+++ b/debian/examples.d/smoketest.js
@@ -0,0 +1,19 @@
+// adapted from readme.md
+const dargs = require('dargs')
+
+const input = {
+        _: ['some', 'option'],          // values in '_' will be appended to the end of the generated argument list
+        foo: 'bar',
+        hello: true,                    // results in only the key being used
+        cake: false,                    // prepends `no-` before the key
+        camelCase: 5,                   // camelCase is slugged to `camel-case`
+        multiple: ['value', 'value2'],  // converted to multiple arguments
+        pieKind: 'cherry',
+        sad: ':('
+};
+
+const excludes = ['sad', /.*Kind$/];  // excludes and includes accept regular expressions
+const includes = ['camelCase', 'multiple', 'sad', /^pie.*/];
+const aliases = {file: 'f'};
+
+console.log(dargs(input, {excludes}));
diff --git a/debian/rules b/debian/rules
index 24e3513..d928049 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,9 +7,17 @@
 %:
 	dh $@
 
-#override_dh_auto_build:
-
 override_dh_auto_test:
-
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
+	@echo run smoke test
+	sed "s,require('dargs'),require('./'),g" < debian/examples.d/smoketest.js > smoketest.js
+	node smoketest.js
+	@echo WARNING: could not run full test suite due to lack of ava 1>&2
+	# node test.js
+else
+	@echo '**********************************************************'
+	@echo 'Skip test suite                                           '
+	@echo '**********************************************************'
+endif
 
 
diff --git a/debian/tests/control b/debian/tests/control
index f068c19..71f92cf 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-dargs
+
+Tests: runexamples
+Depends: node-dargs, nodejs (>= 6)
diff --git a/debian/tests/runexamples b/debian/tests/runexamples
new file mode 100755
index 0000000..56092e9
--- /dev/null
+++ b/debian/tests/runexamples
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+find /usr/share/doc/node-dargs/examples -name '*.js' -exec node {} \;
\ No newline at end of file

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



More information about the Pkg-javascript-commits mailing list