Skip to content

Commit

Permalink
select proper path in test
Browse files Browse the repository at this point in the history
  • Loading branch information
jingkaimori committed Apr 14, 2024
1 parent bc6d970 commit 11a45be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 10 additions & 4 deletions tests/lolly/system/shared_lib_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ using lolly::system::shared_lib;

TEST_CASE ("check_output") {
#ifndef OS_WASM
shared_lib lib = load_shared_library ("example_dynamic_library",
url_pwd () * "example_dynamic_library");
double (*func) (int)= lib->get_function<double, int> ("pow_div_2");
double res = func (5);
url lib_path;
if (os_win ()) {
lib_path= url_pwd () * "example_dynamic_library.dll";
}
else {
lib_path= url_pwd () * "libexample_dynamic_library.so";
}
shared_lib lib= load_shared_library ("example_dynamic_library", lib_path);
double (*func) (int)= lib->get_function<double, int> ("pow_div_2");
double res = func (5);
CHECK_EQ (res, 12.5);
#endif
}
1 change: 0 additions & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ end
if has_config("enable_tests") then
target("example_dynamic_library") do
set_kind ("shared")
set_prefixname("")
set_languages("c++17")
set_default (false)
add_files("tests/lolly/system/example_dynamic_library.cpp")
Expand Down

0 comments on commit 11a45be

Please sign in to comment.