commit:     812ed593f07a3c6518b7ccaa4e5acc156fc07d5d
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 14 08:13:35 2018 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Apr 14 08:13:58 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=812ed593

dev-libs/check: Fix tests (#648920 by ernsteiswuerfel)

Package-Manager: Portage-2.3.28, Repoman-2.3.9

 dev-libs/check/check-0.12.0.ebuild         | 18 +++++++++++-------
 dev-libs/check/files/check-0.12.0-fp.patch | 22 ++++++++++++++++++++++
 2 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/dev-libs/check/check-0.12.0.ebuild 
b/dev-libs/check/check-0.12.0.ebuild
index acde41e304b..25d0f16bf8a 100644
--- a/dev-libs/check/check-0.12.0.ebuild
+++ b/dev-libs/check/check-0.12.0.ebuild
@@ -15,14 +15,18 @@ KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ~ppc 
~ppc64 ~s390 ~sh spa
 IUSE="static-libs subunit"
 
 RDEPEND="
-       subunit? ( >=dev-python/subunit-0.0.10-r1[${MULTILIB_USEDEP}] )"
-
-DEPEND="
-       ${RDEPEND}
+       subunit? ( >=dev-python/subunit-0.0.10-r1[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}
        sys-apps/texinfo
-       virtual/pkgconfig"
-
-DOCS=( AUTHORS ChangeLog NEWS README.md THANKS TODO )
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       # Fix test failures due to varying floating point behavior across 
platforms
+       # (#648920), patch from Fedora.
+       "${FILESDIR}/${PN}-0.12.0-fp.patch"
+)
 
 pkg_setup() {
        # See multilib_src_test(), disable sleep()-based tests because they

diff --git a/dev-libs/check/files/check-0.12.0-fp.patch 
b/dev-libs/check/files/check-0.12.0-fp.patch
new file mode 100644
index 00000000000..7907df989a1
--- /dev/null
+++ b/dev-libs/check/files/check-0.12.0-fp.patch
@@ -0,0 +1,22 @@
+--- a/tests/check_check_master.c.orig  2018-01-29 20:33:55.033001412 -0700
++++ b/tests/check_check_master.c       2018-01-29 20:34:31.501879454 -0700
+@@ -214,7 +214,7 @@ static master_test_t master_tests[] = {
+   { "Simple Tests", "test_ck_assert_ldouble_ge", CK_FAILURE, CK_MSG_TEXT, 
"Assertion 'x >= y' failed: x == 2.5, y == 3" },
+   { "Simple Tests", "test_ck_assert_ldouble_ge_with_mod", CK_FAILURE, 
CK_MSG_TEXT, "Assertion '2%d >= 3%f' failed: 2%d == 0, 3%f == 1" },
+   { "Simple Tests", "test_ck_assert_ldouble_with_expr", CK_PASS, CK_MSG_TEXT, 
"Passed" },
+-  { "Simple Tests", "test_ck_assert_ldouble_eq_tol", CK_FAILURE, CK_MSG_TEXT, 
"Assertion 'fabsl(y - x) < t' failed: x == 0.001, y == 0.002, t == 0.001" },
++  { "Simple Tests", "test_ck_assert_ldouble_eq_tol", CK_FAILURE, CK_MSG_TEXT, 
"Assertion 'fabsl(y - x) < t' failed: x == 0.001, y == 0.002, t == 0.0009" },
+   { "Simple Tests", "test_ck_assert_ldouble_eq_tol_with_mod", CK_FAILURE, 
CK_MSG_TEXT, "Assertion 'fabsl(2%f - 3%d) < 2%p' failed: 3%d == 1, 2%f == 0, 
2%p == 0" },
+   { "Simple Tests", "test_ck_assert_ldouble_ne_tol", CK_FAILURE, CK_MSG_TEXT, 
"Assertion 'fabsl(y - x) >= t' failed: x == 0.001, y == 0.002, t == 0.01" },
+   { "Simple Tests", "test_ck_assert_ldouble_ne_tol_with_mod", CK_FAILURE, 
CK_MSG_TEXT, "Assertion 'fabsl(3%f - 3%d) >= 3%p' failed: 3%d == 1, 3%f == 1, 
3%p == 1" },
+--- a/tests/check_check_sub.c.orig     2017-10-20 06:44:10.000000000 -0600
++++ b/tests/check_check_sub.c  2018-01-29 20:33:55.034001409 -0700
+@@ -1812,7 +1812,7 @@ START_TEST(test_ck_assert_ldouble_eq_tol
+   y*=10.0l;
+   t*=10.0l;
+   ck_assert_ldouble_eq_tol(x, y, t);
+-  t/=10.0l;
++  t=0.0009l;
+   record_failure_line_num(__LINE__);
+   ck_assert_ldouble_eq_tol(x, y, t);
+ }

Reply via email to