diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-18 13:54:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-18 13:54:50 +0200 |
commit | 55a7c265c11e0f3e8a94cf9f4fd0b5f036a717d2 (patch) | |
tree | 29e6686ece50f119e8a4e850653c221b6872b975 /mesonbuild/interpreter.py | |
parent | 1841d53a84be13a3ba989b917930b824aafdac26 (diff) | |
parent | 7297e9f7a3581d132b0bccc47da4435c7315c74b (diff) | |
download | meson-55a7c265c11e0f3e8a94cf9f4fd0b5f036a717d2.zip meson-55a7c265c11e0f3e8a94cf9f4fd0b5f036a717d2.tar.gz meson-55a7c265c11e0f3e8a94cf9f4fd0b5f036a717d2.tar.bz2 |
Merge pull request #2863 from jon-turney/exit-status-on-exception
Verify that failing tests are failing with an error, not a python exception
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 4bd7d7f..8041526 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1504,6 +1504,8 @@ class Interpreter(InterpreterBase): 'test': self.func_test, 'vcs_tag': self.func_vcs_tag, }) + if 'MESON_UNIT_TEST' in os.environ: + self.funcs.update({'exception': self.func_exception}) def holderify(self, item): if isinstance(item, list): @@ -1984,6 +1986,11 @@ to directly access options of other subprojects.''') self.validate_arguments(args, 1, [str]) raise InterpreterException('Problem encountered: ' + args[0]) + @noKwargs + def func_exception(self, node, args, kwargs): + self.validate_arguments(args, 0, []) + raise Exception() + def detect_compilers(self, lang, need_cross_compiler): cross_comp = None if lang == 'c': |