1 |
commit: a1e4828e2ba563dbf0aa151d1a1451171e759b38 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 5 16:52:15 2020 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 5 17:55:01 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1e4828e |
7 |
|
8 |
dev-ros/unique_id: fix tests |
9 |
|
10 |
Closes: https://bugs.gentoo.org/734686 |
11 |
Package-Manager: Portage-3.0.1, Repoman-2.3.23 |
12 |
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org> |
13 |
|
14 |
dev-ros/unique_id/files/tests.patch | 17 +++++++++++++++++ |
15 |
dev-ros/unique_id/unique_id-1.0.6.ebuild | 7 +++++++ |
16 |
dev-ros/unique_id/unique_id-9999.ebuild | 7 +++++++ |
17 |
3 files changed, 31 insertions(+) |
18 |
|
19 |
diff --git a/dev-ros/unique_id/files/tests.patch b/dev-ros/unique_id/files/tests.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..b64a1be5e38 |
22 |
--- /dev/null |
23 |
+++ b/dev-ros/unique_id/files/tests.patch |
24 |
@@ -0,0 +1,17 @@ |
25 |
+Index: unique_id/tests/test_unique_id.py |
26 |
+=================================================================== |
27 |
+--- unique_id.orig/tests/test_unique_id.py |
28 |
++++ unique_id/tests/test_unique_id.py |
29 |
+@@ -20,10 +20,10 @@ class TestPythonUUID(unittest.TestCase): |
30 |
+ def test_random_uuids(self): |
31 |
+ N = 1000 |
32 |
+ uu = [] |
33 |
+- for i in xrange(N): |
34 |
++ for i in range(N): |
35 |
+ uu.append(fromRandom()) |
36 |
+ self.assertEqual(type(uu[i]), uuid.UUID) |
37 |
+- for j in xrange(i-1, -1, -1): |
38 |
++ for j in range(i-1, -1, -1): |
39 |
+ self.assertNotEqual(uu[i], uu[j]) |
40 |
+ |
41 |
+ # UUID generation from URL tests |
42 |
|
43 |
diff --git a/dev-ros/unique_id/unique_id-1.0.6.ebuild b/dev-ros/unique_id/unique_id-1.0.6.ebuild |
44 |
index 3614a9ea322..32432dfa563 100644 |
45 |
--- a/dev-ros/unique_id/unique_id-1.0.6.ebuild |
46 |
+++ b/dev-ros/unique_id/unique_id-1.0.6.ebuild |
47 |
@@ -25,3 +25,10 @@ DEPEND="${RDEPEND} |
48 |
dev-cpp/gtest |
49 |
$(python_gen_cond_dep "dev-python/nose[\${PYTHON_USEDEP}]") |
50 |
)" |
51 |
+PATCHES=( "${FILESDIR}/tests.patch" ) |
52 |
+ |
53 |
+src_test() { |
54 |
+ # Those tests fail and are commented as undefined behavior in the code |
55 |
+ export GTEST_FILTER='-BoostUUID.fromUrnString:BoostUUID.fromTooLongString:BoostUUID2.fromUrnString:BoostUUID2.fromTooLongString' |
56 |
+ ros-catkin_src_test |
57 |
+} |
58 |
|
59 |
diff --git a/dev-ros/unique_id/unique_id-9999.ebuild b/dev-ros/unique_id/unique_id-9999.ebuild |
60 |
index 3614a9ea322..32432dfa563 100644 |
61 |
--- a/dev-ros/unique_id/unique_id-9999.ebuild |
62 |
+++ b/dev-ros/unique_id/unique_id-9999.ebuild |
63 |
@@ -25,3 +25,10 @@ DEPEND="${RDEPEND} |
64 |
dev-cpp/gtest |
65 |
$(python_gen_cond_dep "dev-python/nose[\${PYTHON_USEDEP}]") |
66 |
)" |
67 |
+PATCHES=( "${FILESDIR}/tests.patch" ) |
68 |
+ |
69 |
+src_test() { |
70 |
+ # Those tests fail and are commented as undefined behavior in the code |
71 |
+ export GTEST_FILTER='-BoostUUID.fromUrnString:BoostUUID.fromTooLongString:BoostUUID2.fromUrnString:BoostUUID2.fromTooLongString' |
72 |
+ ros-catkin_src_test |
73 |
+} |