aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-10-04 01:10:39 +0300
committerGitHub <noreply@github.com>2019-10-04 01:10:39 +0300
commit39342fbe2547337c721930a5892799dc7048caf8 (patch)
tree4254c0880eec4575a8aa05042f80d02d802b7120
parent7d01629580949a18960f79603fca1d0edb337aa1 (diff)
parent678ee8a9c1487b1c6771e98258ba841028daae9f (diff)
downloadmeson-39342fbe2547337c721930a5892799dc7048caf8.zip
meson-39342fbe2547337c721930a5892799dc7048caf8.tar.gz
meson-39342fbe2547337c721930a5892799dc7048caf8.tar.bz2
Merge pull request #5990 from dcbaker/extra-benchmark-options
Correctly warn and document options to benchmarks
-rw-r--r--docs/markdown/Reference-manual.md3
-rw-r--r--mesonbuild/interpreter.py12
2 files changed, 12 insertions, 3 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 176cde4..cd87646 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -155,6 +155,9 @@ run. The behavior of this function is identical to `test` with the
exception that there is no `is_parallel` keyword, because benchmarks
are never run in parallel.
+*Note:* Prior to 0.52.0 benchmark would warn that `depends` and `proiority`
+were unsupported, this is incorrect
+
### both_libraries()
``` meson
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 0aa4b37..ec7a7b2 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1948,13 +1948,15 @@ known_build_target_kwargs = (
{'target_type'}
)
+_base_test_args = {'args', 'depends', 'env', 'should_fail', 'timeout', 'workdir', 'suite', 'priority', 'protocol'}
+
permitted_kwargs = {'add_global_arguments': {'language', 'native'},
'add_global_link_arguments': {'language', 'native'},
'add_languages': {'required'},
'add_project_link_arguments': {'language', 'native'},
'add_project_arguments': {'language', 'native'},
'add_test_setup': {'exe_wrapper', 'gdb', 'timeout_multiplier', 'env', 'is_default'},
- 'benchmark': {'args', 'env', 'should_fail', 'timeout', 'workdir', 'suite'},
+ 'benchmark': _base_test_args,
'build_target': known_build_target_kwargs,
'configure_file': {'input',
'output',
@@ -2032,8 +2034,7 @@ permitted_kwargs = {'add_global_arguments': {'language', 'native'},
'library': known_library_kwargs,
'subdir': {'if_found'},
'subproject': {'version', 'default_options', 'required'},
- 'test': {'args', 'depends', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir',
- 'suite', 'protocol', 'priority'},
+ 'test': set.union(_base_test_args, {'is_parallel'}),
'vcs_tag': {'input', 'output', 'fallback', 'command', 'replace_string'},
}
@@ -3364,8 +3365,13 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
self.generators.append(gen)
return gen
+ @FeatureNewKwargs('benchmark', '0.46.0', ['depends'])
+ @FeatureNewKwargs('benchmark', '0.52.0', ['priority'])
@permittedKwargs(permitted_kwargs['benchmark'])
def func_benchmark(self, node, args, kwargs):
+ # is_parallel isn't valid here, so make sure it isn't passed
+ if 'is_parallel' in kwargs:
+ del kwargs['is_parallel']
self.add_test(node, args, kwargs, False)
@FeatureNewKwargs('test', '0.46.0', ['depends'])