summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2018-04-12 22:55:51 -0500
committerEric Bavier <bavier@member.fsf.org>2018-04-12 22:55:51 -0500
commitde7f234a3a3e583e7af832e956b44455c71dc5cb (patch)
tree62f73967333f4020fedf47b324292422ac772b36
parent1ca0ac1e8080457cea374025a3ab07e477d41dc2 (diff)
downloadpatches-de7f234a3a3e583e7af832e956b44455c71dc5cb.tar
patches-de7f234a3a3e583e7af832e956b44455c71dc5cb.tar.gz
gnu: datamash: Fix tests on ARM systems.
* gnu/packages/patches/datamash-arm-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/datamash.scm (datamash)[source]: Use it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/datamash.scm6
-rw-r--r--gnu/packages/patches/datamash-arm-tests.patch71
3 files changed, 76 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 9da2d01cd0..8473ef91f4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -620,6 +620,7 @@ dist_patch_DATA = \
%D%/packages/patches/cursynth-wave-rand.patch \
%D%/packages/patches/cvs-2017-12836.patch \
%D%/packages/patches/cyrus-sasl-CVE-2013-4122.patch \
+ %D%/packages/patches/datamash-arm-tests.patch \
%D%/packages/patches/dbus-helper-search-path.patch \
%D%/packages/patches/deja-dup-use-ref-keyword-for-iter.patch \
%D%/packages/patches/delly-use-system-libraries.patch \
diff --git a/gnu/packages/datamash.scm b/gnu/packages/datamash.scm
index e839a1d985..182d281a5d 100644
--- a/gnu/packages/datamash.scm
+++ b/gnu/packages/datamash.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2018 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
@@ -22,6 +22,7 @@
#:use-module (guix licenses)
#:use-module (guix download)
#:use-module (guix build-system gnu)
+ #:use-module (gnu packages)
#:use-module (gnu packages perl)
#:use-module (gnu packages base))
@@ -36,7 +37,8 @@
version ".tar.gz"))
(sha256
(base32
- "19jpcv4ryvbz0476d6dgpxpbjkpmih4q84wj06nslls338bm5fzf"))))
+ "19jpcv4ryvbz0476d6dgpxpbjkpmih4q84wj06nslls338bm5fzf"))
+ (patches (search-patches "datamash-arm-tests.patch"))))
(native-inputs
`(("which" ,which) ;for tests
("perl" ,perl))) ;for help2man
diff --git a/gnu/packages/patches/datamash-arm-tests.patch b/gnu/packages/patches/datamash-arm-tests.patch
new file mode 100644
index 0000000000..a24c5320ad
--- /dev/null
+++ b/gnu/packages/patches/datamash-arm-tests.patch
@@ -0,0 +1,71 @@
+See https://lists.gnu.org/archive/html/bug-datamash/2018-03/msg00003.html and
+https://lists.gnu.org/archive/html/bug-datamash/2018-03/txt4DmvR7p6J9.txt
+
+From d446dba317aa067440d6312d955d523129949327 Mon Sep 17 00:00:00 2001
+From: Assaf Gordon <address@hidden>
+Date: Thu, 22 Mar 2018 11:00:34 -0600
+Subject: [PATCH 1/2] tests: fix --format='%4000f' expected output
+
+Can be 1.000009... or 1.000008999, depending on representation.
+
+* tests/datamash-output-format.pl: Check only the first 5 digits.
+---
+ tests/datamash-output-format.pl | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/tests/datamash-output-format.pl b/tests/datamash-output-format.pl
+index 52c68a2..ca99bb0 100755
+--- a/tests/datamash-output-format.pl
++++ b/tests/datamash-output-format.pl
+@@ -98,12 +98,13 @@ my @Tests =
+ {OUT => "0" x 3999 . "1\n"}],
+
+ # due to binary floating representation, some decimal point digits won't be
+- # zero (e.g. 1.0000090000000000000000000000000523453254320000000...).
+- # The OUT_SUBST replaces exactly 3994 digits (as expected from the format)
++ # zero (e.g. 1.0000090000000000000000000000000523453254320000000... or
++ # 1.000008999999...).
++ # The OUT_SUBST replaces exactly 3995 digits (as expected from the format)
+ # with an "X".
+ ['m2', '--format "%.4000f" sum 1', {IN_PIPE=>$in1},
+- {OUT => "1.000009X\n"},
+- {OUT_SUBST => 's/^(1\.000009)([0-9]{3994})$/\1X/'}],
++ {OUT => "1.00000X\n"},
++ {OUT_SUBST => 's/^(1\.00000)([0-9]{3995})$/\1X/'}],
+
+ );
+
+--
+2.7.4
+
+
+From f4871963974a96d6e69cb80b9c2fac7ff0c1d472 Mon Sep 17 00:00:00 2001
+From: Assaf Gordon <address@hidden>
+Date: Thu, 22 Mar 2018 11:18:13 -0600
+Subject: [PATCH 2/2] tests: disable --format="%a" test
+
+Valid output can differ (e.g. 0x8.000p-3 vs 0x1.000p+0).
+
+* tests/datamash-output-format.pl: Disable 'a1' test.
+---
+ tests/datamash-output-format.pl | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/datamash-output-format.pl b/tests/datamash-output-format.pl
+index ca99bb0..5e90ae0 100755
+--- a/tests/datamash-output-format.pl
++++ b/tests/datamash-output-format.pl
+@@ -90,7 +90,9 @@ my @Tests =
+ ['e2', '--format "%.3e" sum 1', {IN_PIPE=>$in1}, {OUT=>"1.000e+00\n"}],
+
+ # Test Custom formats: %a
+- ['a1', '--format "%0.3a" sum 1', {IN_PIPE=>$in1}, {OUT=>"0x8.000p-3\n"}],
++ # Disable the test for now. Valid output can differ (e.g. 0x8.000p-3 and
++ # 0x1.000p0 ).
++ # ['a1', '--format "%0.3a" sum 1', {IN_PIPE=>$in1}, {OUT=>"0x8.000p-3\n"}],
+
+
+ # Custom formats can use lots of memory
+--
+2.7.4
+