aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Klumpp <matthias@tenstral.net>2018-02-12 19:03:30 +0100
committerNirbheek Chauhan <nirbheek@centricular.com>2018-02-19 01:32:17 +0530
commitdb9a5f7fc715620d9a2ee3ead2b9a30345cb01a1 (patch)
tree2bf834193374b4bb94e05cb51c5e467ae2490224
parentfcee3c9eba1cae334160f961f535a35c30ea7553 (diff)
downloadmeson-db9a5f7fc715620d9a2ee3ead2b9a30345cb01a1.zip
meson-db9a5f7fc715620d9a2ee3ead2b9a30345cb01a1.tar.gz
meson-db9a5f7fc715620d9a2ee3ead2b9a30345cb01a1.tar.bz2
Add test for subprojects in subdirectories
-rw-r--r--test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/a.c15
-rw-r--r--test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build4
-rw-r--r--test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here1
-rw-r--r--test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/b.c14
-rw-r--r--test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/meson.build3
-rw-r--r--test cases/common/177 subproject nested subproject dirs/meson.build7
-rw-r--r--test cases/common/177 subproject nested subproject dirs/prog.c5
7 files changed, 49 insertions, 0 deletions
diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/a.c b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/a.c
new file mode 100644
index 0000000..7ac3e5e
--- /dev/null
+++ b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/a.c
@@ -0,0 +1,15 @@
+int func2();
+
+#if defined _WIN32 || defined __CYGWIN__
+ #define DLL_PUBLIC __declspec(dllexport)
+#else
+ #if defined __GNUC__
+ #define DLL_PUBLIC __attribute__ ((visibility("default")))
+ #else
+ #pragma message ("Compiler does not support symbol visibility.")
+ #define DLL_PUBLIC
+ #endif
+#endif
+
+int DLL_PUBLIC func() { return func2(); }
+
diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build
new file mode 100644
index 0000000..12f6564
--- /dev/null
+++ b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build
@@ -0,0 +1,4 @@
+project('alpha project', 'c', subproject_dir: 'var/subprojects')
+
+b = subproject('beta')
+l = shared_library('a', 'a.c', link_with : b.get_variable('lb'))
diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here
new file mode 100644
index 0000000..8d1c8b6
--- /dev/null
+++ b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here
@@ -0,0 +1 @@
+
diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/b.c b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/b.c
new file mode 100644
index 0000000..a95651b
--- /dev/null
+++ b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/b.c
@@ -0,0 +1,14 @@
+#if defined _WIN32 || defined __CYGWIN__
+ #define DLL_PUBLIC __declspec(dllexport)
+#else
+ #if defined __GNUC__
+ #define DLL_PUBLIC __attribute__ ((visibility("default")))
+ #else
+ #pragma message ("Compiler does not support symbol visibility.")
+ #define DLL_PUBLIC
+ #endif
+#endif
+
+int DLL_PUBLIC func2() {
+ return 42;
+}
diff --git a/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/meson.build b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/meson.build
new file mode 100644
index 0000000..ea4cc9b
--- /dev/null
+++ b/test cases/common/177 subproject nested subproject dirs/contrib/subprojects/beta/meson.build
@@ -0,0 +1,3 @@
+project('beta project', 'c')
+
+lb = shared_library('b', 'b.c')
diff --git a/test cases/common/177 subproject nested subproject dirs/meson.build b/test cases/common/177 subproject nested subproject dirs/meson.build
new file mode 100644
index 0000000..a4d0a97
--- /dev/null
+++ b/test cases/common/177 subproject nested subproject dirs/meson.build
@@ -0,0 +1,7 @@
+project('gamma project', 'c', subproject_dir: 'contrib/subprojects')
+
+a = subproject('alpha')
+lib = a.get_variable('l')
+
+exe = executable('prog', 'prog.c', link_with : lib)
+test('basic', exe)
diff --git a/test cases/common/177 subproject nested subproject dirs/prog.c b/test cases/common/177 subproject nested subproject dirs/prog.c
new file mode 100644
index 0000000..394f139
--- /dev/null
+++ b/test cases/common/177 subproject nested subproject dirs/prog.c
@@ -0,0 +1,5 @@
+int func();
+
+int main(int argc, char **argv) {
+ return func() == 42 ? 0 : 1;
+}