From 7b6f6f689ba8df69c902bd3f99877291535396fb Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Sat, 3 Aug 2024 01:31:34 +0300 Subject: [PATCH] Fix poppler-data settings clearance. Add test to check if data is actually there --- recipes/poppler-data/all/conanfile.py | 6 ++---- recipes/poppler-data/all/test_package/conanfile.py | 13 +++++++++---- recipes/poppler-data/config.yml | 1 - 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/recipes/poppler-data/all/conanfile.py b/recipes/poppler-data/all/conanfile.py index 6c88591..f2be9c4 100644 --- a/recipes/poppler-data/all/conanfile.py +++ b/recipes/poppler-data/all/conanfile.py @@ -21,23 +21,21 @@ def export_sources(self): def package_id(self): self.info.settings.clear() + self.info.clear() def layout(self): cmake_layout(self) - def package_id(self): - self.info.clear() - def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/poppler-data/all/test_package/conanfile.py b/recipes/poppler-data/all/test_package/conanfile.py index 103ab85..af49f68 100644 --- a/recipes/poppler-data/all/test_package/conanfile.py +++ b/recipes/poppler-data/all/test_package/conanfile.py @@ -1,3 +1,5 @@ +import os.path + from conan import ConanFile @@ -5,9 +7,12 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" test_type = "explicit" - def build_requirements(self): - self.tool_requires(self.tested_reference_str) + def requirements(self): + self.requires(self.tested_reference_str) def test(self): - # @TODO: actually test - yield + resdir = self.dependencies['poppler-data'].cpp_info.resdirs[0] + for i in ["cMap", "cidToUnicode", "nameToUnicode", "unicodeMap"]: + d = os.path.join(resdir, i) + assert os.path.exists(d) + assert len(os.listdir(d)) != 0 diff --git a/recipes/poppler-data/config.yml b/recipes/poppler-data/config.yml index 699598b..2eddfff 100644 --- a/recipes/poppler-data/config.yml +++ b/recipes/poppler-data/config.yml @@ -1,4 +1,3 @@ versions: "0.4.12-odr": folder: all -