diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-01-25 14:12:05 -0500 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-01-27 08:26:20 -0500 |
commit | e4137ae3eca0c73e8c19ea84d9a203ddb065f0d8 (patch) | |
tree | dd0f36ed09f5d9978fc5a71dae4fa97c70e1358e /mesonbuild/interpreter.py | |
parent | e6ab364a69f2e5a8b0692da926af1e19f4f28734 (diff) | |
download | meson-e4137ae3eca0c73e8c19ea84d9a203ddb065f0d8.zip meson-e4137ae3eca0c73e8c19ea84d9a203ddb065f0d8.tar.gz meson-e4137ae3eca0c73e8c19ea84d9a203ddb065f0d8.tar.bz2 |
test: Make timeout <= 0 infinite duraction
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index a3fa050..f317652 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -4140,6 +4140,10 @@ This will become a hard error in the future.''' % kwargs['input'], location=self if not isinstance(should_fail, bool): raise InterpreterException('Keyword argument should_fail must be a boolean.') timeout = kwargs.get('timeout', 30) + if not isinstance(timeout, int): + raise InterpreterException('Timeout must be an integer.') + if timeout <= 0: + FeatureNew('test() timeout <= 0', '0.57.0').use(self.subproject) if 'workdir' in kwargs: workdir = kwargs['workdir'] if not isinstance(workdir, str): @@ -4148,8 +4152,6 @@ This will become a hard error in the future.''' % kwargs['input'], location=self raise InterpreterException('Workdir keyword argument must be an absolute path.') else: workdir = None - if not isinstance(timeout, int): - raise InterpreterException('Timeout must be an integer.') protocol = kwargs.get('protocol', 'exitcode') if protocol not in {'exitcode', 'tap', 'gtest', 'rust'}: raise InterpreterException('Protocol must be one of "exitcode", "tap", "gtest", or "rust".') @@ -4638,6 +4640,8 @@ different subdirectory. timeout_multiplier = kwargs.get('timeout_multiplier', 1) if not isinstance(timeout_multiplier, int): raise InterpreterException('Timeout multiplier must be a number.') + if timeout_multiplier <= 0: + FeatureNew('add_test_setup() timeout_multiplier <= 0', '0.57.0').use(self.subproject) is_default = kwargs.get('is_default', False) if not isinstance(is_default, bool): raise InterpreterException('is_default option must be a boolean') |