commit:     a1e4828e2ba563dbf0aa151d1a1451171e759b38
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 16:52:15 2020 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 17:55:01 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1e4828e

dev-ros/unique_id: fix tests

Closes: https://bugs.gentoo.org/734686
Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-ros/unique_id/files/tests.patch      | 17 +++++++++++++++++
 dev-ros/unique_id/unique_id-1.0.6.ebuild |  7 +++++++
 dev-ros/unique_id/unique_id-9999.ebuild  |  7 +++++++
 3 files changed, 31 insertions(+)

diff --git a/dev-ros/unique_id/files/tests.patch 
b/dev-ros/unique_id/files/tests.patch
new file mode 100644
index 00000000000..b64a1be5e38
--- /dev/null
+++ b/dev-ros/unique_id/files/tests.patch
@@ -0,0 +1,17 @@
+Index: unique_id/tests/test_unique_id.py
+===================================================================
+--- unique_id.orig/tests/test_unique_id.py
++++ unique_id/tests/test_unique_id.py
+@@ -20,10 +20,10 @@ class TestPythonUUID(unittest.TestCase):
+     def test_random_uuids(self):
+         N = 1000
+         uu = []
+-        for i in xrange(N):
++        for i in range(N):
+             uu.append(fromRandom())
+             self.assertEqual(type(uu[i]), uuid.UUID)
+-            for j in xrange(i-1, -1, -1):
++            for j in range(i-1, -1, -1):
+                 self.assertNotEqual(uu[i], uu[j])
+ 
+     # UUID generation from URL tests

diff --git a/dev-ros/unique_id/unique_id-1.0.6.ebuild 
b/dev-ros/unique_id/unique_id-1.0.6.ebuild
index 3614a9ea322..32432dfa563 100644
--- a/dev-ros/unique_id/unique_id-1.0.6.ebuild
+++ b/dev-ros/unique_id/unique_id-1.0.6.ebuild
@@ -25,3 +25,10 @@ DEPEND="${RDEPEND}
                dev-cpp/gtest
                $(python_gen_cond_dep "dev-python/nose[\${PYTHON_USEDEP}]")
        )"
+PATCHES=( "${FILESDIR}/tests.patch" )
+
+src_test() {
+       # Those tests fail and are commented as undefined behavior in the code
+       export 
GTEST_FILTER='-BoostUUID.fromUrnString:BoostUUID.fromTooLongString:BoostUUID2.fromUrnString:BoostUUID2.fromTooLongString'
+       ros-catkin_src_test
+}

diff --git a/dev-ros/unique_id/unique_id-9999.ebuild 
b/dev-ros/unique_id/unique_id-9999.ebuild
index 3614a9ea322..32432dfa563 100644
--- a/dev-ros/unique_id/unique_id-9999.ebuild
+++ b/dev-ros/unique_id/unique_id-9999.ebuild
@@ -25,3 +25,10 @@ DEPEND="${RDEPEND}
                dev-cpp/gtest
                $(python_gen_cond_dep "dev-python/nose[\${PYTHON_USEDEP}]")
        )"
+PATCHES=( "${FILESDIR}/tests.patch" )
+
+src_test() {
+       # Those tests fail and are commented as undefined behavior in the code
+       export 
GTEST_FILTER='-BoostUUID.fromUrnString:BoostUUID.fromTooLongString:BoostUUID2.fromUrnString:BoostUUID2.fromTooLongString'
+       ros-catkin_src_test
+}

Reply via email to