diff options
author | Thomas Bettler <thomas.bettler@gmail.com> | 2022-02-21 19:18:54 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-02-26 02:27:25 +0000 |
commit | f00caec850988c5051a625c7d1466f259aeee50a (patch) | |
tree | 1d4bb17f9b72ac96ad345d87c63f5988ef18cf57 /sci-libs/pdal | |
parent | sys-boot/tboot: Remove old (diff) | |
download | gentoo-f00caec850988c5051a625c7d1466f259aeee50a.tar.gz gentoo-f00caec850988c5051a625c7d1466f259aeee50a.tar.bz2 gentoo-f00caec850988c5051a625c7d1466f259aeee50a.zip |
sci-libs/pdal: fix tests
Closes: https://bugs.gentoo.org/833820
Closes: https://github.com/gentoo/gentoo/pull/24303
Signed-off-by: Thomas Bettler <thomas.bettler@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-libs/pdal')
-rw-r--r-- | sci-libs/pdal/files/pdal-2.3.0-fix_tests_for_proj811.patch | 110 | ||||
-rw-r--r-- | sci-libs/pdal/pdal-2.3.0.ebuild | 14 |
2 files changed, 123 insertions, 1 deletions
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 new file mode 100644 index 000000000000..6a34686330f4 --- /dev/null +++ b/sci-libs/pdal/files/pdal-2.3.0-fix_tests_for_proj811.patch @@ -0,0 +1,110 @@ +From https://github.com/PDAL/PDAL/commit/1a7415f67cfe13f816345ce4b7fc1c68f0a45c83 +Bug https://bugs.gentoo.org/833820 +From: Andrew Bell <andrew.bell.ia@gmail.com> +Date: Thu, 7 Oct 2021 11:15:18 -0400 +Subject: [PATCH] Work around test issues with varying versions of PROJ (#3560) + +* Add range for crop because of varying proj precision. + +* Fix tests for PROJ 8.1.1 + +* More test workaround for proj. +--- + test/unit/filters/CropFilterTest.cpp | 10 +++++++ + test/unit/io/EptReaderTest.cpp | 41 +++++++++++++++++++++++++++- + 2 files changed, 50 insertions(+), 1 deletion(-) + +diff --git a/test/unit/filters/CropFilterTest.cpp b/test/unit/filters/CropFilterTest.cpp +index 23ccb465bc..f4b825c891 100644 +--- a/test/unit/filters/CropFilterTest.cpp ++++ b/test/unit/filters/CropFilterTest.cpp +@@ -250,7 +250,17 @@ TEST(CropFilterTest, test_crop_polygon_reprojection) + PointViewSet viewSet = crop.execute(table); + EXPECT_EQ(viewSet.size(), 1u); + view = *viewSet.begin(); ++//ABELL - I'd like to do the following, but we don't necessarily have proj.h ++/** ++#if defined(PROJ_VERSION_NUMBER) && PROJ_VERSION_NUMBER > 80101 ++ EXPECT_EQ(view->size(), 45u); ++#else + EXPECT_EQ(view->size(), 47u); ++#endif ++**/ ++// So instead... ++ EXPECT_GE(view->size(), 45u); ++ EXPECT_LE(view->size(), 47u); + + FileUtils::closeFile(wkt_stream); + } +diff --git a/test/unit/io/EptReaderTest.cpp b/test/unit/io/EptReaderTest.cpp +index ab5cfdee4a..0d274d4c08 100644 +--- a/test/unit/io/EptReaderTest.cpp ++++ b/test/unit/io/EptReaderTest.cpp +@@ -625,8 +625,21 @@ TEST(EptReaderTest, boundedCrop) + } + + EXPECT_EQ(eptNp, sourceNp); ++ ++//ABELL - A change in proj changed the numbers, but we don't necessarily have proj.h ++/** ++#if defined(PROJ_VERSION_NUMBER) && PROJ_VERSION_NUMBER > 80101 ++ EXPECT_EQ(eptNp, 45u); ++ EXPECT_EQ(sourceNp, 45u); ++#else + EXPECT_EQ(eptNp, 47u); + EXPECT_EQ(sourceNp, 47u); ++#endif ++**/ ++ EXPECT_GE(eptNp, 45u); ++ EXPECT_GE(sourceNp, 45u); ++ EXPECT_LE(eptNp, 47u); ++ EXPECT_LE(sourceNp, 47u); + } + + TEST(EptReaderTest, polygonAndBoundsCrop) +@@ -769,8 +782,20 @@ TEST(EptReaderTest, boundedCropReprojection) + sourceNp += view->size(); + + EXPECT_EQ(eptNp, sourceNp); ++//ABELL - We don't necessarily have proj.h, so we can't do this: ++/** ++#if defined(PROJ_VERSION_NUMBER) && PROJ_VERSION_NUMBER > 80101 ++ EXPECT_EQ(eptNp, 45u); ++ EXPECT_EQ(sourceNp, 45u); ++#else + EXPECT_EQ(eptNp, 47u); + EXPECT_EQ(sourceNp, 47u); ++#endif ++**/ ++ EXPECT_GE(eptNp, 45u); ++ EXPECT_GE(sourceNp, 45u); ++ EXPECT_LE(eptNp, 47u); ++ EXPECT_LE(sourceNp, 47u); + } + + +@@ -811,9 +836,23 @@ TEST(EptReaderTest, ogrCrop) + for (const PointViewPtr& view : source.execute(sourceTable)) + sourceNp += view->size(); + +- EXPECT_EQ(eptNp, sourceNp); ++//ABELL - PROJ changed to make the number of points that pass the filter different from ++// what's in the file we've got stored. ++// EXPECT_EQ(eptNp, sourceNp); ++//ABELL - We don't necessarily have proj.h, so can't do the following: ++/** ++#if defined(PROJ_VERSION_NUMBER) && PROJ_VERSION_NUMBER > 80101 ++ EXPECT_EQ(eptNp, 89u); ++ EXPECT_EQ(sourceNp, 89u); ++#else + EXPECT_EQ(eptNp, 86u); + EXPECT_EQ(sourceNp, 86u); ++#endif ++**/ ++ EXPECT_LE(eptNp, 89u); ++ EXPECT_LE(sourceNp, 89u); ++ EXPECT_GE(eptNp, 86u); ++ EXPECT_GE(sourceNp, 86u); + } + + } // namespace pdal diff --git a/sci-libs/pdal/pdal-2.3.0.ebuild b/sci-libs/pdal/pdal-2.3.0.ebuild index f85812782818..949b5ab43e8b 100644 --- a/sci-libs/pdal/pdal-2.3.0.ebuild +++ b/sci-libs/pdal/pdal-2.3.0.ebuild @@ -12,7 +12,8 @@ SRC_URI="https://github.com/PDAL/PDAL/releases/download/${PV}/PDAL-${PV}-src.tar LICENSE="BSD" SLOT="0/13" KEYWORDS="~amd64 ~x86" -IUSE="postgres" +IUSE="postgres test" +RESTRICT="!test? ( test )" BDEPEND=" virtual/pkgconfig @@ -26,12 +27,14 @@ DEPEND=" sys-libs/libunwind sys-libs/zlib postgres? ( dev-db/postgresql:*[xml] ) + test? ( sci-libs/gdal[geos,jpeg,png] ) " RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}"/${P}-fix_cmake_install_location.patch "${FILESDIR}"/${P}-upgrade_cmake_min.patch + "${FILESDIR}"/${P}-fix_tests_for_proj811.patch ) S="${WORKDIR}/PDAL-${PV}-src" @@ -46,3 +49,12 @@ src_configure() { cmake_src_configure } + +src_test() { + local myctestargs=( + --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)' + --output-on-failure + ) + + cmake_src_test +} |