Added some tests for sharedlibrary

This commit is contained in:
Pijus Kamandulis
2024-12-19 23:21:45 +02:00
parent be7a615931
commit 363f822e5a
11 changed files with 276 additions and 24 deletions

View File

@@ -0,0 +1,30 @@
#include "shared.h"
void test_CreateServerInstance();
void test_StopServerInstance();
void test_ServerInstanceStateMethods();
int main(int argc, char *argv[])
{
if (argc < 2)
{
fprintf(stderr, "Usage: %s <path_to_shared_library>\n", argv[0]);
return EXIT_FAILURE;
}
const char *libPath = argv[1];
handle = dlopen(libPath, RTLD_LAZY);
if (!handle)
{
fprintf(stderr, "Failed to load shared library: %s\n", dlerror());
return EXIT_FAILURE;
}
printf("Running tests for library: %s\n", libPath);
test_CreateServerInstance();
test_ServerInstanceStateMethods();
test_StopServerInstance();
dlclose(handle);
return EXIT_SUCCESS;
}