From 3110c209f76b3389c34ce953ae6814ed64d7a898 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 22 Jun 2017 17:22:51 +0100 Subject: [PATCH] Consolidate windows tests which are divided between mingw and msvc --- .../installed_files.txt | 11 ---- .../7 mingw dll versioning/meson.build | 55 ------------------- .../copyfile.py | 0 .../exe.orig.c | 0 .../8 dll versioning/installed_files.txt | 24 ++++++++ .../lib.c | 0 .../meson.build | 8 +-- .../windows/8 msvc dll versioning/exe.orig.c | 9 --- .../8 msvc dll versioning/installed_files.txt | 13 ----- .../windows/8 msvc dll versioning/lib.c | 6 -- 10 files changed, 26 insertions(+), 100 deletions(-) delete mode 100644 test cases/windows/7 mingw dll versioning/installed_files.txt delete mode 100644 test cases/windows/7 mingw dll versioning/meson.build rename test cases/windows/{8 msvc dll versioning => 8 dll versioning}/copyfile.py (100%) rename test cases/windows/{7 mingw dll versioning => 8 dll versioning}/exe.orig.c (100%) create mode 100644 test cases/windows/8 dll versioning/installed_files.txt rename test cases/windows/{7 mingw dll versioning => 8 dll versioning}/lib.c (100%) rename test cases/windows/{8 msvc dll versioning => 8 dll versioning}/meson.build (88%) delete mode 100644 test cases/windows/8 msvc dll versioning/exe.orig.c delete mode 100644 test cases/windows/8 msvc dll versioning/installed_files.txt delete mode 100644 test cases/windows/8 msvc dll versioning/lib.c diff --git a/test cases/windows/7 mingw dll versioning/installed_files.txt b/test cases/windows/7 mingw dll versioning/installed_files.txt deleted file mode 100644 index 26e14a7d8..000000000 --- a/test cases/windows/7 mingw dll versioning/installed_files.txt +++ /dev/null @@ -1,11 +0,0 @@ -usr/bin/?libsome-0.dll -usr/lib/libsome.dll.a -usr/bin/?libnoversion.dll -usr/lib/libnoversion.dll.a -usr/bin/?libonlyversion-1.dll -usr/lib/libonlyversion.dll.a -usr/bin/?libonlysoversion-5.dll -usr/lib/libonlysoversion.dll.a -usr/libexec/?libcustomdir.dll -usr/libexec/libcustomdir.dll.a -usr/lib/?libmodule.dll diff --git a/test cases/windows/7 mingw dll versioning/meson.build b/test cases/windows/7 mingw dll versioning/meson.build deleted file mode 100644 index 1d6562c58..000000000 --- a/test cases/windows/7 mingw dll versioning/meson.build +++ /dev/null @@ -1,55 +0,0 @@ -project('mingw dll versioning', 'c') - -cc = meson.get_compiler('c') - -if cc.get_id() == 'msvc' - error('MESON_SKIP_TEST: test is only for MinGW') -endif - -# Test that MinGW/GCC creates correctly-named dll files and dll.a files, -# and also installs them in the right place -some = shared_library('some', 'lib.c', - version : '1.2.3', - soversion : '0', - install : true) - -noversion = shared_library('noversion', 'lib.c', - install : true) - -onlyversion = shared_library('onlyversion', 'lib.c', - version : '1.4.5', - install : true) - -onlysoversion = shared_library('onlysoversion', 'lib.c', - # Also test that int soversion is acceptable - soversion : 5, - install : true) - -# Hack to make the executables below depend on the shared libraries above -# without actually adding them as `link_with` dependencies since we want to try -# linking to them with -lfoo linker arguments. -out = custom_target('library-dependency-hack', - input : 'exe.orig.c', - output : 'exe.c', - depends : [some, noversion, onlyversion, onlysoversion], - command : ['cp', '@INPUT@', '@OUTPUT@']) - -# Manually test if the linker can find the above libraries -# i.e., whether they were generated with the right naming scheme -test('manually linked 1', executable('manuallink1', out, - link_args : ['-L.', '-lsome'])) - -test('manually linked 2', executable('manuallink2', out, - link_args : ['-L.', '-lnoversion'])) - -test('manually linked 3', executable('manuallink3', out, - link_args : ['-L.', '-lonlyversion'])) - -test('manually linked 4', executable('manuallink4', out, - link_args : ['-L.', '-lonlysoversion'])) - -shared_library('customdir', 'lib.c', - install : true, - install_dir : get_option('libexecdir')) - -shared_module('module', 'lib.c', install : true) diff --git a/test cases/windows/8 msvc dll versioning/copyfile.py b/test cases/windows/8 dll versioning/copyfile.py similarity index 100% rename from test cases/windows/8 msvc dll versioning/copyfile.py rename to test cases/windows/8 dll versioning/copyfile.py diff --git a/test cases/windows/7 mingw dll versioning/exe.orig.c b/test cases/windows/8 dll versioning/exe.orig.c similarity index 100% rename from test cases/windows/7 mingw dll versioning/exe.orig.c rename to test cases/windows/8 dll versioning/exe.orig.c diff --git a/test cases/windows/8 dll versioning/installed_files.txt b/test cases/windows/8 dll versioning/installed_files.txt new file mode 100644 index 000000000..a1e9b2d7a --- /dev/null +++ b/test cases/windows/8 dll versioning/installed_files.txt @@ -0,0 +1,24 @@ +?msvc:usr/bin/some-0.dll +?msvc:usr/bin/some-0.pdb +?msvc:usr/lib/some.lib +?msvc:usr/bin/noversion.dll +?msvc:usr/bin/noversion.pdb +?msvc:usr/lib/noversion.lib +?msvc:usr/bin/onlyversion-1.dll +?msvc:usr/lib/onlyversion.lib +?msvc:usr/bin/onlysoversion-5.dll +?msvc:usr/lib/onlysoversion.lib +?msvc:usr/libexec/customdir.dll +?msvc:usr/libexec/customdir.lib +?msvc:usr/lib/module.dll +?gcc:usr/bin/?libsome-0.dll +?gcc:usr/lib/libsome.dll.a +?gcc:usr/bin/?libnoversion.dll +?gcc:usr/lib/libnoversion.dll.a +?gcc:usr/bin/?libonlyversion-1.dll +?gcc:usr/lib/libonlyversion.dll.a +?gcc:usr/bin/?libonlysoversion-5.dll +?gcc:usr/lib/libonlysoversion.dll.a +?gcc:usr/libexec/?libcustomdir.dll +?gcc:usr/libexec/libcustomdir.dll.a +?gcc:usr/lib/?libmodule.dll diff --git a/test cases/windows/7 mingw dll versioning/lib.c b/test cases/windows/8 dll versioning/lib.c similarity index 100% rename from test cases/windows/7 mingw dll versioning/lib.c rename to test cases/windows/8 dll versioning/lib.c diff --git a/test cases/windows/8 msvc dll versioning/meson.build b/test cases/windows/8 dll versioning/meson.build similarity index 88% rename from test cases/windows/8 msvc dll versioning/meson.build rename to test cases/windows/8 dll versioning/meson.build index 407474790..80acf880a 100644 --- a/test cases/windows/8 msvc dll versioning/meson.build +++ b/test cases/windows/8 dll versioning/meson.build @@ -2,12 +2,8 @@ project('msvc dll versioning', 'c') cc = meson.get_compiler('c') -if cc.get_id() != 'msvc' - error('MESON_SKIP_TEST: test is only for msvc') -endif - -# Test that MSVC creates correctly-named dll files and .lib files, -# and also installs them in the right place +# Test that we create correctly-named dll and import lib files, +# and also install them in the right place some = shared_library('some', 'lib.c', version : '1.2.3', soversion : '0', diff --git a/test cases/windows/8 msvc dll versioning/exe.orig.c b/test cases/windows/8 msvc dll versioning/exe.orig.c deleted file mode 100644 index 86c4adc38..000000000 --- a/test cases/windows/8 msvc dll versioning/exe.orig.c +++ /dev/null @@ -1,9 +0,0 @@ -int myFunc (void); - -int -main (int argc, char *argv[]) -{ - if (myFunc() == 55) - return 0; - return 1; -} diff --git a/test cases/windows/8 msvc dll versioning/installed_files.txt b/test cases/windows/8 msvc dll versioning/installed_files.txt deleted file mode 100644 index df4334381..000000000 --- a/test cases/windows/8 msvc dll versioning/installed_files.txt +++ /dev/null @@ -1,13 +0,0 @@ -usr/bin/some-0.dll -usr/bin/some-0.pdb -usr/lib/some.lib -usr/bin/noversion.dll -usr/bin/noversion.pdb -usr/lib/noversion.lib -usr/bin/onlyversion-1.dll -usr/lib/onlyversion.lib -usr/bin/onlysoversion-5.dll -usr/lib/onlysoversion.lib -usr/libexec/customdir.dll -usr/libexec/customdir.lib -usr/lib/module.dll diff --git a/test cases/windows/8 msvc dll versioning/lib.c b/test cases/windows/8 msvc dll versioning/lib.c deleted file mode 100644 index cf7dfdd07..000000000 --- a/test cases/windows/8 msvc dll versioning/lib.c +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef _WIN32 -__declspec(dllexport) -#endif -int myFunc() { - return 55; -}