diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-01-11 19:30:11 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-01-15 21:54:26 +0200 |
commit | 11f9425a5e123e7e4bb6296f4453a8e072eb95ed (patch) | |
tree | a20c91ddb92438ca27eba83b5ed8b73f6b839c24 /mesonbuild/backend/backends.py | |
parent | cfc33ac4212cb59b4ace3d3f404227366ffa5daf (diff) | |
download | meson-11f9425a5e123e7e4bb6296f4453a8e072eb95ed.zip meson-11f9425a5e123e7e4bb6296f4453a8e072eb95ed.tar.gz meson-11f9425a5e123e7e4bb6296f4453a8e072eb95ed.tar.bz2 |
Can use targets directly in test arguments.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 16cb041..56c786b 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -432,9 +432,17 @@ class Backend(): extra_paths = [] cmd_args = [] for a in t.cmd_args: + if hasattr(a, 'held_object'): + a = a.held_object if isinstance(a, mesonlib.File): a = os.path.join(self.environment.get_build_dir(), a.rel_to_builddir(self.build_to_src)) - cmd_args.append(a) + cmd_args.append(a) + elif isinstance(a, str): + cmd_args.append(a) + elif isinstance(a, build.Target): + cmd_args.append(self.get_target_filename(a)) + else: + raise MesonException('Bad object in test command.') ts = TestSerialisation(t.get_name(), t.suite, fname, is_cross, exe_wrapper, t.is_parallel, cmd_args, t.env, t.should_fail, t.timeout, t.workdir, extra_paths) |