diff options
author | Lyude Paul <lyude@redhat.com> | 2017-10-23 15:37:06 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-10-29 01:56:57 +0300 |
commit | 1a159db8e90fa6b9571a06768d6f1ba08074e819 (patch) | |
tree | ad68a408fe39d115c84f04ab435f25e419011be1 /test cases/failing | |
parent | 6e406ed0dbd326728240237391e18b0726753b4b (diff) | |
download | meson-1a159db8e90fa6b9571a06768d6f1ba08074e819.zip meson-1a159db8e90fa6b9571a06768d6f1ba08074e819.tar.gz meson-1a159db8e90fa6b9571a06768d6f1ba08074e819.tar.bz2 |
Raise InvalidArguments when trying to link against strings
With executable(), if the link_with argument has a string as one of it's
elements, meson ends up throwing an AttributeError exception:
...
File "/home/lyudess/Projects/meson/mesonbuild/build.py", line 868, in link
if not t.is_linkable_target():
AttributeError: 'str' object has no attribute 'is_linkable_target'
Which is not very helpful in figuring out where exactly the project is
trying to link against a string instead of an actual link target. So,
fix this by verifying in BuildTarget.link() that each given target is
actually a Target object and not something else.
Additionally, add a simple test case for this in failing tests. At the
moment, this test case just passes unconditionally due to meson throwing
the AttributeError exception and failing as expected. However, this test
case will be useful eventually if we ever end up making failing tests
more strict about failing gracefully (per advice of QuLogic).
Diffstat (limited to 'test cases/failing')
-rw-r--r-- | test cases/failing/66 string as link target/meson.build | 2 | ||||
-rw-r--r-- | test cases/failing/66 string as link target/prog.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/test cases/failing/66 string as link target/meson.build b/test cases/failing/66 string as link target/meson.build new file mode 100644 index 0000000..cb83fff --- /dev/null +++ b/test cases/failing/66 string as link target/meson.build @@ -0,0 +1,2 @@ +project('string as link argument', 'c') +executable('myprog', 'prog.c', link_with: [ '' ]) diff --git a/test cases/failing/66 string as link target/prog.c b/test cases/failing/66 string as link target/prog.c new file mode 100644 index 0000000..0314ff1 --- /dev/null +++ b/test cases/failing/66 string as link target/prog.c @@ -0,0 +1 @@ +int main(int argc, char **argv) { return 0; } |