Merge pull request #3945 from mesonbuild/dircondenser

Condense directory names with script.
pull/3977/head
Jussi Pakkanen 7 years ago committed by GitHub
commit 867af1264f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      run_project_tests.py
  2. 94
      run_unittests.py
  3. 0
      test cases/common/157 dotinclude/dotproc.c
  4. 0
      test cases/common/157 dotinclude/meson.build
  5. 0
      test cases/common/157 dotinclude/stdio.h
  6. 0
      test cases/common/158 reserved targets/all/meson.build
  7. 0
      test cases/common/158 reserved targets/benchmark/meson.build
  8. 0
      test cases/common/158 reserved targets/clean-ctlist/meson.build
  9. 0
      test cases/common/158 reserved targets/clean-gcda/meson.build
  10. 0
      test cases/common/158 reserved targets/clean-gcno/meson.build
  11. 0
      test cases/common/158 reserved targets/clean/meson.build
  12. 0
      test cases/common/158 reserved targets/coverage-html/meson.build
  13. 0
      test cases/common/158 reserved targets/coverage-text/meson.build
  14. 0
      test cases/common/158 reserved targets/coverage-xml/meson.build
  15. 0
      test cases/common/158 reserved targets/coverage/meson.build
  16. 0
      test cases/common/158 reserved targets/dist/meson.build
  17. 0
      test cases/common/158 reserved targets/distcheck/meson.build
  18. 0
      test cases/common/158 reserved targets/install/meson.build
  19. 0
      test cases/common/158 reserved targets/meson.build
  20. 0
      test cases/common/158 reserved targets/phony/meson.build
  21. 0
      test cases/common/158 reserved targets/reconfigure/meson.build
  22. 0
      test cases/common/158 reserved targets/runtarget/meson.build
  23. 0
      test cases/common/158 reserved targets/scan-build/meson.build
  24. 0
      test cases/common/158 reserved targets/test.c
  25. 0
      test cases/common/158 reserved targets/test/meson.build
  26. 0
      test cases/common/158 reserved targets/uninstall/meson.build
  27. 0
      test cases/common/159 duplicate source names/dir1/file.c
  28. 0
      test cases/common/159 duplicate source names/dir1/meson.build
  29. 0
      test cases/common/159 duplicate source names/dir2/dir1/file.c
  30. 0
      test cases/common/159 duplicate source names/dir2/file.c
  31. 0
      test cases/common/159 duplicate source names/dir2/meson.build
  32. 0
      test cases/common/159 duplicate source names/dir3/dir1/file.c
  33. 0
      test cases/common/159 duplicate source names/dir3/file.c
  34. 0
      test cases/common/159 duplicate source names/dir3/meson.build
  35. 0
      test cases/common/159 duplicate source names/meson.build
  36. 0
      test cases/common/160 index customtarget/check_args.py
  37. 0
      test cases/common/160 index customtarget/gen_sources.py
  38. 0
      test cases/common/160 index customtarget/lib.c
  39. 0
      test cases/common/160 index customtarget/meson.build
  40. 0
      test cases/common/160 index customtarget/subdir/foo.c
  41. 0
      test cases/common/160 index customtarget/subdir/meson.build
  42. 0
      test cases/common/161 wrap file should not failed/meson.build
  43. 0
      test cases/common/161 wrap file should not failed/src/meson.build
  44. 0
      test cases/common/161 wrap file should not failed/src/subprojects/foo/prog2.c
  45. 0
      test cases/common/161 wrap file should not failed/src/subprojects/prog.c
  46. 0
      test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip
  47. 0
      test cases/common/161 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz
  48. 0
      test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/foo.c
  49. 0
      test cases/common/161 wrap file should not failed/subprojects/zlib-1.2.8/meson.build
  50. 0
      test cases/common/161 wrap file should not failed/subprojects/zlib.wrap
  51. 0
      test cases/common/162 includedir subproj/meson.build
  52. 0
      test cases/common/162 includedir subproj/prog.c
  53. 0
      test cases/common/162 includedir subproj/subprojects/inctest/include/incfile.h
  54. 0
      test cases/common/162 includedir subproj/subprojects/inctest/meson.build
  55. 0
      test cases/common/163 subproject dir name collision/a.c
  56. 0
      test cases/common/163 subproject dir name collision/custom_subproject_dir/B/b.c
  57. 0
      test cases/common/163 subproject dir name collision/custom_subproject_dir/B/meson.build
  58. 0
      test cases/common/163 subproject dir name collision/custom_subproject_dir/C/c.c
  59. 0
      test cases/common/163 subproject dir name collision/custom_subproject_dir/C/meson.build
  60. 0
      test cases/common/163 subproject dir name collision/meson.build
  61. 0
      test cases/common/163 subproject dir name collision/other_subdir/custom_subproject_dir/other.c
  62. 0
      test cases/common/163 subproject dir name collision/other_subdir/meson.build
  63. 0
      test cases/common/164 config tool variable/meson.build
  64. 0
      test cases/common/165 custom target subdir depend files/copyfile.py
  65. 0
      test cases/common/165 custom target subdir depend files/meson.build
  66. 0
      test cases/common/165 custom target subdir depend files/subdir/dep.dat
  67. 0
      test cases/common/165 custom target subdir depend files/subdir/foo.c.in
  68. 0
      test cases/common/165 custom target subdir depend files/subdir/meson.build
  69. 0
      test cases/common/166 external program shebang parsing/input.txt
  70. 0
      test cases/common/166 external program shebang parsing/main.c
  71. 0
      test cases/common/166 external program shebang parsing/meson.build
  72. 0
      test cases/common/166 external program shebang parsing/script.int.in
  73. 0
      test cases/common/167 disabler/meson.build
  74. 0
      test cases/common/168 array option/meson.build
  75. 0
      test cases/common/168 array option/meson_options.txt
  76. 0
      test cases/common/169 custom target template substitution/checkcopy.py
  77. 0
      test cases/common/169 custom target template substitution/foo.c.in
  78. 0
      test cases/common/169 custom target template substitution/meson.build
  79. 0
      test cases/common/170 not-found dependency/meson.build
  80. 0
      test cases/common/170 not-found dependency/sub/meson.build
  81. 0
      test cases/common/170 not-found dependency/subprojects/trivial/meson.build
  82. 0
      test cases/common/170 not-found dependency/subprojects/trivial/trivial.c
  83. 0
      test cases/common/170 not-found dependency/testlib.c
  84. 0
      test cases/common/171 subdir if_found/meson.build
  85. 0
      test cases/common/171 subdir if_found/subdir/meson.build
  86. 0
      test cases/common/172 default options prefix dependent defaults/meson.build
  87. 0
      test cases/common/173 dependency factory/meson.build
  88. 0
      test cases/common/174 get project license/bar.c
  89. 0
      test cases/common/174 get project license/meson.build
  90. 0
      test cases/common/175 yield/meson.build
  91. 0
      test cases/common/175 yield/meson_options.txt
  92. 0
      test cases/common/175 yield/subprojects/sub/meson.build
  93. 0
      test cases/common/175 yield/subprojects/sub/meson_options.txt
  94. 0
      test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/a.c
  95. 0
      test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build
  96. 0
      test cases/common/176 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here
  97. 0
      test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/b.c
  98. 0
      test cases/common/176 subproject nested subproject dirs/contrib/subprojects/beta/meson.build
  99. 0
      test cases/common/176 subproject nested subproject dirs/meson.build
  100. 0
      test cases/common/176 subproject nested subproject dirs/prog.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -294,16 +294,16 @@ def run_test(skipped, testdir, extra_args, compiler, backend, flags, commands, s
mlog.shutdown() # Close the log file because otherwise Windows wets itself. mlog.shutdown() # Close the log file because otherwise Windows wets itself.
def pass_prefix_to_test(dirname): def pass_prefix_to_test(dirname):
if '40 prefix' in dirname: if '39 prefix absolute' in dirname:
return False return False
return True return True
def pass_libdir_to_test(dirname): def pass_libdir_to_test(dirname):
if '8 install' in dirname: if '8 install' in dirname:
return False return False
if '39 libdir' in dirname: if '38 libdir must be inside prefix' in dirname:
return False return False
if '201 install_mode' in dirname: if '199 install_mode' in dirname:
return False return False
return True return True

@ -987,7 +987,7 @@ class AllPlatformTests(BasePlatformTests):
dependent defaults for other options, and that those defaults can dependent defaults for other options, and that those defaults can
be overridden in default_options or by the command line. be overridden in default_options or by the command line.
''' '''
testdir = os.path.join(self.common_test_dir, '173 default options prefix dependent defaults') testdir = os.path.join(self.common_test_dir, '172 default options prefix dependent defaults')
expected = { expected = {
'': '':
{'prefix': '/usr', {'prefix': '/usr',
@ -1112,7 +1112,7 @@ class AllPlatformTests(BasePlatformTests):
self.assertPathDoesNotExist(exename) self.assertPathDoesNotExist(exename)
def test_forcefallback(self): def test_forcefallback(self):
testdir = os.path.join(self.unit_test_dir, '27 forcefallback') testdir = os.path.join(self.unit_test_dir, '31 forcefallback')
self.init(testdir, ['--wrap-mode=forcefallback']) self.init(testdir, ['--wrap-mode=forcefallback'])
self.build() self.build()
self.run_tests() self.run_tests()
@ -1148,7 +1148,7 @@ class AllPlatformTests(BasePlatformTests):
self._run(self.mtest_command + ['--setup=timeout']) self._run(self.mtest_command + ['--setup=timeout'])
def test_testsetup_selection(self): def test_testsetup_selection(self):
testdir = os.path.join(self.unit_test_dir, '13 testsetup selection') testdir = os.path.join(self.unit_test_dir, '14 testsetup selection')
self.init(testdir) self.init(testdir)
self.build() self.build()
@ -1652,7 +1652,7 @@ int main(int argc, char **argv) {
self.assertTrue(rpath is None) self.assertTrue(rpath is None)
def test_dash_d_dedup(self): def test_dash_d_dedup(self):
testdir = os.path.join(self.unit_test_dir, '10 d dedup') testdir = os.path.join(self.unit_test_dir, '9 d dedup')
self.init(testdir) self.init(testdir)
cmd = self.get_compdb()[0]['command'] cmd = self.get_compdb()[0]['command']
self.assertTrue('-D FOO -D BAR' in cmd or self.assertTrue('-D FOO -D BAR' in cmd or
@ -1662,10 +1662,10 @@ int main(int argc, char **argv) {
def test_all_forbidden_targets_tested(self): def test_all_forbidden_targets_tested(self):
''' '''
Test that all forbidden targets are tested in the '159 reserved targets' Test that all forbidden targets are tested in the '158 reserved targets'
test. Needs to be a unit test because it accesses Meson internals. test. Needs to be a unit test because it accesses Meson internals.
''' '''
testdir = os.path.join(self.common_test_dir, '159 reserved targets') testdir = os.path.join(self.common_test_dir, '158 reserved targets')
targets = mesonbuild.coredata.forbidden_target_names targets = mesonbuild.coredata.forbidden_target_names
# We don't actually define a target with this name # We don't actually define a target with this name
targets.pop('build.ninja') targets.pop('build.ninja')
@ -1703,7 +1703,7 @@ int main(int argc, char **argv) {
def test_prebuilt_object(self): def test_prebuilt_object(self):
(compiler, _, object_suffix, _) = self.detect_prebuild_env() (compiler, _, object_suffix, _) = self.detect_prebuild_env()
tdir = os.path.join(self.unit_test_dir, '14 prebuilt object') tdir = os.path.join(self.unit_test_dir, '15 prebuilt object')
source = os.path.join(tdir, 'source.c') source = os.path.join(tdir, 'source.c')
objectfile = os.path.join(tdir, 'prebuilt.' + object_suffix) objectfile = os.path.join(tdir, 'prebuilt.' + object_suffix)
self.pbcompile(compiler, source, objectfile) self.pbcompile(compiler, source, objectfile)
@ -1734,7 +1734,7 @@ int main(int argc, char **argv) {
def test_prebuilt_static_lib(self): def test_prebuilt_static_lib(self):
(cc, stlinker, object_suffix, _) = self.detect_prebuild_env() (cc, stlinker, object_suffix, _) = self.detect_prebuild_env()
tdir = os.path.join(self.unit_test_dir, '15 prebuilt static') tdir = os.path.join(self.unit_test_dir, '16 prebuilt static')
source = os.path.join(tdir, 'libdir/best.c') source = os.path.join(tdir, 'libdir/best.c')
objectfile = os.path.join(tdir, 'libdir/best.' + object_suffix) objectfile = os.path.join(tdir, 'libdir/best.' + object_suffix)
stlibfile = os.path.join(tdir, 'libdir/libbest.a') stlibfile = os.path.join(tdir, 'libdir/libbest.a')
@ -1766,7 +1766,7 @@ int main(int argc, char **argv) {
def test_prebuilt_shared_lib(self): def test_prebuilt_shared_lib(self):
(cc, _, object_suffix, shared_suffix) = self.detect_prebuild_env() (cc, _, object_suffix, shared_suffix) = self.detect_prebuild_env()
tdir = os.path.join(self.unit_test_dir, '16 prebuilt shared') tdir = os.path.join(self.unit_test_dir, '17 prebuilt shared')
source = os.path.join(tdir, 'alexandria.c') source = os.path.join(tdir, 'alexandria.c')
objectfile = os.path.join(tdir, 'alexandria.' + object_suffix) objectfile = os.path.join(tdir, 'alexandria.' + object_suffix)
impfile = os.path.join(tdir, 'alexandria.lib') impfile = os.path.join(tdir, 'alexandria.lib')
@ -1803,7 +1803,7 @@ int main(int argc, char **argv) {
https://github.com/mesonbuild/meson/issues/2785 https://github.com/mesonbuild/meson/issues/2785
''' '''
(cc, stlinker, objext, shext) = self.detect_prebuild_env() (cc, stlinker, objext, shext) = self.detect_prebuild_env()
testdir = os.path.join(self.unit_test_dir, '17 pkgconfig static') testdir = os.path.join(self.unit_test_dir, '18 pkgconfig static')
source = os.path.join(testdir, 'foo.c') source = os.path.join(testdir, 'foo.c')
objectfile = os.path.join(testdir, 'foo.' + objext) objectfile = os.path.join(testdir, 'foo.' + objext)
stlibfile = os.path.join(testdir, 'libfoo.a') stlibfile = os.path.join(testdir, 'libfoo.a')
@ -1868,7 +1868,7 @@ int main(int argc, char **argv) {
'type': 'array', 'type': 'array',
'value': ['foo', 'bar'], 'value': ['foo', 'bar'],
} }
tdir = os.path.join(self.unit_test_dir, '18 array option') tdir = os.path.join(self.unit_test_dir, '19 array option')
self.init(tdir) self.init(tdir)
original = get_opt() original = get_opt()
self.assertDictEqual(original, expected) self.assertDictEqual(original, expected)
@ -1892,7 +1892,7 @@ int main(int argc, char **argv) {
'type': 'array', 'type': 'array',
'value': ['foo', 'bar'], 'value': ['foo', 'bar'],
} }
tdir = os.path.join(self.unit_test_dir, '18 array option') tdir = os.path.join(self.unit_test_dir, '19 array option')
self.init(tdir) self.init(tdir)
original = get_opt() original = get_opt()
self.assertDictEqual(original, expected) self.assertDictEqual(original, expected)
@ -1916,7 +1916,7 @@ int main(int argc, char **argv) {
'type': 'array', 'type': 'array',
'value': [], 'value': [],
} }
tdir = os.path.join(self.unit_test_dir, '18 array option') tdir = os.path.join(self.unit_test_dir, '19 array option')
self.init(tdir, extra_args='-Dlist=') self.init(tdir, extra_args='-Dlist=')
original = get_opt() original = get_opt()
self.assertDictEqual(original, expected) self.assertDictEqual(original, expected)
@ -1941,7 +1941,7 @@ int main(int argc, char **argv) {
self.opt_has('free_array_opt', ['a,b', 'c,d']) self.opt_has('free_array_opt', ['a,b', 'c,d'])
def test_subproject_promotion(self): def test_subproject_promotion(self):
testdir = os.path.join(self.unit_test_dir, '13 promote') testdir = os.path.join(self.unit_test_dir, '12 promote')
workdir = os.path.join(self.builddir, 'work') workdir = os.path.join(self.builddir, 'work')
shutil.copytree(testdir, workdir) shutil.copytree(testdir, workdir)
spdir = os.path.join(workdir, 'subprojects') spdir = os.path.join(workdir, 'subprojects')
@ -1965,7 +1965,7 @@ int main(int argc, char **argv) {
self.build() self.build()
def test_warning_location(self): def test_warning_location(self):
tdir = os.path.join(self.unit_test_dir, '21 warning location') tdir = os.path.join(self.unit_test_dir, '22 warning location')
out = self.init(tdir) out = self.init(tdir)
for expected in [ for expected in [
r'meson.build:4: WARNING: Keyword argument "link_with" defined multiple times.', r'meson.build:4: WARNING: Keyword argument "link_with" defined multiple times.',
@ -1979,7 +1979,7 @@ int main(int argc, char **argv) {
self.assertRegex(out, re.escape(expected)) self.assertRegex(out, re.escape(expected))
def test_permitted_method_kwargs(self): def test_permitted_method_kwargs(self):
tdir = os.path.join(self.unit_test_dir, '23 non-permitted kwargs') tdir = os.path.join(self.unit_test_dir, '25 non-permitted kwargs')
out = self.init(tdir) out = self.init(tdir)
for expected in [ for expected in [
r'WARNING: Passed invalid keyword argument "prefixxx".', r'WARNING: Passed invalid keyword argument "prefixxx".',
@ -2063,7 +2063,7 @@ int main(int argc, char **argv) {
The test checks that the compiler object can be passed to The test checks that the compiler object can be passed to
run_command(). run_command().
''' '''
testdir = os.path.join(self.unit_test_dir, '23 compiler run_command') testdir = os.path.join(self.unit_test_dir, '24 compiler run_command')
self.init(testdir) self.init(testdir)
def test_identical_target_name_in_subproject_flat_layout(self): def test_identical_target_name_in_subproject_flat_layout(self):
@ -2071,7 +2071,7 @@ int main(int argc, char **argv) {
Test that identical targets in different subprojects do not collide Test that identical targets in different subprojects do not collide
if layout is flat. if layout is flat.
''' '''
testdir = os.path.join(self.common_test_dir, '182 identical target name in subproject flat layout') testdir = os.path.join(self.common_test_dir, '181 identical target name in subproject flat layout')
self.init(testdir, extra_args=['--layout=flat']) self.init(testdir, extra_args=['--layout=flat'])
self.build() self.build()
@ -2080,7 +2080,7 @@ int main(int argc, char **argv) {
Test that identical targets in different subdirs do not collide Test that identical targets in different subdirs do not collide
if layout is flat. if layout is flat.
''' '''
testdir = os.path.join(self.common_test_dir, '192 same target name flat layout') testdir = os.path.join(self.common_test_dir, '190 same target name flat layout')
self.init(testdir, extra_args=['--layout=flat']) self.init(testdir, extra_args=['--layout=flat'])
self.build() self.build()
@ -2103,21 +2103,21 @@ int main(int argc, char **argv) {
https://github.com/mesonbuild/meson/issues/2865 https://github.com/mesonbuild/meson/issues/2865
(That an error is raised on OSX is exercised by test failing/78) (That an error is raised on OSX is exercised by test failing/78)
""" """
tdir = os.path.join(self.unit_test_dir, '26 shared_mod linking') tdir = os.path.join(self.unit_test_dir, '30 shared_mod linking')
out = self.init(tdir) out = self.init(tdir)
msg = ('''WARNING: target links against shared modules. This is not msg = ('''WARNING: target links against shared modules. This is not
recommended as it is not supported on some platforms''') recommended as it is not supported on some platforms''')
self.assertIn(msg, out) self.assertIn(msg, out)
def test_ndebug_if_release_disabled(self): def test_ndebug_if_release_disabled(self):
testdir = os.path.join(self.unit_test_dir, '25 ndebug if-release') testdir = os.path.join(self.unit_test_dir, '28 ndebug if-release')
self.init(testdir, extra_args=['--buildtype=release', '-Db_ndebug=if-release']) self.init(testdir, extra_args=['--buildtype=release', '-Db_ndebug=if-release'])
self.build() self.build()
exe = os.path.join(self.builddir, 'main') exe = os.path.join(self.builddir, 'main')
self.assertEqual(b'NDEBUG=1', subprocess.check_output(exe).strip()) self.assertEqual(b'NDEBUG=1', subprocess.check_output(exe).strip())
def test_ndebug_if_release_enabled(self): def test_ndebug_if_release_enabled(self):
testdir = os.path.join(self.unit_test_dir, '25 ndebug if-release') testdir = os.path.join(self.unit_test_dir, '28 ndebug if-release')
self.init(testdir, extra_args=['--buildtype=debugoptimized', '-Db_ndebug=if-release']) self.init(testdir, extra_args=['--buildtype=debugoptimized', '-Db_ndebug=if-release'])
self.build() self.build()
exe = os.path.join(self.builddir, 'main') exe = os.path.join(self.builddir, 'main')
@ -2129,7 +2129,7 @@ recommended as it is not supported on some platforms''')
linker command line. linker command line.
''' '''
# build library # build library
testdirbase = os.path.join(self.unit_test_dir, '26 guessed linker dependencies') testdirbase = os.path.join(self.unit_test_dir, '29 guessed linker dependencies')
testdirlib = os.path.join(testdirbase, 'lib') testdirlib = os.path.join(testdirbase, 'lib')
extra_args = None extra_args = None
env = Environment(testdirlib, self.builddir, get_fake_options(self.prefix)) env = Environment(testdirlib, self.builddir, get_fake_options(self.prefix))
@ -2172,14 +2172,14 @@ recommended as it is not supported on some platforms''')
self.assertRebuiltTarget('app') self.assertRebuiltTarget('app')
def test_conflicting_d_dash_option(self): def test_conflicting_d_dash_option(self):
testdir = os.path.join(self.unit_test_dir, '30 mixed command line args') testdir = os.path.join(self.unit_test_dir, '35 mixed command line args')
with self.assertRaises(subprocess.CalledProcessError) as e: with self.assertRaises(subprocess.CalledProcessError) as e:
self.init(testdir, extra_args=['-Dbindir=foo', '--bindir=bar']) self.init(testdir, extra_args=['-Dbindir=foo', '--bindir=bar'])
# Just to ensure that we caught the correct error # Just to ensure that we caught the correct error
self.assertIn('passed as both', e.stderr) self.assertIn('passed as both', e.stderr)
def _test_same_option_twice(self, arg, args): def _test_same_option_twice(self, arg, args):
testdir = os.path.join(self.unit_test_dir, '30 mixed command line args') testdir = os.path.join(self.unit_test_dir, '35 mixed command line args')
self.init(testdir, extra_args=args) self.init(testdir, extra_args=args)
opts = self.introspect('--buildoptions') opts = self.introspect('--buildoptions')
for item in opts: for item in opts:
@ -2198,7 +2198,7 @@ recommended as it is not supported on some platforms''')
self._test_same_option_twice('one', ['-Done=foo', '-Done=bar']) self._test_same_option_twice('one', ['-Done=foo', '-Done=bar'])
def _test_same_option_twice_configure(self, arg, args): def _test_same_option_twice_configure(self, arg, args):
testdir = os.path.join(self.unit_test_dir, '30 mixed command line args') testdir = os.path.join(self.unit_test_dir, '35 mixed command line args')
self.init(testdir) self.init(testdir)
self.setconf(args) self.setconf(args)
opts = self.introspect('--buildoptions') opts = self.introspect('--buildoptions')
@ -2221,7 +2221,7 @@ recommended as it is not supported on some platforms''')
'one', ['-Done=foo', '-Done=bar']) 'one', ['-Done=foo', '-Done=bar'])
def test_command_line(self): def test_command_line(self):
testdir = os.path.join(self.unit_test_dir, '30 command line') testdir = os.path.join(self.unit_test_dir, '34 command line')
# Verify default values when passing no args # Verify default values when passing no args
self.init(testdir) self.init(testdir)
@ -2396,7 +2396,7 @@ recommended as it is not supported on some platforms''')
self.assertIn(f, toc) self.assertIn(f, toc)
def test_feature_check_usage_subprojects(self): def test_feature_check_usage_subprojects(self):
testdir = os.path.join(self.unit_test_dir, '34 featurenew subprojects') testdir = os.path.join(self.unit_test_dir, '39 featurenew subprojects')
out = self.init(testdir) out = self.init(testdir)
# Parent project warns correctly # Parent project warns correctly
self.assertRegex(out, "WARNING: Project targetting '>=0.45'.*'0.47.0': dict") self.assertRegex(out, "WARNING: Project targetting '>=0.45'.*'0.47.0': dict")
@ -2691,7 +2691,7 @@ class WindowsTests(BasePlatformTests):
correctly. Cannot be an ordinary test because it involves manipulating correctly. Cannot be an ordinary test because it involves manipulating
PATH to point to a directory with Python scripts. PATH to point to a directory with Python scripts.
''' '''
testdir = os.path.join(self.platform_test_dir, '9 find program') testdir = os.path.join(self.platform_test_dir, '8 find program')
# Find `cmd` and `cmd.exe` # Find `cmd` and `cmd.exe`
prog1 = ExternalProgram('cmd') prog1 = ExternalProgram('cmd')
self.assertTrue(prog1.found(), msg='cmd not found') self.assertTrue(prog1.found(), msg='cmd not found')
@ -2759,7 +2759,7 @@ class WindowsTests(BasePlatformTests):
self.wipe() self.wipe()
if depfile_works: if depfile_works:
testdir = os.path.join(self.platform_test_dir, '13 resources with custom targets') testdir = os.path.join(self.platform_test_dir, '12 resources with custom targets')
self.init(testdir) self.init(testdir)
self.build() self.build()
# Immediately rebuilding should not do anything # Immediately rebuilding should not do anything
@ -2884,7 +2884,7 @@ class LinuxlikeTests(BasePlatformTests):
self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo >= 1.0', 'libhello'])) self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo >= 1.0', 'libhello']))
def test_pkg_unfound(self): def test_pkg_unfound(self):
testdir = os.path.join(self.unit_test_dir, '22 unfound pkgconfig') testdir = os.path.join(self.unit_test_dir, '23 unfound pkgconfig')
self.init(testdir) self.init(testdir)
with open(os.path.join(self.privatedir, 'somename.pc')) as f: with open(os.path.join(self.privatedir, 'somename.pc')) as f:
pcfile = f.read() pcfile = f.read()
@ -3158,7 +3158,7 @@ class LinuxlikeTests(BasePlatformTests):
''' '''
Test that files are installed with correct permissions using install_mode. Test that files are installed with correct permissions using install_mode.
''' '''
testdir = os.path.join(self.common_test_dir, '201 install_mode') testdir = os.path.join(self.common_test_dir, '199 install_mode')
self.init(testdir) self.init(testdir)
self.build() self.build()
self.install() self.install()
@ -3198,11 +3198,11 @@ class LinuxlikeTests(BasePlatformTests):
''' '''
# Copy source tree to a temporary directory and change permissions # Copy source tree to a temporary directory and change permissions
# there to simulate a checkout with umask 002. # there to simulate a checkout with umask 002.
orig_testdir = os.path.join(self.unit_test_dir, '24 install umask') orig_testdir = os.path.join(self.unit_test_dir, '26 install umask')
# Create a new testdir under tmpdir. # Create a new testdir under tmpdir.
tmpdir = os.path.realpath(tempfile.mkdtemp()) tmpdir = os.path.realpath(tempfile.mkdtemp())
self.addCleanup(windows_proof_rmtree, tmpdir) self.addCleanup(windows_proof_rmtree, tmpdir)
testdir = os.path.join(tmpdir, '24 install umask') testdir = os.path.join(tmpdir, '26 install umask')
# Copy the tree using shutil.copyfile, which will use the current umask # Copy the tree using shutil.copyfile, which will use the current umask
# instead of preserving permissions of the old tree. # instead of preserving permissions of the old tree.
save_umask = os.umask(0o002) save_umask = os.umask(0o002)
@ -3310,7 +3310,7 @@ class LinuxlikeTests(BasePlatformTests):
self.assertTrue('prog' in v or 'foo' in v) self.assertTrue('prog' in v or 'foo' in v)
def test_order_of_l_arguments(self): def test_order_of_l_arguments(self):
testdir = os.path.join(self.unit_test_dir, '9 -L -l order') testdir = os.path.join(self.unit_test_dir, '8 -L -l order')
os.environ['PKG_CONFIG_PATH'] = testdir os.environ['PKG_CONFIG_PATH'] = testdir
self.init(testdir) self.init(testdir)
# NOTE: .pc file has -Lfoo -lfoo -Lbar -lbar but pkg-config reorders # NOTE: .pc file has -Lfoo -lfoo -Lbar -lbar but pkg-config reorders
@ -3370,7 +3370,7 @@ class LinuxlikeTests(BasePlatformTests):
def test_build_rpath(self): def test_build_rpath(self):
if is_cygwin(): if is_cygwin():
raise unittest.SkipTest('Windows PE/COFF binaries do not use RPATH') raise unittest.SkipTest('Windows PE/COFF binaries do not use RPATH')
testdir = os.path.join(self.unit_test_dir, '11 build_rpath') testdir = os.path.join(self.unit_test_dir, '10 build_rpath')
self.init(testdir) self.init(testdir)
self.build() self.build()
# C program RPATH # C program RPATH
@ -3413,7 +3413,7 @@ class LinuxlikeTests(BasePlatformTests):
self.run_target('coverage-html') self.run_target('coverage-html')
def test_cross_find_program(self): def test_cross_find_program(self):
testdir = os.path.join(self.unit_test_dir, '12 cross prog') testdir = os.path.join(self.unit_test_dir, '11 cross prog')
crossfile = tempfile.NamedTemporaryFile(mode='w') crossfile = tempfile.NamedTemporaryFile(mode='w')
print(os.path.join(testdir, 'some_cross_tool.py')) print(os.path.join(testdir, 'some_cross_tool.py'))
crossfile.write('''[binaries] crossfile.write('''[binaries]
@ -3476,8 +3476,8 @@ endian = 'little'
@skipIfNoPkgconfig @skipIfNoPkgconfig
def test_pkgconfig_usage(self): def test_pkgconfig_usage(self):
testdir1 = os.path.join(self.unit_test_dir, '24 pkgconfig usage/dependency') testdir1 = os.path.join(self.unit_test_dir, '27 pkgconfig usage/dependency')
testdir2 = os.path.join(self.unit_test_dir, '24 pkgconfig usage/dependee') testdir2 = os.path.join(self.unit_test_dir, '27 pkgconfig usage/dependee')
if subprocess.call(['pkg-config', '--cflags', 'glib-2.0'], if subprocess.call(['pkg-config', '--cflags', 'glib-2.0'],
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL) != 0: stderr=subprocess.DEVNULL) != 0:
@ -3516,7 +3516,7 @@ endian = 'little'
''' '''
with tempfile.TemporaryDirectory() as tempdirname: with tempfile.TemporaryDirectory() as tempdirname:
# build library # build library
testdirbase = os.path.join(self.unit_test_dir, '28 pkgconfig use libraries') testdirbase = os.path.join(self.unit_test_dir, '32 pkgconfig use libraries')
testdirlib = os.path.join(testdirbase, 'lib') testdirlib = os.path.join(testdirbase, 'lib')
self.init(testdirlib, extra_args=['--prefix=' + tempdirname, self.init(testdirlib, extra_args=['--prefix=' + tempdirname,
'--libdir=lib', '--libdir=lib',
@ -3533,7 +3533,7 @@ endian = 'little'
@skipIfNoPkgconfig @skipIfNoPkgconfig
def test_pkgconfig_formatting(self): def test_pkgconfig_formatting(self):
testdir = os.path.join(self.unit_test_dir, '31 pkgconfig format') testdir = os.path.join(self.unit_test_dir, '36 pkgconfig format')
self.init(testdir) self.init(testdir)
myenv = os.environ.copy() myenv = os.environ.copy()
myenv['PKG_CONFIG_PATH'] = self.privatedir myenv['PKG_CONFIG_PATH'] = self.privatedir
@ -3595,7 +3595,7 @@ endian = 'little'
''' '''
Test that the dependencies are always listed in a deterministic order. Test that the dependencies are always listed in a deterministic order.
''' '''
testdir = os.path.join(self.unit_test_dir, '36 dep order') testdir = os.path.join(self.unit_test_dir, '41 dep order')
self.init(testdir) self.init(testdir)
with open(os.path.join(self.builddir, 'build.ninja')) as bfile: with open(os.path.join(self.builddir, 'build.ninja')) as bfile:
for line in bfile: for line in bfile:
@ -3610,7 +3610,7 @@ endian = 'little'
''' '''
if is_cygwin(): if is_cygwin():
raise unittest.SkipTest('rpath are not used on Cygwin') raise unittest.SkipTest('rpath are not used on Cygwin')
testdir = os.path.join(self.unit_test_dir, '35 rpath order') testdir = os.path.join(self.unit_test_dir, '40 rpath order')
self.init(testdir) self.init(testdir)
if is_osx(): if is_osx():
rpathre = re.compile('-rpath,.*/subprojects/sub1.*-rpath,.*/subprojects/sub2') rpathre = re.compile('-rpath,.*/subprojects/sub1.*-rpath,.*/subprojects/sub2')
@ -3637,7 +3637,7 @@ endian = 'little'
raise unittest.SkipTest('workflow currently only works on macOS') raise unittest.SkipTest('workflow currently only works on macOS')
oldprefix = self.prefix oldprefix = self.prefix
# Install external library so we can find it # Install external library so we can find it
testdir = os.path.join(self.unit_test_dir, '33 external, internal library rpath', 'external library') testdir = os.path.join(self.unit_test_dir, '38 external, internal library rpath', 'external library')
# install into installdir without using DESTDIR # install into installdir without using DESTDIR
installdir = self.installdir installdir = self.installdir
self.prefix = installdir self.prefix = installdir
@ -3649,7 +3649,7 @@ endian = 'little'
self.new_builddir() self.new_builddir()
os.environ['LIBRARY_PATH'] = os.path.join(installdir, self.libdir) os.environ['LIBRARY_PATH'] = os.path.join(installdir, self.libdir)
os.environ['PKG_CONFIG_PATH'] = os.path.join(installdir, self.libdir, 'pkgconfig') os.environ['PKG_CONFIG_PATH'] = os.path.join(installdir, self.libdir, 'pkgconfig')
testdir = os.path.join(self.unit_test_dir, '33 external, internal library rpath', 'built library') testdir = os.path.join(self.unit_test_dir, '38 external, internal library rpath', 'built library')
# install into installdir without using DESTDIR # install into installdir without using DESTDIR
self.prefix = self.installdir self.prefix = self.installdir
self.init(testdir) self.init(testdir)
@ -3707,7 +3707,7 @@ class LinuxCrossArmTests(BasePlatformTests):
https://github.com/mesonbuild/meson/issues/3049 https://github.com/mesonbuild/meson/issues/3049
https://github.com/mesonbuild/meson/issues/3089 https://github.com/mesonbuild/meson/issues/3089
''' '''
testdir = os.path.join(self.unit_test_dir, '29 cross file overrides always args') testdir = os.path.join(self.unit_test_dir, '33 cross file overrides always args')
self.meson_cross_file = os.path.join(testdir, 'ubuntu-armhf-overrides.txt') self.meson_cross_file = os.path.join(testdir, 'ubuntu-armhf-overrides.txt')
self.init(testdir) self.init(testdir)
compdb = self.get_compdb() compdb = self.get_compdb()
@ -3762,7 +3762,7 @@ class PythonTests(BasePlatformTests):
if self.backend is not Backend.ninja: if self.backend is not Backend.ninja:
raise unittest.SkipTest('Skipping python tests with {} backend'.format(self.backend.name)) raise unittest.SkipTest('Skipping python tests with {} backend'.format(self.backend.name))
testdir = os.path.join(self.src_root, 'test cases', 'unit', '32 python extmodule') testdir = os.path.join(self.src_root, 'test cases', 'unit', '37 python extmodule')
# No python version specified, this will use meson's python # No python version specified, this will use meson's python
self.init(testdir) self.init(testdir)

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save