diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-03-23 23:11:04 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-03-23 23:11:04 +0200 |
commit | d289887b1badb079835d0c9734e38150d35e3d15 (patch) | |
tree | 8fdaef7edf6bb22c66ece3f11a28d4c97fb64a1d /interpreter.py | |
parent | 85132e894860b54c39f29c1491e353a12decc5f6 (diff) | |
download | meson-d289887b1badb079835d0c9734e38150d35e3d15.zip meson-d289887b1badb079835d0c9734e38150d35e3d15.tar.gz meson-d289887b1badb079835d0c9734e38150d35e3d15.tar.bz2 |
Add should_fail kwarg to test to indicate tests that should fail.
Diffstat (limited to 'interpreter.py')
-rw-r--r-- | interpreter.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/interpreter.py b/interpreter.py index 9aae7a4..dfd5330 100644 --- a/interpreter.py +++ b/interpreter.py @@ -429,13 +429,14 @@ class RunTargetHolder(InterpreterObject): self.held_object = build.RunTarget(name, command, args, subdir) class Test(InterpreterObject): - def __init__(self, name, exe, is_parallel, cmd_args, env, valgrind_args): + def __init__(self, name, exe, is_parallel, cmd_args, env, should_fail, valgrind_args): InterpreterObject.__init__(self) self.name = name self.exe = exe self.is_parallel = is_parallel self.cmd_args = cmd_args self.env = env + self.should_fail = should_fail self.valgrind_args = valgrind_args def get_exe(self): @@ -1310,7 +1311,10 @@ class Interpreter(): for a in valgrind_args: if not isinstance(a, str): raise InterpreterException('Valgrind_arg not a string.') - t = Test(args[0], args[1].held_object, par, cmd_args, env, valgrind_args) + should_fail = kwargs.get('should_fail', False) + if not isinstance(should_fail, bool): + raise InterpreterException('Keyword argument should_fail must be a boolean.') + t = Test(args[0], args[1].held_object, par, cmd_args, env, should_fail, valgrind_args) self.build.tests.append(t) mlog.debug('Adding test "', mlog.bold(args[0]), '".', sep='') |