[Pkg-javascript-commits] [d3-format] 05/05: Use node-tap to run tests, instead of node-tape.

Ximin Luo infinity0 at debian.org
Mon Nov 21 01:22:42 UTC 2016


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

infinity0 pushed a commit to branch master
in repository d3-format.

commit d9765bb206e9eaa3c5ffcd44beb30da582cda35d
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Nov 21 02:20:56 2016 +0100

    Use node-tap to run tests, instead of node-tape.
---
 debian/changelog                             |   1 +
 debian/control                               |   4 +-
 debian/main.mk                               |   5 +-
 debian/patches/series                        |   1 +
 debian/patches/use-tap-instead-of-tape.patch | 217 +++++++++++++++++++++++++++
 debian/rules                                 |   3 +
 6 files changed, 229 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3b6580d..7f4b1e8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ d3-format (1.0.2-2) UNRELEASED; urgency=medium
 
   * Use debhelper compat level 10.
   * Correct binary packages from arch:any to arch:all.
+  * Use node-tap to run tests, instead of node-tape.
 
  -- Ximin Luo <infinity0 at debian.org>  Sun, 20 Nov 2016 01:41:22 +0100
 
diff --git a/debian/control b/debian/control
index fd3aca5..7c118f5 100644
--- a/debian/control
+++ b/debian/control
@@ -5,9 +5,11 @@ Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.deb
 Uploaders: Ximin Luo <infinity0 at debian.org>
 Build-Depends:
  debhelper (>= 10),
+ dpkg-dev (>= 1.17.14),
  nodejs (>= 4.0),
  node-uglify,
- python
+ python,
+ node-tap <!nocheck>
 Standards-Version: 3.9.8
 Homepage: https://github.com/d3/d3-format
 Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/d3-format.git
diff --git a/debian/main.mk b/debian/main.mk
index 12e50f7..10eb182 100755
--- a/debian/main.mk
+++ b/debian/main.mk
@@ -52,7 +52,10 @@ build/%.js: debian/rules debian/%.js.header debian/%.js.footer
 build/%.min.js: build/%.js
 	uglifyjs --preamble "$$($(HEADER))" "$<" -c -m -o "$@"
 
+check:
+	tap test/*.js
+
 clean:
 	rm -rf $(ALL)
 
-.PHONY: all clean
+.PHONY: all check clean
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8ee8b13
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+use-tap-instead-of-tape.patch
diff --git a/debian/patches/use-tap-instead-of-tape.patch b/debian/patches/use-tap-instead-of-tape.patch
new file mode 100644
index 0000000..0ae24a6
--- /dev/null
+++ b/debian/patches/use-tap-instead-of-tape.patch
@@ -0,0 +1,217 @@
+Description: Use tap instead of tape
+ Because node-tap is in Debian and tape is not.
+ .
+ We also disable the 1 test that depends on d3-queue, plus some other junk code
+ that does nothing and is referenced by nothing else.
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/test/defaultLocale-test.js
++++ b/test/defaultLocale-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     d3 = require("../");
+ 
+ var enUs = {
+--- a/test/format-test.js
++++ b/test/format-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(specifier)(number) returns a string", function(test) {
+--- a/test/format-type-%-test.js
++++ b/test/format-type-%-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"%\") can output a whole percentage", function(test) {
+--- a/test/format-type-b-test.js
++++ b/test/format-type-b-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"b\") binary", function(test) {
+--- a/test/format-type-c-test.js
++++ b/test/format-type-c-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"c\") unicode character", function(test) {
+--- a/test/format-type-d-test.js
++++ b/test/format-type-d-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"d\") can zero fill", function(test) {
+--- a/test/format-type-e-test.js
++++ b/test/format-type-e-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"e\") can output exponent notation", function(test) {
+--- a/test/format-type-f-test.js
++++ b/test/format-type-f-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"f\") can output fixed-point notation", function(test) {
+--- a/test/format-type-g-test.js
++++ b/test/format-type-g-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"g\") can output general notation", function(test) {
+--- a/test/format-type-n-test.js
++++ b/test/format-type-n-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"n\") is an alias for \",g\"", function(test) {
+--- a/test/format-type-none-test.js
++++ b/test/format-type-none-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\".[precision]\") uses significant precision and trims insignificant zeros", function(test) {
+--- a/test/format-type-o-test.js
++++ b/test/format-type-o-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"o\") octal", function(test) {
+--- a/test/format-type-p-test.js
++++ b/test/format-type-p-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"p\") can output a percentage", function(test) {
+--- a/test/format-type-r-test.js
++++ b/test/format-type-r-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"r\") can round to significant digits", function(test) {
+--- a/test/format-type-s-test.js
++++ b/test/format-type-s-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"s\") outputs SI-prefix notation with default precision 6", function(test) {
+--- a/test/format-type-x-test.js
++++ b/test/format-type-x-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("format(\"x\") returns the expected hexadecimal (lowercase) string", function(test) {
+--- a/test/formatPrefix-test.js
++++ b/test/formatPrefix-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("formatPrefix(\"s\", value)(number) formats with the SI prefix appropriate to the specified value", function(test) {
+--- a/test/formatSpecifier-test.js
++++ b/test/formatSpecifier-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("formatSpecifier(specifier) throws an error for invalid formats", function(test) {
+--- a/test/inDelta.js
++++ /dev/null
+@@ -1,10 +0,0 @@
+-var tape = require("tape");
+-
+-tape.Test.prototype.inDelta = function(actual, expected) {
+-  this._assert(expected - 1e-6 < actual && actual < expected + 1e-6, {
+-    message: "should be in delta",
+-    operator: "inDelta",
+-    actual: actual,
+-    expected: expected
+-  });
+-};
+--- a/test/locale-test.js
++++ b/test/locale-test.js
+@@ -1,7 +1,7 @@
+ var fs = require("fs"),
+     path = require("path"),
+-    tape = require("tape"),
+-    queue = require("d3-queue"),
++    tape = require("tap").test,
++//    queue = require("d3-queue"),
+     d3 = require("../");
+ 
+ tape("formatLocale({decimal: decimal}) observes the specified decimal point", function(test) {
+@@ -35,7 +35,7 @@
+   test.end();
+ });
+ 
+-tape("locale data is valid", function(test) {
++/*tape("locale data is valid", function(test) {
+   fs.readdir("locale", function(error, locales) {
+     if (error) throw error;
+     var q = queue.queue(1);
+@@ -58,4 +58,4 @@
+       callback(null);
+     });
+   }
+-});
++});*/
+--- a/test/precisionFixed-test.js
++++ b/test/precisionFixed-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("precisionFixed(number) returns the expected value", function(test) {
+--- a/test/precisionPrefix-test.js
++++ b/test/precisionPrefix-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ // A generalization from µ to all prefixes:
+--- a/test/precisionRound-test.js
++++ b/test/precisionRound-test.js
+@@ -1,4 +1,4 @@
+-var tape = require("tape"),
++var tape = require("tap").test,
+     format = require("../");
+ 
+ tape("precisionRound(step, max) returns the expected value", function(test) {
diff --git a/debian/rules b/debian/rules
index f9c85d2..de80ba8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,5 +16,8 @@ compare-upstream:
 override_dh_auto_build:
 	$(MAKE) -f debian/main.mk all
 
+override_dh_auto_test:
+	$(MAKE) -f debian/main.mk check
+
 override_dh_auto_clean:
 	$(MAKE) -f debian/main.mk clean

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



More information about the Pkg-javascript-commits mailing list