Skip to content

Commit

Permalink
tests: Plugins are not supported on Windows, yet
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jktjkt authored and michalvasko committed Dec 16, 2021
1 parent 34bb928 commit 323c312
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions tests/utests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 323c312

Please sign in to comment.