diff options
| author | Eric Bavier <bavier@member.fsf.org> | 2018-04-12 22:55:51 -0500 |
|---|---|---|
| committer | Eric Bavier <bavier@member.fsf.org> | 2018-04-12 22:55:51 -0500 |
| commit | de7f234a3a3e583e7af832e956b44455c71dc5cb (patch) | |
| tree | 62f73967333f4020fedf47b324292422ac772b36 /gnu/packages | |
| parent | 1ca0ac1e8080457cea374025a3ab07e477d41dc2 (diff) | |
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.
Diffstat (limited to 'gnu/packages')
| -rw-r--r-- | gnu/packages/datamash.scm | 6 | ||||
| -rw-r--r-- | gnu/packages/patches/datamash-arm-tests.patch | 71 |
2 files changed, 75 insertions, 2 deletions
diff --git a/gnu/packages/datamash.scm b/gnu/packages/datamash.scm index e839a1d985b..182d281a5d1 100644 --- a/gnu/packages/datamash.scm +++ b/gnu/packages/datamash.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> | 2 | ;;; Copyright © 2014, 2018 Eric Bavier <bavier@member.fsf.org> |
| 3 | ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il> | 3 | ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -22,6 +22,7 @@ | |||
| 22 | #:use-module (guix licenses) | 22 | #:use-module (guix licenses) |
| 23 | #:use-module (guix download) | 23 | #:use-module (guix download) |
| 24 | #:use-module (guix build-system gnu) | 24 | #:use-module (guix build-system gnu) |
| 25 | #:use-module (gnu packages) | ||
| 25 | #:use-module (gnu packages perl) | 26 | #:use-module (gnu packages perl) |
| 26 | #:use-module (gnu packages base)) | 27 | #:use-module (gnu packages base)) |
| 27 | 28 | ||
| @@ -36,7 +37,8 @@ | |||
| 36 | version ".tar.gz")) | 37 | version ".tar.gz")) |
| 37 | (sha256 | 38 | (sha256 |
| 38 | (base32 | 39 | (base32 |
| 39 | "19jpcv4ryvbz0476d6dgpxpbjkpmih4q84wj06nslls338bm5fzf")))) | 40 | "19jpcv4ryvbz0476d6dgpxpbjkpmih4q84wj06nslls338bm5fzf")) |
| 41 | (patches (search-patches "datamash-arm-tests.patch")))) | ||
| 40 | (native-inputs | 42 | (native-inputs |
| 41 | `(("which" ,which) ;for tests | 43 | `(("which" ,which) ;for tests |
| 42 | ("perl" ,perl))) ;for help2man | 44 | ("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 00000000000..a24c5320ade --- /dev/null +++ b/gnu/packages/patches/datamash-arm-tests.patch | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | See https://lists.gnu.org/archive/html/bug-datamash/2018-03/msg00003.html and | ||
| 2 | https://lists.gnu.org/archive/html/bug-datamash/2018-03/txt4DmvR7p6J9.txt | ||
| 3 | |||
| 4 | From d446dba317aa067440d6312d955d523129949327 Mon Sep 17 00:00:00 2001 | ||
| 5 | From: Assaf Gordon <address@hidden> | ||
| 6 | Date: Thu, 22 Mar 2018 11:00:34 -0600 | ||
| 7 | Subject: [PATCH 1/2] tests: fix --format='%4000f' expected output | ||
| 8 | |||
| 9 | Can be 1.000009... or 1.000008999, depending on representation. | ||
| 10 | |||
| 11 | * tests/datamash-output-format.pl: Check only the first 5 digits. | ||
| 12 | --- | ||
| 13 | tests/datamash-output-format.pl | 9 +++++---- | ||
| 14 | 1 file changed, 5 insertions(+), 4 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/tests/datamash-output-format.pl b/tests/datamash-output-format.pl | ||
| 17 | index 52c68a2..ca99bb0 100755 | ||
| 18 | --- a/tests/datamash-output-format.pl | ||
| 19 | +++ b/tests/datamash-output-format.pl | ||
| 20 | @@ -98,12 +98,13 @@ my @Tests = | ||
| 21 | {OUT => "0" x 3999 . "1\n"}], | ||
| 22 | |||
| 23 | # due to binary floating representation, some decimal point digits won't be | ||
| 24 | - # zero (e.g. 1.0000090000000000000000000000000523453254320000000...). | ||
| 25 | - # The OUT_SUBST replaces exactly 3994 digits (as expected from the format) | ||
| 26 | + # zero (e.g. 1.0000090000000000000000000000000523453254320000000... or | ||
| 27 | + # 1.000008999999...). | ||
| 28 | + # The OUT_SUBST replaces exactly 3995 digits (as expected from the format) | ||
| 29 | # with an "X". | ||
| 30 | ['m2', '--format "%.4000f" sum 1', {IN_PIPE=>$in1}, | ||
| 31 | - {OUT => "1.000009X\n"}, | ||
| 32 | - {OUT_SUBST => 's/^(1\.000009)([0-9]{3994})$/\1X/'}], | ||
| 33 | + {OUT => "1.00000X\n"}, | ||
| 34 | + {OUT_SUBST => 's/^(1\.00000)([0-9]{3995})$/\1X/'}], | ||
| 35 | |||
| 36 | ); | ||
| 37 | |||
| 38 | -- | ||
| 39 | 2.7.4 | ||
| 40 | |||
| 41 | |||
| 42 | From f4871963974a96d6e69cb80b9c2fac7ff0c1d472 Mon Sep 17 00:00:00 2001 | ||
| 43 | From: Assaf Gordon <address@hidden> | ||
| 44 | Date: Thu, 22 Mar 2018 11:18:13 -0600 | ||
| 45 | Subject: [PATCH 2/2] tests: disable --format="%a" test | ||
| 46 | |||
| 47 | Valid output can differ (e.g. 0x8.000p-3 vs 0x1.000p+0). | ||
| 48 | |||
| 49 | * tests/datamash-output-format.pl: Disable 'a1' test. | ||
| 50 | --- | ||
| 51 | tests/datamash-output-format.pl | 4 +++- | ||
| 52 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 53 | |||
| 54 | diff --git a/tests/datamash-output-format.pl b/tests/datamash-output-format.pl | ||
| 55 | index ca99bb0..5e90ae0 100755 | ||
| 56 | --- a/tests/datamash-output-format.pl | ||
| 57 | +++ b/tests/datamash-output-format.pl | ||
| 58 | @@ -90,7 +90,9 @@ my @Tests = | ||
| 59 | ['e2', '--format "%.3e" sum 1', {IN_PIPE=>$in1}, {OUT=>"1.000e+00\n"}], | ||
| 60 | |||
| 61 | # Test Custom formats: %a | ||
| 62 | - ['a1', '--format "%0.3a" sum 1', {IN_PIPE=>$in1}, {OUT=>"0x8.000p-3\n"}], | ||
| 63 | + # Disable the test for now. Valid output can differ (e.g. 0x8.000p-3 and | ||
| 64 | + # 0x1.000p0 ). | ||
| 65 | + # ['a1', '--format "%0.3a" sum 1', {IN_PIPE=>$in1}, {OUT=>"0x8.000p-3\n"}], | ||
| 66 | |||
| 67 | |||
| 68 | # Custom formats can use lots of memory | ||
| 69 | -- | ||
| 70 | 2.7.4 | ||
| 71 | |||
