diff options
Diffstat (limited to 'test cases')
22 files changed, 83 insertions, 19 deletions
diff --git a/test cases/d/2 library/installed_files.txt b/test cases/d/2 library/installed_files.txt deleted file mode 100644 index f062075..0000000 --- a/test cases/d/2 library/installed_files.txt +++ /dev/null @@ -1,4 +0,0 @@ -usr/bin/app_d?exe -?usr/lib/libstuff.so -usr/bin/app_s?exe -usr/lib/libstuff.a diff --git a/test cases/d/2 library/meson.build b/test cases/d/2 library/meson.build deleted file mode 100644 index 811131c..0000000 --- a/test cases/d/2 library/meson.build +++ /dev/null @@ -1,14 +0,0 @@ -project('D Library', 'd') - -if meson.get_compiler('d').get_id() != 'gcc' - ldyn = shared_library('stuff', 'libstuff.d', install : true) - ed = executable('app_d', 'app.d', link_with : ldyn, install : true) - test('linktest_dyn', ed) - -else - message('GDC can not build shared libraries. Build skipped.') -endif - -lstatic = static_library('stuff', 'libstuff.d', install : true) -es = executable('app_s', 'app.d', link_with : lstatic, install : true) -test('linktest_static', es) diff --git a/test cases/d/2 library/app.d b/test cases/d/2 static library/app.d index 5d84a69..5d84a69 100644 --- a/test cases/d/2 library/app.d +++ b/test cases/d/2 static library/app.d diff --git a/test cases/d/2 static library/installed_files.txt b/test cases/d/2 static library/installed_files.txt new file mode 100644 index 0000000..0f2bab4 --- /dev/null +++ b/test cases/d/2 static library/installed_files.txt @@ -0,0 +1,2 @@ +usr/bin/app_s?exe +usr/lib/libstuff.a diff --git a/test cases/d/2 static library/libstuff.d b/test cases/d/2 static library/libstuff.d new file mode 100644 index 0000000..fd3b4d0 --- /dev/null +++ b/test cases/d/2 static library/libstuff.d @@ -0,0 +1,9 @@ + +import std.stdio; +import std.string : format; + +int printLibraryString (string str) +{ + writeln ("Static Library says: %s".format (str)); + return 4; +} diff --git a/test cases/d/2 static library/meson.build b/test cases/d/2 static library/meson.build new file mode 100644 index 0000000..88ed2cb --- /dev/null +++ b/test cases/d/2 static library/meson.build @@ -0,0 +1,5 @@ +project('D Static Library', 'd') + +lstatic = static_library('stuff', 'libstuff.d', install : true) +es = executable('app_s', 'app.d', link_with : lstatic, install : true) +test('linktest_static', es) diff --git a/test cases/d/3 shared library/app.d b/test cases/d/3 shared library/app.d new file mode 100644 index 0000000..5d84a69 --- /dev/null +++ b/test cases/d/3 shared library/app.d @@ -0,0 +1,8 @@ + +import libstuff; + +void main () +{ + immutable ret = printLibraryString ("foo"); + assert (ret == 4); +} diff --git a/test cases/d/3 shared library/installed_files.txt b/test cases/d/3 shared library/installed_files.txt new file mode 100644 index 0000000..d6a4dad --- /dev/null +++ b/test cases/d/3 shared library/installed_files.txt @@ -0,0 +1,2 @@ +usr/bin/app_d?exe +usr/lib/libstuff.so diff --git a/test cases/d/2 library/libstuff.d b/test cases/d/3 shared library/libstuff.d index 676a643..676a643 100644 --- a/test cases/d/2 library/libstuff.d +++ b/test cases/d/3 shared library/libstuff.d diff --git a/test cases/d/3 shared library/meson.build b/test cases/d/3 shared library/meson.build new file mode 100644 index 0000000..5dae66b --- /dev/null +++ b/test cases/d/3 shared library/meson.build @@ -0,0 +1,12 @@ +project('D Shared Library', 'd') + +if meson.get_compiler('d').get_id() != 'gcc' + + ldyn = shared_library('stuff', 'libstuff.d', install : true) + ed = executable('app_d', 'app.d', link_with : ldyn, install : true) + test('linktest_dyn', ed) + +else + message('GDC can not build shared libraries. Test skipped.') + install_data('no-installed-files', install_dir : '') +endif diff --git a/test cases/d/3 shared library/no-installed-files b/test cases/d/3 shared library/no-installed-files new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test cases/d/3 shared library/no-installed-files diff --git a/test cases/d/4 library versions/installed_files.txt b/test cases/d/4 library versions/installed_files.txt new file mode 100644 index 0000000..b997e53 --- /dev/null +++ b/test cases/d/4 library versions/installed_files.txt @@ -0,0 +1,9 @@ +usr/lib/libsome.so +usr/lib/libsome.so.0 +usr/lib/libsome.so.1.2.3 +usr/lib/libnoversion.so +usr/lib/libonlyversion.so +usr/lib/libonlyversion.so.1 +usr/lib/libonlyversion.so.1.4.5 +usr/lib/libonlysoversion.so +usr/lib/libonlysoversion.so.5 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..94df91e --- /dev/null +++ b/test cases/d/4 library versions/lib.d @@ -0,0 +1,10 @@ + +import std.stdio; +import std.string : format; + +@safe +int printLibraryString (string str) +{ + writeln ("Library says: %s".format (str)); + return 4; +} 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..26cc38a --- /dev/null +++ b/test cases/d/4 library versions/meson.build @@ -0,0 +1,25 @@ +project('D library versions', 'd') + +if meson.get_compiler('d').get_id() == 'gcc' + message('GDC can not build shared libraries. Test skipped.') + install_data('no-installed-files', install_dir : '') +else + + 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) + +endif diff --git a/test cases/d/4 library versions/no-installed-files b/test cases/d/4 library versions/no-installed-files new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test cases/d/4 library versions/no-installed-files diff --git a/test cases/d/3 mixed/app.d b/test cases/d/5 mixed/app.d index 6ab5d97..6ab5d97 100644 --- a/test cases/d/3 mixed/app.d +++ b/test cases/d/5 mixed/app.d diff --git a/test cases/d/3 mixed/installed_files.txt b/test cases/d/5 mixed/installed_files.txt index 9e7fccc..9e7fccc 100644 --- a/test cases/d/3 mixed/installed_files.txt +++ b/test cases/d/5 mixed/installed_files.txt diff --git a/test cases/d/3 mixed/libstuff.c b/test cases/d/5 mixed/libstuff.c index 92d6600..92d6600 100644 --- a/test cases/d/3 mixed/libstuff.c +++ b/test cases/d/5 mixed/libstuff.c diff --git a/test cases/d/3 mixed/meson.build b/test cases/d/5 mixed/meson.build index 3dad66d..3dad66d 100644 --- a/test cases/d/3 mixed/meson.build +++ b/test cases/d/5 mixed/meson.build diff --git a/test cases/d/4 unittest/app.d b/test cases/d/6 unittest/app.d index 751e754..751e754 100644 --- a/test cases/d/4 unittest/app.d +++ b/test cases/d/6 unittest/app.d diff --git a/test cases/d/4 unittest/installed_files.txt b/test cases/d/6 unittest/installed_files.txt index e718389..e718389 100644 --- a/test cases/d/4 unittest/installed_files.txt +++ b/test cases/d/6 unittest/installed_files.txt diff --git a/test cases/d/4 unittest/meson.build b/test cases/d/6 unittest/meson.build index ca39adf..1551e94 100644 --- a/test cases/d/4 unittest/meson.build +++ b/test cases/d/6 unittest/meson.build @@ -4,5 +4,5 @@ e = executable('dapp', 'app.d', install : true) test('dapp_run', e, should_fail: true) e_test = executable('dapp_test', 'app.d', - d_args: meson.get_compiler('d').get_unittest_flag()) + d_args: meson.get_compiler('d').unittest_args()) test('dapp_test', e_test) |