aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-12-23 18:42:59 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-12-23 20:47:39 +0200
commit775729eb59a6c3a334bcecd9a8a1f932bacda603 (patch)
treefe879a1aa0a0b85b642f4b3e4bc30656f20b96aa /test cases
parenta97291dc6d57b903312c056ab022c09cabde13b6 (diff)
downloadmeson-775729eb59a6c3a334bcecd9a8a1f932bacda603.zip
meson-775729eb59a6c3a334bcecd9a8a1f932bacda603.tar.gz
meson-775729eb59a6c3a334bcecd9a8a1f932bacda603.tar.bz2
Can specify include directories to compiler tests.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/linuxlike/1 pkg-config/incdir/myinc.h3
-rw-r--r--test cases/linuxlike/1 pkg-config/meson.build20
2 files changed, 23 insertions, 0 deletions
diff --git a/test cases/linuxlike/1 pkg-config/incdir/myinc.h b/test cases/linuxlike/1 pkg-config/incdir/myinc.h
new file mode 100644
index 0000000..4b66a6c
--- /dev/null
+++ b/test cases/linuxlike/1 pkg-config/incdir/myinc.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#include<zlib.h>
diff --git a/test cases/linuxlike/1 pkg-config/meson.build b/test cases/linuxlike/1 pkg-config/meson.build
index 5a8366c..36a4545 100644
--- a/test cases/linuxlike/1 pkg-config/meson.build
+++ b/test cases/linuxlike/1 pkg-config/meson.build
@@ -26,3 +26,23 @@ test('zlibtest2', exe2)
# Try to find a nonexistant library to ensure requires:false works.
dep = dependency('nvakuhrabnsdfasdf', required : false)
+
+# Try to compile a test that takes a dep and an include_directories
+
+cc = meson.get_compiler('c')
+zlibdep = cc.find_library('z')
+code = '''#include<myinc.h>
+
+int main(int argc, char **argv) {
+ void * something = deflate;
+ if(something != 0)
+ return 0;
+ return 1;
+}
+'''
+
+inc = include_directories('incdir')
+
+r = cc.run(code, include_directories : inc, dependencies : zlibdep)
+assert(r.returncode() == 0, 'Running manual zlib test failed.')
+