diff --git a/test cases/d/7 multilib/app.d b/test cases/d/7 multilib/app.d new file mode 100644 index 000000000..892596ad9 --- /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/installed_files.txt b/test cases/d/7 multilib/installed_files.txt new file mode 100644 index 000000000..fc6be1675 --- /dev/null +++ b/test cases/d/7 multilib/installed_files.txt @@ -0,0 +1,7 @@ +usr/bin/app_d?exe +usr/lib/libsay1.so +usr/lib/libsay1.so.0 +usr/lib/libsay1.so.1.2.3 +usr/lib/libsay2.so +usr/lib/libsay2.so.1 +usr/lib/libsay2.so.1.2.4 diff --git a/test cases/d/7 multilib/meson.build b/test cases/d/7 multilib/meson.build new file mode 100644 index 000000000..6ebe1ca15 --- /dev/null +++ b/test cases/d/7 multilib/meson.build @@ -0,0 +1,21 @@ +project('D Multiple Versioned Shared Libraries', 'd') + +if meson.get_compiler('d').get_id() == 'gcc' + error('MESON_SKIP_TEST: GDC can not build shared libraries (2016)') +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 000000000..07127d316 --- /dev/null +++ b/test cases/d/7 multilib/say1.d @@ -0,0 +1,9 @@ + +import std.stdio; +import std.string : format; + +int sayHello1 (string str) +{ + writeln ("Hello %s from library 1.".format (str)); + return 4; +} diff --git a/test cases/d/7 multilib/say2.d b/test cases/d/7 multilib/say2.d new file mode 100644 index 000000000..f77d0d232 --- /dev/null +++ b/test cases/d/7 multilib/say2.d @@ -0,0 +1,9 @@ + +import std.stdio; +import std.string : format; + +int sayHello2 (string str) +{ + writeln ("Hello %s from library 2.".format (str)); + return 8; +}