summaryrefslogtreecommitdiffstats
path: root/test cases/d/7 multilib
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/d/7 multilib')
-rw-r--r--test cases/d/7 multilib/app.d9
-rw-r--r--test cases/d/7 multilib/meson.build24
-rw-r--r--test cases/d/7 multilib/say1.d15
-rw-r--r--test cases/d/7 multilib/say1.di1
-rw-r--r--test cases/d/7 multilib/say2.d15
-rw-r--r--test cases/d/7 multilib/say2.di1
-rw-r--r--test cases/d/7 multilib/test.json18
7 files changed, 83 insertions, 0 deletions
diff --git a/test cases/d/7 multilib/app.d b/test cases/d/7 multilib/app.d
new file mode 100644
index 0000000..892596a
--- /dev/null
+++ b/test cases/d/7 multilib/app.d
@@ -0,0 +1,9 @@
+
+import say1;
+import say2;
+
+void main ()
+{
+ assert (sayHello1 ("Dave") == 4);
+ assert (sayHello2 ("HAL 9000") == 8);
+}
diff --git a/test cases/d/7 multilib/meson.build b/test cases/d/7 multilib/meson.build
new file mode 100644
index 0000000..1879c08
--- /dev/null
+++ b/test cases/d/7 multilib/meson.build
@@ -0,0 +1,24 @@
+project('D Multiple Versioned Shared Libraries', 'd')
+
+dc = meson.get_compiler('d')
+if dc.get_id() == 'gcc'
+ if dc.version().version_compare('< 8')
+ error('MESON_SKIP_TEST: GDC < 8.0 can not build shared libraries')
+ endif
+endif
+
+ldyn1 = shared_library('say1',
+ 'say1.d',
+ install: true,
+ version : '1.2.3',
+ soversion : '0'
+)
+ldyn2 = shared_library('say2',
+ 'say2.d',
+ install: true,
+ version : '1.2.4',
+ soversion : '1'
+)
+
+ed = executable('app_d', 'app.d', link_with: [ldyn1, ldyn2], install: true)
+test('multilink_test', ed)
diff --git a/test cases/d/7 multilib/say1.d b/test cases/d/7 multilib/say1.d
new file mode 100644
index 0000000..605fd23
--- /dev/null
+++ b/test cases/d/7 multilib/say1.d
@@ -0,0 +1,15 @@
+
+import std.stdio;
+import std.string : format;
+
+export int sayHello1 (string str)
+{
+ writeln ("Hello %s from library 1.".format (str));
+ return 4;
+}
+
+version (Windows)
+{
+ import core.sys.windows.dll;
+ mixin SimpleDllMain;
+}
diff --git a/test cases/d/7 multilib/say1.di b/test cases/d/7 multilib/say1.di
new file mode 100644
index 0000000..8a9ff02
--- /dev/null
+++ b/test cases/d/7 multilib/say1.di
@@ -0,0 +1 @@
+int sayHello1 (string str);
diff --git a/test cases/d/7 multilib/say2.d b/test cases/d/7 multilib/say2.d
new file mode 100644
index 0000000..7270ebd
--- /dev/null
+++ b/test cases/d/7 multilib/say2.d
@@ -0,0 +1,15 @@
+
+import std.stdio;
+import std.string : format;
+
+export int sayHello2 (string str)
+{
+ writeln ("Hello %s from library 2.".format (str));
+ return 8;
+}
+
+version (Windows)
+{
+ import core.sys.windows.dll;
+ mixin SimpleDllMain;
+}
diff --git a/test cases/d/7 multilib/say2.di b/test cases/d/7 multilib/say2.di
new file mode 100644
index 0000000..da712f0
--- /dev/null
+++ b/test cases/d/7 multilib/say2.di
@@ -0,0 +1 @@
+int sayHello2 (string str);
diff --git a/test cases/d/7 multilib/test.json b/test cases/d/7 multilib/test.json
new file mode 100644
index 0000000..5944ae0
--- /dev/null
+++ b/test cases/d/7 multilib/test.json
@@ -0,0 +1,18 @@
+{
+ "installed": [
+ {"type": "exe", "file": "usr/bin/app_d"},
+ {"type": "pdb", "file": "usr/bin/app_d", "language": "d"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say1"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say1", "version": "0"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say1", "version": "1.2.3"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say2"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say2", "version": "1"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/say2", "version": "1.2.4"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/say1", "version": "0"},
+ {"type": "pdb", "file": "usr/bin/say1", "version": "0", "language": "d"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/say2", "version": "1"},
+ {"type": "pdb", "file": "usr/bin/say2", "version": "1", "language": "d"},
+ {"type": "implib", "file": "usr/lib/say1"},
+ {"type": "implib", "file": "usr/lib/say2"}
+ ]
+}