Skip to content

Commit

Permalink
openssl: enhance test
Browse files Browse the repository at this point in the history
  • Loading branch information
Doekin committed Dec 27, 2024
1 parent b8de188 commit 4a58502
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion packages/o/openssl/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,27 @@ package("openssl")
end
end)
on_test(function (package)
assert(package:has_cfuncs("SSL_new", {includes = "openssl/ssl.h"}))
assert(package:check_csnippets({test = [[
#include <openssl/ssl.h>
int test(){
SSL_library_init();
SSL_load_error_strings();
SSL_CTX *ctx = SSL_CTX_new(SSLv23_client_method());
if(ctx == NULL){
return 1;
}
SSL *ssl = SSL_new(ctx);
if(ssl == NULL){
SSL_CTX_free(ctx);
return 1;
}
SSL_free(ssl);
SSL_CTX_free(ctx);
return 0;
}
]]}))
end)

0 comments on commit 4a58502

Please sign in to comment.