[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: gnu: plotutils: Fix tests on i686.
From: |
guix-commits |
Subject: |
01/02: gnu: plotutils: Fix tests on i686. |
Date: |
Wed, 24 Nov 2021 12:52:43 -0500 (EST) |
civodul pushed a commit to branch core-updates-frozen
in repository guix.
commit dda78c1de7bd4cf035b51b892fd85f4daf484712
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Nov 24 17:05:05 2021 +0100
gnu: plotutils: Fix tests on i686.
* gnu/packages/plotutils.scm (plotutils)[arguments]: On 32-bit x86, pass
CFLAGS and add 'skip-sloppy-test' phase.
---
gnu/packages/plotutils.scm | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/plotutils.scm b/gnu/packages/plotutils.scm
index fb4bd2f..ed01430 100644
--- a/gnu/packages/plotutils.scm
+++ b/gnu/packages/plotutils.scm
@@ -22,6 +22,8 @@
(define-module (gnu packages plotutils)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix gexp)
+ #:use-module ((guix utils) #:select (target-x86-32?))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -83,7 +85,27 @@
(search-patches "plotutils-spline-test.patch"))))
(build-system gnu-build-system)
(arguments
- `(#:configure-flags (list "--enable-libplotter")))
+ (list #:configure-flags
+ #~(list "--enable-libplotter"
+
+ ;; On i686 some tests fail due to excess floating point
+ ;; precision; work around it. However, libplotter is C++
+ ;; and thus unaffected by CFLAGS, but '-fexcess-precision'
+ ;; is not implemented for C++ as of GCC 10.
+ #$@(if (target-x86-32?)
+ #~("CFLAGS=-g -O2 -fexcess-precision=standard")
+ #~()))
+
+ #:phases
+ (if (target-x86-32?)
+ #~(modify-phases %standard-phases
+ (add-before 'check 'skip-sloppy-test
+ (lambda _
+ ;; This test reveals a slight difference in the SVG
+ ;; output due to floating point inequalities. Skip it.
+ (substitute* "test/plot2svg.test"
+ (("^exit .*") "exit 77")))))
+ #~%standard-phases)))
(inputs `(("libpng" ,libpng)
("libx11" ,libx11)
("libxt" ,libxt)