summaryrefslogtreecommitdiffstats
path: root/test cases/d/4 library versions
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/d/4 library versions')
-rw-r--r--test cases/d/4 library versions/lib.d16
-rw-r--r--test cases/d/4 library versions/meson.build25
-rw-r--r--test cases/d/4 library versions/test.json25
3 files changed, 66 insertions, 0 deletions
diff --git a/test cases/d/4 library versions/lib.d b/test cases/d/4 library versions/lib.d
new file mode 100644
index 0000000..f1e177d
--- /dev/null
+++ b/test cases/d/4 library versions/lib.d
@@ -0,0 +1,16 @@
+
+import std.stdio;
+import std.string : format;
+
+@safe
+export int printLibraryString (string str)
+{
+ writeln ("Library says: %s".format (str));
+ return 4;
+}
+
+version (Windows)
+{
+ import core.sys.windows.dll;
+ mixin SimpleDllMain;
+}
diff --git a/test cases/d/4 library versions/meson.build b/test cases/d/4 library versions/meson.build
new file mode 100644
index 0000000..c745b92
--- /dev/null
+++ b/test cases/d/4 library versions/meson.build
@@ -0,0 +1,25 @@
+project('D library versions', '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
+
+shared_library('some', 'lib.d',
+ version : '1.2.3',
+ soversion : '0',
+ install : true)
+
+shared_library('noversion', 'lib.d',
+ install : true)
+
+shared_library('onlyversion', 'lib.d',
+ version : '1.4.5',
+ install : true)
+
+shared_library('onlysoversion', 'lib.d',
+ # Also test that int soversion is acceptable
+ soversion : 5,
+ install : true)
diff --git a/test cases/d/4 library versions/test.json b/test cases/d/4 library versions/test.json
new file mode 100644
index 0000000..23c95dd
--- /dev/null
+++ b/test cases/d/4 library versions/test.json
@@ -0,0 +1,25 @@
+{
+ "installed": [
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/some"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/some", "version": "0"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/some", "version": "1.2.3"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/noversion"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlyversion"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlyversion", "version": "1"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlyversion", "version": "1.4.5"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlysoversion"},
+ {"type": "shared_lib", "platform": "gcc", "file": "usr/lib/onlysoversion", "version": "5"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/noversion"},
+ {"type": "pdb", "file": "usr/bin/noversion", "language": "d"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/onlysoversion", "version": "5"},
+ {"type": "pdb", "file": "usr/bin/onlysoversion", "version": "5", "language": "d"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/onlyversion", "version": "1"},
+ {"type": "pdb", "file": "usr/bin/onlyversion", "version": "1", "language": "d"},
+ {"type": "shared_lib", "platform": "msvc", "file": "usr/bin/some", "version": "0"},
+ {"type": "pdb", "file": "usr/bin/some", "version": "0", "language": "d"},
+ {"type": "implib", "file": "usr/lib/noversion"},
+ {"type": "implib", "file": "usr/lib/onlysoversion"},
+ {"type": "implib", "file": "usr/lib/onlyversion"},
+ {"type": "implib", "file": "usr/lib/some"}
+ ]
+}