aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Pkgconfig-module.md7
-rw-r--r--docs/markdown/Reference-manual.md27
-rw-r--r--docs/markdown/Release-notes-for-0.46.0.md7
-rw-r--r--docs/markdown/snippets/pkgconfig-generator.md14
-rw-r--r--mesonbuild/interpreter.py11
-rw-r--r--mesonbuild/interpreterbase.py5
-rw-r--r--mesonbuild/mconf.py16
-rw-r--r--mesonbuild/mintro.py44
-rw-r--r--mesonbuild/modules/pkgconfig.py30
-rw-r--r--mesonbuild/mtest.py86
-rw-r--r--mesonbuild/rewriter.py22
-rw-r--r--mesonbuild/scripts/meson_exe.py8
-rwxr-xr-xrun_unittests.py15
-rw-r--r--test cases/common/188 subdir_done/meson.build10
-rw-r--r--test cases/common/51 pkgconfig-gen/dependencies/meson.build8
-rw-r--r--test cases/d/3 shared library/meson.build9
-rw-r--r--test cases/failing/71 skip only subdir/meson.build8
-rw-r--r--test cases/failing/71 skip only subdir/subdir/meson.build3
18 files changed, 227 insertions, 103 deletions
diff --git a/docs/markdown/Pkgconfig-module.md b/docs/markdown/Pkgconfig-module.md
index 853cf50..77db809 100644
--- a/docs/markdown/Pkgconfig-module.md
+++ b/docs/markdown/Pkgconfig-module.md
@@ -51,3 +51,10 @@ keyword arguments.
- `version` a string describing the version of this library
- `d_module_versions` a list of module version flags used when compiling
D sources referred to by this pkg-config file
+
+Since 0.46 a `StaticLibrary` or `SharedLibrary` object can optionally be passed
+as first positional argument. If one is provided a default value will be
+provided for all required fields of the pc file:
+- `install_dir` is set to `pkgconfig` folder in the same location than the provided library.
+- `description` is set to the project's name followed by the library's name.
+- `name` is set to the library's name.
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 54b7131..5109b25 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -1129,6 +1129,33 @@ This function has one keyword argument.
recurse in the subdir if they all return `true` when queried with
`.found()`
+### subdir_done()
+
+``` meson
+ subdir_done()
+```
+
+Stops further interpretation of the meson script file from the point of
+the invocation. All steps executed up to this point are valid and will
+be executed by meson. This means that all targets defined before the call
+of `subdir_done` will be build.
+
+If the current script was called by `subdir` the execution returns to the
+calling directory and continues as if the script had reached the end.
+If the current script is the top level script meson configures the project
+as defined up to this point.
+
+Example:
+```meson
+project('example exit', 'cpp')
+executable('exe1', 'exe1.cpp')
+subdir_done()
+executable('exe2', 'exe2.cpp')
+```
+
+The executable `exe1` will be build, while the executable `exe2` is not
+build.
+
### subproject()
``` meson
diff --git a/docs/markdown/Release-notes-for-0.46.0.md b/docs/markdown/Release-notes-for-0.46.0.md
index 395a94d..e062459 100644
--- a/docs/markdown/Release-notes-for-0.46.0.md
+++ b/docs/markdown/Release-notes-for-0.46.0.md
@@ -14,3 +14,10 @@ whose contents should look like this:
## Feature name
A short description explaining the new feature and how it should be used.
+
+## Allow early return from a script
+
+Added the function `subdir_done()`. Its invocation exits the current script at
+the point of invocation. All previously invoked build targets and commands are
+build/executed. All following ones are ignored. If the current script was
+invoked via `subdir()` the parent script continues normally.
diff --git a/docs/markdown/snippets/pkgconfig-generator.md b/docs/markdown/snippets/pkgconfig-generator.md
new file mode 100644
index 0000000..93920d3
--- /dev/null
+++ b/docs/markdown/snippets/pkgconfig-generator.md
@@ -0,0 +1,14 @@
+## Improvements to pkgconfig module
+
+A `StaticLibrary` or `SharedLibrary` object can optionally be passed
+as first positional argument of the `generate()` method. If one is provided a
+default value will be provided for all required fields of the pc file:
+- `install_dir` is set to `pkgconfig` folder in the same location than the provided library.
+- `description` is set to the project's name followed by the library's name.
+- `name` is set to the library's name.
+
+Generating a .pc file is now as simple as:
+
+```
+pkgconfig.generate(mylib)
+```
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index c87a49b..7dbf1cc 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -26,7 +26,7 @@ from .dependencies import ExternalProgram
from .dependencies import InternalDependency, Dependency, DependencyException
from .interpreterbase import InterpreterBase
from .interpreterbase import check_stringlist, noPosargs, noKwargs, stringArgs, permittedKwargs, permittedMethodKwargs
-from .interpreterbase import InterpreterException, InvalidArguments, InvalidCode
+from .interpreterbase import InterpreterException, InvalidArguments, InvalidCode, SubdirDoneRequest
from .interpreterbase import InterpreterObject, MutableInterpreterObject, Disabler
from .modules import ModuleReturnValue
@@ -1612,6 +1612,7 @@ class Interpreter(InterpreterBase):
'static_library': self.func_static_lib,
'test': self.func_test,
'vcs_tag': self.func_vcs_tag,
+ 'subdir_done': self.func_subdir_done,
})
if 'MESON_UNIT_TEST' in os.environ:
self.funcs.update({'exception': self.func_exception})
@@ -2607,6 +2608,14 @@ root and issuing %s.
return self.func_custom_target(node, [kwargs['output']], kwargs)
@stringArgs
+ def func_subdir_done(self, node, args, kwargs):
+ if len(kwargs) > 0:
+ raise InterpreterException('exit does not take named arguments')
+ if len(args) > 0:
+ raise InterpreterException('exit does not take any arguments')
+ raise SubdirDoneRequest()
+
+ @stringArgs
@permittedKwargs(permitted_kwargs['custom_target'])
def func_custom_target(self, node, args, kwargs):
if len(args) != 1:
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py
index 9279506..f957d90 100644
--- a/mesonbuild/interpreterbase.py
+++ b/mesonbuild/interpreterbase.py
@@ -105,6 +105,9 @@ class InvalidCode(InterpreterException):
class InvalidArguments(InterpreterException):
pass
+class SubdirDoneRequest(BaseException):
+ pass
+
class InterpreterObject:
def __init__(self):
self.methods = {}
@@ -203,6 +206,8 @@ class InterpreterBase:
try:
self.current_lineno = cur.lineno
self.evaluate_statement(cur)
+ except SubdirDoneRequest:
+ break
except Exception as e:
if not(hasattr(e, 'lineno')):
e.lineno = cur.lineno
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index b409615..cadd306 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -17,13 +17,15 @@ import sys
import argparse
from . import (coredata, mesonlib, build)
-parser = argparse.ArgumentParser(prog='meson configure')
+def buildparser():
+ parser = argparse.ArgumentParser(prog='meson configure')
-parser.add_argument('-D', action='append', default=[], dest='sets',
- help='Set an option to the given value.')
-parser.add_argument('directory', nargs='*')
-parser.add_argument('--clearcache', action='store_true', default=False,
- help='Clear cached state (e.g. found dependencies)')
+ parser.add_argument('-D', action='append', default=[], dest='sets',
+ help='Set an option to the given value.')
+ parser.add_argument('directory', nargs='*')
+ parser.add_argument('--clearcache', action='store_true', default=False,
+ help='Clear cached state (e.g. found dependencies)')
+ return parser
class ConfException(mesonlib.MesonException):
@@ -226,7 +228,7 @@ def run(args):
args = mesonlib.expand_arguments(args)
if not args:
args = [os.getcwd()]
- options = parser.parse_args(args)
+ options = buildparser().parse_args(args)
if len(options.directory) > 1:
print('%s <build directory>' % args[0])
print('If you omit the build directory, the current directory is substituted.')
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 23e666c..74d26da 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -26,26 +26,28 @@ import argparse
import sys, os
import pathlib
-parser = argparse.ArgumentParser(prog='meson introspect')
-parser.add_argument('--targets', action='store_true', dest='list_targets', default=False,
- help='List top level targets.')
-parser.add_argument('--installed', action='store_true', dest='list_installed', default=False,
- help='List all installed files and directories.')
-parser.add_argument('--target-files', action='store', dest='target_files', default=None,
- help='List source files for a given target.')
-parser.add_argument('--buildsystem-files', action='store_true', dest='buildsystem_files', default=False,
- help='List files that make up the build system.')
-parser.add_argument('--buildoptions', action='store_true', dest='buildoptions', default=False,
- help='List all build options.')
-parser.add_argument('--tests', action='store_true', dest='tests', default=False,
- help='List all unit tests.')
-parser.add_argument('--benchmarks', action='store_true', dest='benchmarks', default=False,
- help='List all benchmarks.')
-parser.add_argument('--dependencies', action='store_true', dest='dependencies', default=False,
- help='List external dependencies.')
-parser.add_argument('--projectinfo', action='store_true', dest='projectinfo', default=False,
- help='Information about projects.')
-parser.add_argument('builddir', nargs='?', help='The build directory')
+def buildparser():
+ parser = argparse.ArgumentParser(prog='meson introspect')
+ parser.add_argument('--targets', action='store_true', dest='list_targets', default=False,
+ help='List top level targets.')
+ parser.add_argument('--installed', action='store_true', dest='list_installed', default=False,
+ help='List all installed files and directories.')
+ parser.add_argument('--target-files', action='store', dest='target_files', default=None,
+ help='List source files for a given target.')
+ parser.add_argument('--buildsystem-files', action='store_true', dest='buildsystem_files', default=False,
+ help='List files that make up the build system.')
+ parser.add_argument('--buildoptions', action='store_true', dest='buildoptions', default=False,
+ help='List all build options.')
+ parser.add_argument('--tests', action='store_true', dest='tests', default=False,
+ help='List all unit tests.')
+ parser.add_argument('--benchmarks', action='store_true', dest='benchmarks', default=False,
+ help='List all benchmarks.')
+ parser.add_argument('--dependencies', action='store_true', dest='dependencies', default=False,
+ help='List external dependencies.')
+ parser.add_argument('--projectinfo', action='store_true', dest='projectinfo', default=False,
+ help='Information about projects.')
+ parser.add_argument('builddir', nargs='?', help='The build directory')
+ return parser
def determine_installed_path(target, installdata):
install_target = None
@@ -202,7 +204,7 @@ def list_projinfo(builddata):
def run(args):
datadir = 'meson-private'
- options = parser.parse_args(args)
+ options = buildparser().parse_args(args)
if options.builddir is not None:
datadir = os.path.join(options.builddir, datadir)
if not os.path.isdir(datadir):
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index c85624c..ef74d63 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -301,20 +301,34 @@ class PkgConfigModule(ExtensionModule):
'subdirs', 'requires', 'requires_private', 'libraries_private',
'install_dir', 'extra_cflags', 'variables', 'url', 'd_module_versions'})
def generate(self, state, args, kwargs):
- if len(args) > 0:
- raise mesonlib.MesonException('Pkgconfig_gen takes no positional arguments.')
+ default_version = state.project_version['version']
+ default_install_dir = None
+ default_description = None
+ default_name = None
+ mainlib = None
+ if len(args) == 1:
+ mainlib = getattr(args[0], 'held_object', args[0])
+ if not isinstance(mainlib, (build.StaticLibrary, build.SharedLibrary)):
+ raise mesonlib.MesonException('Pkgconfig_gen first positional argument must be a library object')
+ default_name = mainlib.name
+ default_description = state.project_name + ': ' + mainlib.name
+ install_dir = mainlib.get_custom_install_dir()[0]
+ if isinstance(install_dir, str):
+ default_install_dir = os.path.join(install_dir, 'pkgconfig')
+ elif len(args) > 1:
+ raise mesonlib.MesonException('Too many positional arguments passed to Pkgconfig_gen.')
subdirs = mesonlib.stringlistify(kwargs.get('subdirs', ['.']))
- version = kwargs.get('version', None)
+ version = kwargs.get('version', default_version)
if not isinstance(version, str):
raise mesonlib.MesonException('Version must be specified.')
- name = kwargs.get('name', None)
+ name = kwargs.get('name', default_name)
if not isinstance(name, str):
raise mesonlib.MesonException('Name not specified.')
filebase = kwargs.get('filebase', name)
if not isinstance(filebase, str):
raise mesonlib.MesonException('Filebase must be a string.')
- description = kwargs.get('description', None)
+ description = kwargs.get('description', default_description)
if not isinstance(description, str):
raise mesonlib.MesonException('Description is not a string.')
url = kwargs.get('url', '')
@@ -323,6 +337,8 @@ class PkgConfigModule(ExtensionModule):
conflicts = mesonlib.stringlistify(kwargs.get('conflicts', []))
deps = DependenciesHelper(filebase)
+ if mainlib:
+ deps.add_pub_libs(mainlib)
deps.add_pub_libs(kwargs.get('libraries', []))
deps.add_priv_libs(kwargs.get('libraries_private', []))
deps.add_pub_reqs(kwargs.get('requires', []))
@@ -333,7 +349,7 @@ class PkgConfigModule(ExtensionModule):
if dversions:
compiler = state.environment.coredata.compilers.get('d')
if compiler:
- deps.add_cflags(compiler.get_feature_args({'versions': dversions}))
+ deps.add_cflags(compiler.get_feature_args({'versions': dversions}, None))
def parse_variable_list(stringlist):
reserved = ['prefix', 'libdir', 'includedir']
@@ -362,7 +378,7 @@ class PkgConfigModule(ExtensionModule):
variables = parse_variable_list(mesonlib.stringlistify(kwargs.get('variables', [])))
pcfile = filebase + '.pc'
- pkgroot = kwargs.get('install_dir', None)
+ pkgroot = kwargs.get('install_dir', default_install_dir)
if pkgroot is None:
pkgroot = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'pkgconfig')
if not isinstance(pkgroot, str):
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 1c2a9ae..91567f2 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -60,47 +60,49 @@ def determine_worker_count():
num_workers = 1
return num_workers
-parser = argparse.ArgumentParser(prog='meson test')
-parser.add_argument('--repeat', default=1, dest='repeat', type=int,
- help='Number of times to run the tests.')
-parser.add_argument('--no-rebuild', default=False, action='store_true',
- help='Do not rebuild before running tests.')
-parser.add_argument('--gdb', default=False, dest='gdb', action='store_true',
- help='Run test under gdb.')
-parser.add_argument('--list', default=False, dest='list', action='store_true',
- help='List available tests.')
-parser.add_argument('--wrapper', default=None, dest='wrapper', type=shlex.split,
- help='wrapper to run tests with (e.g. Valgrind)')
-parser.add_argument('-C', default='.', dest='wd',
- help='directory to cd into before running')
-parser.add_argument('--suite', default=[], dest='include_suites', action='append', metavar='SUITE',
- help='Only run tests belonging to the given suite.')
-parser.add_argument('--no-suite', default=[], dest='exclude_suites', action='append', metavar='SUITE',
- help='Do not run tests belonging to the given suite.')
-parser.add_argument('--no-stdsplit', default=True, dest='split', action='store_false',
- help='Do not split stderr and stdout in test logs.')
-parser.add_argument('--print-errorlogs', default=False, action='store_true',
- help="Whether to print failing tests' logs.")
-parser.add_argument('--benchmark', default=False, action='store_true',
- help="Run benchmarks instead of tests.")
-parser.add_argument('--logbase', default='testlog',
- help="Base name for log file.")
-parser.add_argument('--num-processes', default=determine_worker_count(), type=int,
- help='How many parallel processes to use.')
-parser.add_argument('-v', '--verbose', default=False, action='store_true',
- help='Do not redirect stdout and stderr')
-parser.add_argument('-q', '--quiet', default=False, action='store_true',
- help='Produce less output to the terminal.')
-parser.add_argument('-t', '--timeout-multiplier', type=float, default=None,
- help='Define a multiplier for test timeout, for example '
- ' when running tests in particular conditions they might take'
- ' more time to execute.')
-parser.add_argument('--setup', default=None, dest='setup',
- help='Which test setup to use.')
-parser.add_argument('--test-args', default=[], type=shlex.split,
- help='Arguments to pass to the specified test(s) or all tests')
-parser.add_argument('args', nargs='*',
- help='Optional list of tests to run')
+def buildparser():
+ parser = argparse.ArgumentParser(prog='meson test')
+ parser.add_argument('--repeat', default=1, dest='repeat', type=int,
+ help='Number of times to run the tests.')
+ parser.add_argument('--no-rebuild', default=False, action='store_true',
+ help='Do not rebuild before running tests.')
+ parser.add_argument('--gdb', default=False, dest='gdb', action='store_true',
+ help='Run test under gdb.')
+ parser.add_argument('--list', default=False, dest='list', action='store_true',
+ help='List available tests.')
+ parser.add_argument('--wrapper', default=None, dest='wrapper', type=shlex.split,
+ help='wrapper to run tests with (e.g. Valgrind)')
+ parser.add_argument('-C', default='.', dest='wd',
+ help='directory to cd into before running')
+ parser.add_argument('--suite', default=[], dest='include_suites', action='append', metavar='SUITE',
+ help='Only run tests belonging to the given suite.')
+ parser.add_argument('--no-suite', default=[], dest='exclude_suites', action='append', metavar='SUITE',
+ help='Do not run tests belonging to the given suite.')
+ parser.add_argument('--no-stdsplit', default=True, dest='split', action='store_false',
+ help='Do not split stderr and stdout in test logs.')
+ parser.add_argument('--print-errorlogs', default=False, action='store_true',
+ help="Whether to print failing tests' logs.")
+ parser.add_argument('--benchmark', default=False, action='store_true',
+ help="Run benchmarks instead of tests.")
+ parser.add_argument('--logbase', default='testlog',
+ help="Base name for log file.")
+ parser.add_argument('--num-processes', default=determine_worker_count(), type=int,
+ help='How many parallel processes to use.')
+ parser.add_argument('-v', '--verbose', default=False, action='store_true',
+ help='Do not redirect stdout and stderr')
+ parser.add_argument('-q', '--quiet', default=False, action='store_true',
+ help='Produce less output to the terminal.')
+ parser.add_argument('-t', '--timeout-multiplier', type=float, default=None,
+ help='Define a multiplier for test timeout, for example '
+ ' when running tests in particular conditions they might take'
+ ' more time to execute.')
+ parser.add_argument('--setup', default=None, dest='setup',
+ help='Which test setup to use.')
+ parser.add_argument('--test-args', default=[], type=shlex.split,
+ help='Arguments to pass to the specified test(s) or all tests')
+ parser.add_argument('args', nargs='*',
+ help='Optional list of tests to run')
+ return parser
class TestException(mesonlib.MesonException):
@@ -652,7 +654,7 @@ def rebuild_all(wd):
return True
def run(args):
- options = parser.parse_args(args)
+ options = buildparser().parse_args(args)
if options.benchmark:
options.num_processes = 1
diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py
index fad7ba0..1127288 100644
--- a/mesonbuild/rewriter.py
+++ b/mesonbuild/rewriter.py
@@ -29,18 +29,20 @@ from mesonbuild import mlog
import sys, traceback
import argparse
-parser = argparse.ArgumentParser(prog='meson rewrite')
-
-parser.add_argument('--sourcedir', default='.',
- help='Path to source directory.')
-parser.add_argument('--target', default=None,
- help='Name of target to edit.')
-parser.add_argument('--filename', default=None,
- help='Name of source file to add or remove to target.')
-parser.add_argument('commands', nargs='+')
+def buildparser():
+ parser = argparse.ArgumentParser(prog='meson rewrite')
+
+ parser.add_argument('--sourcedir', default='.',
+ help='Path to source directory.')
+ parser.add_argument('--target', default=None,
+ help='Name of target to edit.')
+ parser.add_argument('--filename', default=None,
+ help='Name of source file to add or remove to target.')
+ parser.add_argument('commands', nargs='+')
+ return parser
def run(args):
- options = parser.parse_args(args)
+ options = buildparser().parse_args(args)
if options.target is None or options.filename is None:
sys.exit("Must specify both target and filename.")
print('This tool is highly experimental, use with care.')
diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py
index c43702e..46d501f 100644
--- a/mesonbuild/scripts/meson_exe.py
+++ b/mesonbuild/scripts/meson_exe.py
@@ -21,8 +21,10 @@ import subprocess
options = None
-parser = argparse.ArgumentParser()
-parser.add_argument('args', nargs='+')
+def buildparser():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('args', nargs='+')
+ return parser
def is_windows():
platname = platform.system().lower()
@@ -70,7 +72,7 @@ def run_exe(exe):
def run(args):
global options
- options = parser.parse_args(args)
+ options = buildparser().parse_args(args)
if len(options.args) != 1:
print('Test runner for Meson. Do not run on your own, mmm\'kay?')
print(sys.argv[0] + ' [data file]')
diff --git a/run_unittests.py b/run_unittests.py
index 1546bc6..96a98eb 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -439,10 +439,11 @@ class InternalTests(unittest.TestCase):
for f in snippet_dir.glob('*'):
self.assertTrue(f.is_file())
if f.suffix == '.md':
- for line in f.open():
- m = re.match(hashcounter, line)
- if m:
- self.assertEqual(len(m.group(0)), 2, 'All headings in snippets must have two hash symbols: ' + f.name)
+ with f.open() as snippet:
+ for line in snippet:
+ m = re.match(hashcounter, line)
+ if m:
+ self.assertEqual(len(m.group(0)), 2, 'All headings in snippets must have two hash symbols: ' + f.name)
else:
if f.name != 'add_release_note_snippets_here':
self.assertTrue(False, 'A file without .md suffix in snippets dir: ' + f.name)
@@ -1813,7 +1814,8 @@ int main(int argc, char **argv) {
self._run(ninja,
workdir=os.path.join(tmpdir, 'builddir'))
with tempfile.TemporaryDirectory() as tmpdir:
- open(os.path.join(tmpdir, 'foo.' + lang), 'w').write('int main() {}')
+ with open(os.path.join(tmpdir, 'foo.' + lang), 'w') as f:
+ f.write('int main() {}')
self._run(meson_command + ['init', '-b'], workdir=tmpdir)
# The test uses mocking and thus requires that
@@ -2298,7 +2300,8 @@ class LinuxlikeTests(BasePlatformTests):
def test_pkg_unfound(self):
testdir = os.path.join(self.unit_test_dir, '22 unfound pkgconfig')
self.init(testdir)
- pcfile = open(os.path.join(self.privatedir, 'somename.pc')).read()
+ with open(os.path.join(self.privatedir, 'somename.pc')) as f:
+ pcfile = f.read()
self.assertFalse('blub_blob_blib' in pcfile)
def test_vala_c_warnings(self):
diff --git a/test cases/common/188 subdir_done/meson.build b/test cases/common/188 subdir_done/meson.build
new file mode 100644
index 0000000..5692f3a
--- /dev/null
+++ b/test cases/common/188 subdir_done/meson.build
@@ -0,0 +1,10 @@
+# Should run, even though main.cpp does not exist and we call error in the last line.
+# subdir_done jumps to end, so both lines are not executed.
+
+project('example exit', 'cpp')
+
+subdir_done()
+
+executable('main', 'main.cpp')
+error('Unreachable')
+
diff --git a/test cases/common/51 pkgconfig-gen/dependencies/meson.build b/test cases/common/51 pkgconfig-gen/dependencies/meson.build
index 822a7b7..d13f009 100644
--- a/test cases/common/51 pkgconfig-gen/dependencies/meson.build
+++ b/test cases/common/51 pkgconfig-gen/dependencies/meson.build
@@ -1,4 +1,4 @@
-project('pkgconfig-gen-dependencies', 'c')
+project('pkgconfig-gen-dependencies', 'c', version: '1.0')
pkgg = import('pkgconfig')
@@ -7,11 +7,7 @@ exposed_lib = shared_library('libexposed', 'exposed.c')
internal_lib = shared_library('libinternal', 'internal.c')
main_lib = static_library('libmain', link_with : [exposed_lib, internal_lib])
-pkgg.generate(libraries : exposed_lib,
- version : '1.0',
- name : 'libexposed',
- description : 'An exposed library in dependency test.'
-)
+pkgg.generate(exposed_lib)
# Declare a few different Dependency objects
pc_dep = dependency('libfoo', version : '>=1.0')
diff --git a/test cases/d/3 shared library/meson.build b/test cases/d/3 shared library/meson.build
index 78ad766..4616242 100644
--- a/test cases/d/3 shared library/meson.build
+++ b/test cases/d/3 shared library/meson.build
@@ -10,3 +10,12 @@ endif
ldyn = shared_library('stuff', 'libstuff.d', install : true)
ed = executable('app_d', 'app.d', link_with : ldyn, install : true)
test('linktest_dyn', ed)
+
+# test D attributes for pkg-config
+pkgc = import('pkgconfig')
+pkgc.generate(name: 'test',
+ libraries: ldyn,
+ subdirs: 'd/stuff',
+ description: 'A test of D attributes to pkgconfig.generate.',
+ d_module_versions: ['Use_Static']
+)
diff --git a/test cases/failing/71 skip only subdir/meson.build b/test cases/failing/71 skip only subdir/meson.build
new file mode 100644
index 0000000..4832bd4
--- /dev/null
+++ b/test cases/failing/71 skip only subdir/meson.build
@@ -0,0 +1,8 @@
+# Check that skip_rest only exits subdir, not the whole script.
+# Should create an error because main.cpp does not exists.
+project('example exit', 'cpp')
+
+subdir('subdir')
+
+message('Good')
+executable('main', 'main.cpp')
diff --git a/test cases/failing/71 skip only subdir/subdir/meson.build b/test cases/failing/71 skip only subdir/subdir/meson.build
new file mode 100644
index 0000000..1ba447b
--- /dev/null
+++ b/test cases/failing/71 skip only subdir/subdir/meson.build
@@ -0,0 +1,3 @@
+subdir_done()
+
+error('Unreachable')