Added
Link Here
|
1 |
https://github.com/mesonbuild/meson/pull/4324 |
2 |
https://github.com/mesonbuild/meson/pull/4325 |
3 |
https://github.com/mesonbuild/meson/pull/6007 |
4 |
|
5 |
--- run_unittests.py.orig 2019-10-06 17:01:35 UTC |
6 |
+++ run_unittests.py |
7 |
@@ -57,6 +57,7 @@ from mesonbuild.mesonlib import ( |
8 |
from mesonbuild.environment import detect_ninja |
9 |
from mesonbuild.mesonlib import MesonException, EnvironmentException |
10 |
from mesonbuild.dependencies import PkgConfigDependency, ExternalProgram |
11 |
+import mesonbuild.dependencies.base |
12 |
from mesonbuild.build import Target |
13 |
import mesonbuild.modules.pkgconfig |
14 |
|
15 |
@@ -1164,7 +1165,26 @@ class InternalTests(unittest.TestCase): |
16 |
deps = d.get_all_dependencies(target) |
17 |
self.assertEqual(deps, expdeps) |
18 |
|
19 |
+ def test_sort_libpaths(self): |
20 |
+ sort_libpaths = mesonbuild.dependencies.base.sort_libpaths |
21 |
+ self.assertEqual(sort_libpaths( |
22 |
+ ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib'], |
23 |
+ ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']), |
24 |
+ ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib']) |
25 |
+ self.assertEqual(sort_libpaths( |
26 |
+ ['/usr/local/lib', '/home/mesonuser/.local/lib', '/usr/lib'], |
27 |
+ ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']), |
28 |
+ ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib']) |
29 |
+ self.assertEqual(sort_libpaths( |
30 |
+ ['/usr/lib', '/usr/local/lib', '/home/mesonuser/.local/lib'], |
31 |
+ ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']), |
32 |
+ ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib']) |
33 |
+ self.assertEqual(sort_libpaths( |
34 |
+ ['/usr/lib', '/usr/local/lib', '/home/mesonuser/.local/lib'], |
35 |
+ ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/libdata/pkgconfig']), |
36 |
+ ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib']) |
37 |
|
38 |
+ |
39 |
@unittest.skipIf(is_tarball(), 'Skipping because this is a tarball release') |
40 |
class DataTests(unittest.TestCase): |
41 |
|
42 |
@@ -5643,6 +5664,7 @@ class LinuxlikeTests(BasePlatformTests): |
43 |
# Assert that |
44 |
self.assertEqual(len(line.split(lib)), 2, msg=(lib, line)) |
45 |
|
46 |
+ @skipIfNoPkgconfig |
47 |
def test_noncross_options(self): |
48 |
# C_std defined in project options must be in effect also when native compiling. |
49 |
testdir = os.path.join(self.unit_test_dir, '51 noncross options') |
50 |
@@ -5665,6 +5687,7 @@ c = ['{0}'] |
51 |
# TODO should someday be explicit about build platform only here |
52 |
self.init(testdir, override_envvars=env) |
53 |
|
54 |
+ @skipIfNoPkgconfig |
55 |
def test_static_link(self): |
56 |
if is_cygwin(): |
57 |
raise unittest.SkipTest("Cygwin doesn't support LD_LIBRARY_PATH.") |
58 |
@@ -5680,7 +5703,7 @@ c = ['{0}'] |
59 |
# Test that installed libraries works |
60 |
self.new_builddir() |
61 |
self.prefix = oldprefix |
62 |
- meson_args = ['-Dc_link_args=-L{}'.format(libdir), |
63 |
+ meson_args = ['-Dc_link_args=-L{} -Wl,-rpath,{}'.format(libdir, libdir), |
64 |
'--fatal-meson-warnings'] |
65 |
testdir = os.path.join(self.unit_test_dir, '69 static link') |
66 |
env = {'PKG_CONFIG_LIBDIR': os.path.join(libdir, 'pkgconfig')} |