summaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-20 11:29:06 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-06-21 20:19:06 +0300
commit5cd9f88d6cafbbc2b748ffc85226d53800a05aac (patch)
tree314ae3accb148ac6f180da3373c9b4949b9e54f4 /test cases/common
parent2e8729a7e6cee460f8e75e231ecdd01933fbd277 (diff)
downloadmeson-5cd9f88d6cafbbc2b748ffc85226d53800a05aac.tar.gz
fix: Ensure that build targets have all methods from ExternalProgram
As a side-effect from #8885 `find_program()` returns now `Executable` objects when `meson.override_find_program` is called with an executable target. To resolve this conflict the missing methods from `ExternalProgram` are added to `BuildTarget`.
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/182 find override/meson.build10
-rw-r--r--test cases/common/182 find override/otherdir/meson.build4
2 files changed, 14 insertions, 0 deletions
diff --git a/test cases/common/182 find override/meson.build b/test cases/common/182 find override/meson.build
index b27745905..8dcbac76b 100644
--- a/test cases/common/182 find override/meson.build
+++ b/test cases/common/182 find override/meson.build
@@ -1,8 +1,10 @@
project('find program override', 'c')
gencodegen = find_program('gencodegen', required : false)
+six_prog = find_program('six_meson_exe', required : false)
assert(not gencodegen.found(), 'gencodegen is an internal program, should not be found')
+assert(not six_prog.found(), 'six_meson_exe is an internal program, should not be found')
# Test the check-if-found-else-override workflow
if not gencodegen.found()
@@ -13,3 +15,11 @@ subdir('otherdir')
tool = find_program('sometool')
assert(tool.found())
+assert(tool.full_path() != '')
+assert(tool.full_path() == tool.path())
+
+# six_meson_exe is an overritten project executable
+six_prog = find_program('six_meson_exe')
+assert(six_prog.found())
+assert(six_prog.full_path() != '')
+assert(six_prog.full_path() == six_prog.path())
diff --git a/test cases/common/182 find override/otherdir/meson.build b/test cases/common/182 find override/otherdir/meson.build
index 5cefc880b..7deff4035 100644
--- a/test cases/common/182 find override/otherdir/meson.build
+++ b/test cases/common/182 find override/otherdir/meson.build
@@ -10,6 +10,10 @@ e = executable('six', 'main.c', src)
test('six', e)
+# Override stuff with an executables
+meson.override_find_program('six_meson_exe', e)
+
+
# The same again, but this time with a program that was generated
# with configure_file.