[DO-1345] fixed windows packages (!16)
Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/16 Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.team> Co-committed-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.team>
This commit is contained in:
committed by
Aleksandr Vodyanov
parent
3759e1163f
commit
a82e89a1bc
34
recipes/msys2/all/test_package/conanfile.py
Normal file
34
recipes/msys2/all/test_package/conanfile.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.env import Environment
|
||||
from io import StringIO
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "arch"
|
||||
generators = "VirtualBuildEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def build_requirements(self):
|
||||
self.tool_requires(self.tested_reference_str)
|
||||
|
||||
@property
|
||||
def _secret_value(self):
|
||||
return "SECRET_CONAN_PKG_VARIABLE"
|
||||
|
||||
def generate(self):
|
||||
env = Environment()
|
||||
env.define("PKG_CONFIG_PATH", self._secret_value)
|
||||
envvars = env.vars(self)
|
||||
envvars.save_script("conanbuildenv_pkg_config_path")
|
||||
|
||||
def build(self):
|
||||
pass # nothing to do, skip hook warning
|
||||
|
||||
def test(self):
|
||||
self.run('bash.exe -c ^"make --version^"')
|
||||
self.run('bash.exe -c ^"! test -f /bin/link^"')
|
||||
self.run('bash.exe -c ^"! test -f /usr/bin/link^"')
|
||||
|
||||
output = StringIO()
|
||||
self.run('bash.exe -c "echo $PKG_CONFIG_PATH"', output)
|
||||
assert self._secret_value in output.getvalue()
|
||||
Reference in New Issue
Block a user