pkgconfig module: Fix regression that Requires.private is generated as 'Q, t, 5, C, o, r, e' instead of Qt5Core. (#3406)

pull/3410/merge
textshell 7 years ago committed by Jussi Pakkanen
parent c2f062a02e
commit 0535f38af9
  1. 2
      mesonbuild/modules/pkgconfig.py
  2. 14
      run_unittests.py

@ -91,7 +91,7 @@ class DependenciesHelper:
if hasattr(obj, 'pcdep'):
pcdeps = mesonlib.listify(obj.pcdep)
for d in pcdeps:
processed_reqs += d.name
processed_reqs.append(d.name)
self.add_version_reqs(d.name, obj.version_reqs)
elif hasattr(obj, 'generated_pc'):
processed_reqs.append(obj.generated_pc)

@ -42,6 +42,7 @@ from mesonbuild.mesonlib import (
from mesonbuild.environment import Environment, detect_ninja
from mesonbuild.mesonlib import MesonException, EnvironmentException
from mesonbuild.dependencies import PkgConfigDependency, ExternalProgram
import mesonbuild.modules.pkgconfig
from run_tests import exe_suffix, get_fake_options
from run_tests import get_builddir_target_args, get_backend_commands, Backend
@ -454,6 +455,19 @@ class InternalTests(unittest.TestCase):
if f.name != 'add_release_note_snippets_here':
self.assertTrue(False, 'A file without .md suffix in snippets dir: ' + f.name)
def test_pkgconfig_module(self):
deps = mesonbuild.modules.pkgconfig.DependenciesHelper("thislib")
class Mock:
pass
mock = Mock()
mock.pcdep = Mock()
mock.pcdep.name = "some_name"
mock.version_reqs = []
deps.add_pub_libs([mock])
self.assertEqual(deps.format_reqs(deps.pub_reqs), "some_name")
class BasePlatformTests(unittest.TestCase):
def setUp(self):

Loading…
Cancel
Save