Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/pdal/files/, sci-libs/pdal/
Date: Sat, 26 Feb 2022 02:30:04
Message-Id: 1645842445.f00caec850988c5051a625c7d1466f259aeee50a.sam@gentoo
1 commit: f00caec850988c5051a625c7d1466f259aeee50a
2 Author: Thomas Bettler <thomas.bettler <AT> gmail <DOT> com>
3 AuthorDate: Mon Feb 21 18:18:54 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 26 02:27:25 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f00caec8
7
8 sci-libs/pdal: fix tests
9
10 Closes: https://bugs.gentoo.org/833820
11 Closes: https://github.com/gentoo/gentoo/pull/24303
12 Signed-off-by: Thomas Bettler <thomas.bettler <AT> gmail.com>
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 .../files/pdal-2.3.0-fix_tests_for_proj811.patch | 110 +++++++++++++++++++++
16 sci-libs/pdal/pdal-2.3.0.ebuild | 14 ++-
17 2 files changed, 123 insertions(+), 1 deletion(-)
18
19 diff --git a/sci-libs/pdal/files/pdal-2.3.0-fix_tests_for_proj811.patch b/sci-libs/pdal/files/pdal-2.3.0-fix_tests_for_proj811.patch
20 new file mode 100644
21 index 000000000000..6a34686330f4
22 --- /dev/null
23 +++ b/sci-libs/pdal/files/pdal-2.3.0-fix_tests_for_proj811.patch
24 @@ -0,0 +1,110 @@
25 +From https://github.com/PDAL/PDAL/commit/1a7415f67cfe13f816345ce4b7fc1c68f0a45c83
26 +Bug https://bugs.gentoo.org/833820
27 +From: Andrew Bell <andrew.bell.ia@×××××.com>
28 +Date: Thu, 7 Oct 2021 11:15:18 -0400
29 +Subject: [PATCH] Work around test issues with varying versions of PROJ (#3560)
30 +
31 +* Add range for crop because of varying proj precision.
32 +
33 +* Fix tests for PROJ 8.1.1
34 +
35 +* More test workaround for proj.
36 +---
37 + test/unit/filters/CropFilterTest.cpp | 10 +++++++
38 + test/unit/io/EptReaderTest.cpp | 41 +++++++++++++++++++++++++++-
39 + 2 files changed, 50 insertions(+), 1 deletion(-)
40 +
41 +diff --git a/test/unit/filters/CropFilterTest.cpp b/test/unit/filters/CropFilterTest.cpp
42 +index 23ccb465bc..f4b825c891 100644
43 +--- a/test/unit/filters/CropFilterTest.cpp
44 ++++ b/test/unit/filters/CropFilterTest.cpp
45 +@@ -250,7 +250,17 @@ TEST(CropFilterTest, test_crop_polygon_reprojection)
46 + PointViewSet viewSet = crop.execute(table);
47 + EXPECT_EQ(viewSet.size(), 1u);
48 + view = *viewSet.begin();
49 ++//ABELL - I'd like to do the following, but we don't necessarily have proj.h
50 ++/**
51 ++#if defined(PROJ_VERSION_NUMBER) && PROJ_VERSION_NUMBER > 80101
52 ++ EXPECT_EQ(view->size(), 45u);
53 ++#else
54 + EXPECT_EQ(view->size(), 47u);
55 ++#endif
56 ++**/
57 ++// So instead...
58 ++ EXPECT_GE(view->size(), 45u);
59 ++ EXPECT_LE(view->size(), 47u);
60 +
61 + FileUtils::closeFile(wkt_stream);
62 + }
63 +diff --git a/test/unit/io/EptReaderTest.cpp b/test/unit/io/EptReaderTest.cpp
64 +index ab5cfdee4a..0d274d4c08 100644
65 +--- a/test/unit/io/EptReaderTest.cpp
66 ++++ b/test/unit/io/EptReaderTest.cpp
67 +@@ -625,8 +625,21 @@ TEST(EptReaderTest, boundedCrop)
68 + }
69 +
70 + EXPECT_EQ(eptNp, sourceNp);
71 ++
72 ++//ABELL - A change in proj changed the numbers, but we don't necessarily have proj.h
73 ++/**
74 ++#if defined(PROJ_VERSION_NUMBER) && PROJ_VERSION_NUMBER > 80101
75 ++ EXPECT_EQ(eptNp, 45u);
76 ++ EXPECT_EQ(sourceNp, 45u);
77 ++#else
78 + EXPECT_EQ(eptNp, 47u);
79 + EXPECT_EQ(sourceNp, 47u);
80 ++#endif
81 ++**/
82 ++ EXPECT_GE(eptNp, 45u);
83 ++ EXPECT_GE(sourceNp, 45u);
84 ++ EXPECT_LE(eptNp, 47u);
85 ++ EXPECT_LE(sourceNp, 47u);
86 + }
87 +
88 + TEST(EptReaderTest, polygonAndBoundsCrop)
89 +@@ -769,8 +782,20 @@ TEST(EptReaderTest, boundedCropReprojection)
90 + sourceNp += view->size();
91 +
92 + EXPECT_EQ(eptNp, sourceNp);
93 ++//ABELL - We don't necessarily have proj.h, so we can't do this:
94 ++/**
95 ++#if defined(PROJ_VERSION_NUMBER) && PROJ_VERSION_NUMBER > 80101
96 ++ EXPECT_EQ(eptNp, 45u);
97 ++ EXPECT_EQ(sourceNp, 45u);
98 ++#else
99 + EXPECT_EQ(eptNp, 47u);
100 + EXPECT_EQ(sourceNp, 47u);
101 ++#endif
102 ++**/
103 ++ EXPECT_GE(eptNp, 45u);
104 ++ EXPECT_GE(sourceNp, 45u);
105 ++ EXPECT_LE(eptNp, 47u);
106 ++ EXPECT_LE(sourceNp, 47u);
107 + }
108 +
109 +
110 +@@ -811,9 +836,23 @@ TEST(EptReaderTest, ogrCrop)
111 + for (const PointViewPtr& view : source.execute(sourceTable))
112 + sourceNp += view->size();
113 +
114 +- EXPECT_EQ(eptNp, sourceNp);
115 ++//ABELL - PROJ changed to make the number of points that pass the filter different from
116 ++// what's in the file we've got stored.
117 ++// EXPECT_EQ(eptNp, sourceNp);
118 ++//ABELL - We don't necessarily have proj.h, so can't do the following:
119 ++/**
120 ++#if defined(PROJ_VERSION_NUMBER) && PROJ_VERSION_NUMBER > 80101
121 ++ EXPECT_EQ(eptNp, 89u);
122 ++ EXPECT_EQ(sourceNp, 89u);
123 ++#else
124 + EXPECT_EQ(eptNp, 86u);
125 + EXPECT_EQ(sourceNp, 86u);
126 ++#endif
127 ++**/
128 ++ EXPECT_LE(eptNp, 89u);
129 ++ EXPECT_LE(sourceNp, 89u);
130 ++ EXPECT_GE(eptNp, 86u);
131 ++ EXPECT_GE(sourceNp, 86u);
132 + }
133 +
134 + } // namespace pdal
135
136 diff --git a/sci-libs/pdal/pdal-2.3.0.ebuild b/sci-libs/pdal/pdal-2.3.0.ebuild
137 index f85812782818..949b5ab43e8b 100644
138 --- a/sci-libs/pdal/pdal-2.3.0.ebuild
139 +++ b/sci-libs/pdal/pdal-2.3.0.ebuild
140 @@ -12,7 +12,8 @@ SRC_URI="https://github.com/PDAL/PDAL/releases/download/${PV}/PDAL-${PV}-src.tar
141 LICENSE="BSD"
142 SLOT="0/13"
143 KEYWORDS="~amd64 ~x86"
144 -IUSE="postgres"
145 +IUSE="postgres test"
146 +RESTRICT="!test? ( test )"
147
148 BDEPEND="
149 virtual/pkgconfig
150 @@ -26,12 +27,14 @@ DEPEND="
151 sys-libs/libunwind
152 sys-libs/zlib
153 postgres? ( dev-db/postgresql:*[xml] )
154 + test? ( sci-libs/gdal[geos,jpeg,png] )
155 "
156 RDEPEND="${DEPEND}"
157
158 PATCHES=(
159 "${FILESDIR}"/${P}-fix_cmake_install_location.patch
160 "${FILESDIR}"/${P}-upgrade_cmake_min.patch
161 + "${FILESDIR}"/${P}-fix_tests_for_proj811.patch
162 )
163
164 S="${WORKDIR}/PDAL-${PV}-src"
165 @@ -46,3 +49,12 @@ src_configure() {
166
167 cmake_src_configure
168 }
169 +
170 +src_test() {
171 + local myctestargs=(
172 + --exclude-regex '(pgpointcloudtest|pdal_io_bpf_base_test|pdal_io_bpf_zlib_test|pdal_filters_overlay_test|pdal_filters_stats_test|pdal_app_plugin_test|pdal_merge_test)'
173 + --output-on-failure
174 + )
175 +
176 + cmake_src_test
177 +}