d: Add testcase for linking multiple versioned shared libraries

pull/1628/head
Matthias Klumpp 8 years ago
parent 52a56d441a
commit e23c987ad2
  1. 9
      test cases/d/7 multilib/app.d
  2. 7
      test cases/d/7 multilib/installed_files.txt
  3. 21
      test cases/d/7 multilib/meson.build
  4. 9
      test cases/d/7 multilib/say1.d
  5. 9
      test cases/d/7 multilib/say2.d

@ -0,0 +1,9 @@
import say1;
import say2;
void main ()
{
assert (sayHello1 ("Dave") == 4);
assert (sayHello2 ("HAL 9000") == 8);
}

@ -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

@ -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)

@ -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;
}

@ -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;
}
Loading…
Cancel
Save