From 323c31221645052e13db83f7d0e6e51c3ce9d802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Tue, 14 Dec 2021 11:44:57 +0100 Subject: [PATCH] tests: Plugins are not supported on Windows, yet For some reason the dlopen() always fails, like this: [ RUN ] test_add_simple libyang[2]: Searching for "ietf-yang-types" in "D:\a\oopt-gnpy-libyang\build\libyang\tests\utests". libyang[2]: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision. libyang[2]: Searching for "ietf-inet-types" in "D:\a\oopt-gnpy-libyang\build\libyang\tests\utests". libyang[2]: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision. libyang[0]: Loading "D:/a/oopt-gnpy-libyang/build/libyang/out-plugins/Release/plugin_simple.dll" as a plugin failed ("D:\a\oopt-gnpy-libyang\build\libyang\out-plugins\Release\plugin_simple.dll": The specified module could not be found.). [ ERROR ] --- 0x0 != 0x2 [ LINE ] --- D:\a\oopt-gnpy-libyang\oopt-gnpy-libyang\libyang\tests\utests\basic\test_plugins.c:50: error: Failure! [ FAILED ] test_add_simple Rather than trying to debug this on a platform that I don't really know, let's declare plugins as not supported on Windows. --- src/plugins.c | 5 +++++ tests/utests/CMakeLists.txt | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/plugins.c b/src/plugins.c index 43d70c63b..2ea509b25 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -494,6 +494,11 @@ lyplg_add(const char *pathname) LOGERR(NULL, LY_EINVAL, "Plugins are not supported in statically built library."); return LY_EINVAL; +#elif defined (_WIN32) + (void)pathname; + + LOGERR(NULL, LY_EINVAL, "Plugins are not (yet) supported on Windows."); + return LY_EINVAL; #else LY_ERR ret = LY_SUCCESS; diff --git a/tests/utests/CMakeLists.txt b/tests/utests/CMakeLists.txt index b2f06f4de..f67de0e34 100644 --- a/tests/utests/CMakeLists.txt +++ b/tests/utests/CMakeLists.txt @@ -46,7 +46,9 @@ ly_add_utest(NAME set SOURCES basic/test_set.c) ly_add_utest(NAME hash_table SOURCES basic/test_hash_table.c) ly_add_utest(NAME inout SOURCES basic/test_inout.c) ly_add_utest(NAME context SOURCES basic/test_context.c) +if(NOT WIN32) ly_add_utest(NAME plugins SOURCES basic/test_plugins.c) +endif() ly_add_utest(NAME xml SOURCES basic/test_xml.c) ly_add_utest(NAME json SOURCES basic/test_json.c) ly_add_utest(NAME xpath SOURCES basic/test_xpath.c)