diff options
author | Ran Benita <ran234@gmail.com> | 2018-02-23 03:45:13 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2018-02-23 04:35:15 +0200 |
commit | 4d8e4654cb9b3958897d2d230a3714b1abc6b9b4 (patch) | |
tree | daf8e0be61c3360820c714fac1750b05950d6583 /run_unittests.py | |
parent | 6ec401af4b3ac974a1699fa5486e19dd299d77e0 (diff) | |
download | meson-4d8e4654cb9b3958897d2d230a3714b1abc6b9b4.zip meson-4d8e4654cb9b3958897d2d230a3714b1abc6b9b4.tar.gz meson-4d8e4654cb9b3958897d2d230a3714b1abc6b9b4.tar.bz2 |
Warn if non-permitted keyword arguments are given to compiler methods
This can help future generations avoid mistakes like this:
https://github.com/xkbcommon/libxkbcommon/commit/edb1c662394578a54b7bbed231d918925e5d8150
To avoid breaking builds, this is currently just an error. After
sufficient time has passed this can hopefully become a hard error,
similarly to the already-existing `permittedKwargs` warnings.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 41cbf39..d986a0d 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1735,6 +1735,16 @@ int main(int argc, char **argv) { ]: self.assertRegex(out, re.escape(expected)) + def test_permitted_method_kwargs(self): + tdir = os.path.join(self.unit_test_dir, '23 non-permitted kwargs') + out = self.init(tdir) + for expected in [ + r'WARNING: Passed invalid keyword argument "prefixxx".', + r'WARNING: Passed invalid keyword argument "argsxx".', + r'WARNING: Passed invalid keyword argument "invalidxx".', + ]: + self.assertRegex(out, re.escape(expected)) + def test_templates(self): ninja = detect_ninja() if ninja is None: |