aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2018-12-30 10:59:58 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-01-06 12:19:31 +0100
commit2e81631d0c892d4842412c5244d9374b390f3787 (patch)
treeaf504b848c9b34765dbbc1303f7a9b3b019d27e4
parent7cf0e307074f11028c383a85616ff7c5a3a1b529 (diff)
downloadmeson-2e81631d0c892d4842412c5244d9374b390f3787.zip
meson-2e81631d0c892d4842412c5244d9374b390f3787.tar.gz
meson-2e81631d0c892d4842412c5244d9374b390f3787.tar.bz2
Keep 'filename' and 'install_filename' as strings
-rw-r--r--docs/markdown/snippets/introspect_multiple.md3
-rw-r--r--mesonbuild/mintro.py5
-rwxr-xr-xrun_unittests.py25
3 files changed, 20 insertions, 13 deletions
diff --git a/docs/markdown/snippets/introspect_multiple.md b/docs/markdown/snippets/introspect_multiple.md
index 75580d3..53278e6 100644
--- a/docs/markdown/snippets/introspect_multiple.md
+++ b/docs/markdown/snippets/introspect_multiple.md
@@ -16,6 +16,5 @@ A complete introspection dump is also stored in the `meson-info`
directory. This dump will be (re)generated each time meson updates the configuration of the build directory.
Additionlly the format of `meson introspect target` was changed:
- - `filename` is now a list of output filenames
- - `install_filename` is now also a list of installed files
+
- New: the `sources` key. It stores the source files of a target and there compiler parameters
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 9372ed8..4de16ca 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -99,14 +99,15 @@ def list_targets(builddata: build.Build, installdata, backend: backends.Backend)
'name': target.get_basename(),
'id': idname,
'type': target.get_typename(),
- 'filename': fname,
+ 'filename': fname[0], # TODO Change this to the full list in a seperate PR
'build_by_default': target.build_by_default,
'sources': backend.get_introspection_data(idname, target)
}
if installdata and target.should_install():
t['installed'] = True
- t['install_filename'] = [intall_lookuptable.get(x, None) for x in target.get_outputs()]
+ # TODO Change this to the full list in a seperate PR
+ t['install_filename'] = [intall_lookuptable.get(x, None) for x in target.get_outputs()][0]
else:
t['installed'] = False
tlist.append(t)
diff --git a/run_unittests.py b/run_unittests.py
index 821ab09..69fac13 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1439,7 +1439,7 @@ class AllPlatformTests(BasePlatformTests):
# Get name of static library
targets = self.introspect('--targets')
self.assertEqual(len(targets), 1)
- libname = targets[0]['filename'][0]
+ libname = targets[0]['filename'] # TODO Change filename back to a list again
# Build and get contents of static library
self.build()
before = self._run(['ar', 't', os.path.join(self.builddir, libname)]).split()
@@ -1496,13 +1496,16 @@ class AllPlatformTests(BasePlatformTests):
intro = self.introspect('--targets')
if intro[0]['type'] == 'executable':
intro = intro[::-1]
- self.assertPathListEqual(intro[0]['install_filename'], ['/usr/lib/libstat.a'])
- self.assertPathListEqual(intro[1]['install_filename'], ['/usr/bin/prog' + exe_suffix])
+ self.assertPathListEqual([intro[0]['install_filename']], ['/usr/lib/libstat.a'])
+ self.assertPathListEqual([intro[1]['install_filename']], ['/usr/bin/prog' + exe_suffix])
def test_install_introspection_multiple_outputs(self):
'''
Tests that the Meson introspection API exposes multiple install filenames correctly without crashing
https://github.com/mesonbuild/meson/pull/4555
+
+ Reverted to the first file only because of https://github.com/mesonbuild/meson/pull/4547#discussion_r244173438
+ TODO Change the format to a list officialy in a followup PR
'''
if self.backend is not Backend.ninja:
raise unittest.SkipTest('{!r} backend can\'t install files'.format(self.backend.name))
@@ -1511,10 +1514,14 @@ class AllPlatformTests(BasePlatformTests):
intro = self.introspect('--targets')
if intro[0]['type'] == 'executable':
intro = intro[::-1]
- self.assertPathListEqual(intro[0]['install_filename'], ['/usr/include/diff.h', '/usr/bin/diff.sh'])
- self.assertPathListEqual(intro[1]['install_filename'], ['/opt/same.h', '/opt/same.sh'])
- self.assertPathListEqual(intro[2]['install_filename'], ['/usr/include/first.h', None])
- self.assertPathListEqual(intro[3]['install_filename'], [None, '/usr/bin/second.sh'])
+ #self.assertPathListEqual(intro[0]['install_filename'], ['/usr/include/diff.h', '/usr/bin/diff.sh'])
+ #self.assertPathListEqual(intro[1]['install_filename'], ['/opt/same.h', '/opt/same.sh'])
+ #self.assertPathListEqual(intro[2]['install_filename'], ['/usr/include/first.h', None])
+ #self.assertPathListEqual(intro[3]['install_filename'], [None, '/usr/bin/second.sh'])
+ self.assertPathListEqual([intro[0]['install_filename']], ['/usr/include/diff.h'])
+ self.assertPathListEqual([intro[1]['install_filename']], ['/opt/same.h'])
+ self.assertPathListEqual([intro[2]['install_filename']], ['/usr/include/first.h'])
+ self.assertPathListEqual([intro[3]['install_filename']], [None])
def test_uninstall(self):
exename = os.path.join(self.installdir, 'usr/bin/prog' + exe_suffix)
@@ -3173,7 +3180,7 @@ recommended as it is not supported on some platforms''')
('name', str),
('id', str),
('type', str),
- ('filename', list),
+ ('filename', str),
('build_by_default', bool),
('sources', list),
('installed', bool),
@@ -4396,7 +4403,7 @@ class LinuxlikeTests(BasePlatformTests):
break
self.assertIsInstance(docbook_target, dict)
ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0]
- self.assertListEqual(t['filename'], ['gdbus/generated-gdbus-doc-' + os.path.basename(ifile)])
+ self.assertListEqual([t['filename']], ['gdbus/generated-gdbus-doc-' + os.path.basename(ifile)])
def test_build_rpath(self):
if is_cygwin():