diff --git a/.gitmodules b/.gitmodules index 739b71511e944658390550d4546a869d1917cfad..3a5e93f1aa7bbde7ae2548144b50e2e66082a1d9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "libdap-server-core"] path = libdap-server-core url = https://github.com/kelvinblockchain/libdap-server-core.git +[submodule "test/libdap-test"] + path = test/libdap-test + url = https://github.com/kelvinblockchain/libdap-test.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 3556eef51873c3a1d9db7017cfdcc6e90293cdd7..a026a448593bf2f3db17da495b4686b69a6a6b32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,11 @@ project (dap_udp_server C) add_subdirectory(libdap-server-core) +if(BUILD_DAP_UDP_SERVER_TESTS) + enable_testing() + add_subdirectory(test) +endif() + set(DAP_UDP_SERVER_SRCS dap_udp_server.c dap_udp_client.h dap_udp_client.c) add_library(${PROJECT_NAME} STATIC ${DAP_UDP_SERVER_SRCS}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..ef2ee706391edcc0ebdb7818324fb8e8de302679 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.0) +project(udp-server-test) + +set(CMAKE_C_STANDARD 11) + +add_subdirectory(libdap-test) + +file(GLOB SRC *.h *.c) + +add_executable(${PROJECT_NAME} ${SRC}) + +target_link_libraries(${PROJECT_NAME} dap_test) + +add_test( + NAME udp-server-test + COMMAND udp-server-test +) + diff --git a/test/libdap-test b/test/libdap-test new file mode 160000 index 0000000000000000000000000000000000000000..e542fdbcbced6ce9b1c4cae4a92fa8580403941e --- /dev/null +++ b/test/libdap-test @@ -0,0 +1 @@ +Subproject commit e542fdbcbced6ce9b1c4cae4a92fa8580403941e diff --git a/test/main.c b/test/main.c new file mode 100644 index 0000000000000000000000000000000000000000..e02c1ef950a56e4077faed96e1ee2f6c5cfe8a3f --- /dev/null +++ b/test/main.c @@ -0,0 +1,5 @@ +#include <stdio.h> +int main() +{ + return 0; +}