aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-04-20 16:23:33 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2020-04-28 01:39:56 +0300
commit39a69d1fb0e130fae9f64b81e0a992503869a97a (patch)
tree2f9cbed234a6d55ba033acda49ec438e7c34fa3a /test cases
parent34e7e8780c0196313be8700f504ec84fd6cba3d1 (diff)
downloadmeson-39a69d1fb0e130fae9f64b81e0a992503869a97a.zip
meson-39a69d1fb0e130fae9f64b81e0a992503869a97a.tar.gz
meson-39a69d1fb0e130fae9f64b81e0a992503869a97a.tar.bz2
find_program: Fixes when the program has been overridden by executable
- ExternalProgramHolder has path() method while CustomTargetHolder and BuildTargetHolder have full_path(). - The returned ExternalProgramHolder's path() method was broken, because build.Executable object has no get_path() method, it needs the backend. - find_program('overridden_prog', version : '>=1.0') was broken because it needs to execute the exe that is not yet built. Now assume the program has the (sub)project version. - If the version check fails, interpreter uses ExternalProgramHolder.get_name() for the error message but build.Executable does not implement get_name() method.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/201 override with exe/meson.build8
-rw-r--r--test cases/common/201 override with exe/subprojects/sub/meson.build2
2 files changed, 8 insertions, 2 deletions
diff --git a/test cases/common/201 override with exe/meson.build b/test cases/common/201 override with exe/meson.build
index 81f6c02..62d2f32 100644
--- a/test cases/common/201 override with exe/meson.build
+++ b/test cases/common/201 override with exe/meson.build
@@ -1,6 +1,10 @@
project('myexe', 'c')
sub = subproject('sub')
-prog = find_program('foobar')
+
+prog = find_program('foobar', version : '>= 2.0', required : false)
+assert(not prog.found())
+
+prog = find_program('foobar', version : '>= 1.0')
custom1 = custom_target('custom1',
build_by_default : true,
input : [],
@@ -11,5 +15,7 @@ gen = generator(prog,
arguments : ['@OUTPUT@'])
custom2 = gen.process('main2.input')
+message(prog.full_path())
+
executable('e1', custom1)
executable('e2', custom2)
diff --git a/test cases/common/201 override with exe/subprojects/sub/meson.build b/test cases/common/201 override with exe/subprojects/sub/meson.build
index 1f186da..f0343b2 100644
--- a/test cases/common/201 override with exe/subprojects/sub/meson.build
+++ b/test cases/common/201 override with exe/subprojects/sub/meson.build
@@ -1,3 +1,3 @@
-project('sub', 'c')
+project('sub', 'c', version : '1.0')
foobar = executable('foobar', 'foobar.c', native : true)
meson.override_find_program('foobar', foobar)