diff options
author | Rafael Ăvila de EspĂndola <rafael@espindo.la> | 2018-08-19 08:19:11 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-09-03 21:24:01 +0300 |
commit | 07d2d88fa9bd4f3598f9212b7209f98443b636d9 (patch) | |
tree | d8abbc85c1206530cd152bdeacf2a25758e6d211 /run_unittests.py | |
parent | 862019e6de9c896e6e876c272db3e5c95393ac3c (diff) | |
download | meson-07d2d88fa9bd4f3598f9212b7209f98443b636d9.zip meson-07d2d88fa9bd4f3598f9212b7209f98443b636d9.tar.gz meson-07d2d88fa9bd4f3598f9212b7209f98443b636d9.tar.bz2 |
Allow override_find_program to use an executable.
With this it is now possible to do
foobar = executable('foobar', ...)
meson.override_find_program('foobar', foobar)
Which is convenient for a project like protobuf which produces both a
dependency and a tool. If protobuf is updated to use
override_find_program, it can be used as
protobuf_dep = dependency('protobuf', version : '>=3.3.1',
fallback : ['protobuf', 'protobuf_dep'])
protoc_prog = find_program('protoc')
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 94c1aba..d446a54 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3881,6 +3881,17 @@ endian = 'little' return raise RuntimeError('Could not find the rpath') + def test_override_with_exe_dep(self): + ''' + Test that we produce the correct dependencies when a program is overridden with an executable. + ''' + testdir = os.path.join(self.common_test_dir, '206 override with exe') + self.init(testdir) + with open(os.path.join(self.builddir, 'build.ninja')) as bfile: + for line in bfile: + if 'main1.c:' in line or 'main2.c:' in line: + self.assertIn('| subprojects/sub/foobar', line) + @skipIfNoPkgconfig def test_usage_external_library(self): ''' |