aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-01-11 19:30:11 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-01-15 21:54:26 +0200
commit11f9425a5e123e7e4bb6296f4453a8e072eb95ed (patch)
treea20c91ddb92438ca27eba83b5ed8b73f6b839c24 /mesonbuild/backend/backends.py
parentcfc33ac4212cb59b4ace3d3f404227366ffa5daf (diff)
downloadmeson-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.py10
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)