From 423d5ee7bbf65a3b1be2237dc04b8575f05b0247 Mon Sep 17 00:00:00 2001 From: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> Date: Fri, 18 Aug 2023 14:43:26 +0200 Subject: [PATCH] Fix DynamicLibrary::Load unit test under Cygwin While running the test_base on CYGWIN, this message will be printed on the console: ------------------------------------------------------------------------------- DynamicLibrary::Load ------------------------------------------------------------------------------- /cygdrive/c/Users/carlo/Documents/GitHub/wxWidgets/tests/misc/dynamiclib.cpp:26 ............................................................................... /cygdrive/c/Users/carlo/Documents/GitHub/wxWidgets/tests/misc/dynamiclib.cpp:80: warning: Couldn't find libc.so, skipping DynamicLibrary::Load() test. /cygdrive/c/Users/carlo/Documents/GitHub/wxWidgets/tests/misc/dynamiclib.cpp:84: warning: Possible candidates: /lib/libc.a /usr/lib/libc.a CYGWIN uses NEWLIB as C library and it is compiled into cygwin1.dll. This patch adds the right test case for CYGWIN, for letting the execution of the test. See #23781. (cherry picked from commit 1bc8631b527603c855d65a9ede45fa3d6e672ea8) --- tests/misc/dynamiclib.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/misc/dynamiclib.cpp b/tests/misc/dynamiclib.cpp index 020eb5b38a..615b703bfa 100644 --- a/tests/misc/dynamiclib.cpp +++ b/tests/misc/dynamiclib.cpp @@ -28,6 +28,9 @@ TEST_CASE("DynamicLibrary::Load", "[dynlib]") #if defined(__WINDOWS__) static const char* const LIB_NAME = "kernel32.dll"; static const char* const FUNC_NAME = "lstrlenA"; +#elif defined(__CYGWIN__) + static const char* const LIB_NAME = "cygwin1.dll"; + static const char* const FUNC_NAME = "strlen"; #elif defined(__DARWIN__) // Under macOS 12+ we can actually load the libc dylib even though the // corresponding file doesn't exist on disk, so we have to handle it