Skip to content

Commit

Permalink
p7zip: fix test package (#26156)
Browse files Browse the repository at this point in the history
* Ensure p7zip test_package works successfuly in all cases

* test executable, remove redundant properties in test_package

---------

Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com>
  • Loading branch information
AbrilRBS and jcar87 authored Dec 11, 2024
1 parent 9bc7be5 commit ecd6604
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions recipes/p7zip/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class PSevenZipConan(ConanFile):
homepage = "https://sourceforge.net/projects/p7zip/"
topics = ("7zip", "zip", "compression", "decompression")
settings = "os", "arch", "compiler", "build_type"
package_type = "application"

def export_sources(self):
export_conandata_patches(self)
Expand Down
9 changes: 5 additions & 4 deletions recipes/p7zip/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import os.path

from conan import ConanFile
from conan.tools.build import can_run


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "VirtualRunEnv"
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):
assert os.path.exists(os.path.join(self.dependencies[self.tested_reference_str].cpp_info.bindir, "7za"))
if can_run(self):
self.run("7za", env="conanrun")

0 comments on commit ecd6604

Please sign in to comment.