From 29002b24e05bd1a07eda499d47eb0cad01c211df Mon Sep 17 00:00:00 2001 From: Paul Breugnot Date: Sun, 2 Mar 2025 09:25:29 +0100 Subject: [PATCH] :art: Sets up test/CMakeLists.txt --- CMakeLists.txt | 20 ++------------------ test/CMakeLists.txt | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 2986cbd..c141a76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,12 +10,6 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -pg") include(FetchContent) -FetchContent_Declare( - unity - GIT_REPOSITORY https://github.com/ThrowTheSwitch/Unity.git - GIT_TAG v2.6.1 -) - FetchContent_Declare( zlog GIT_REPOSITORY https://github.com/HardySimpson/zlog.git @@ -28,7 +22,7 @@ FetchContent_Declare( GIT_TAG 682d4520b4bc2b646cdfcf078b2fed00b3d2da30 ) -FetchContent_MakeAvailable(unity zlog argparse) +FetchContent_MakeAvailable(zlog argparse) add_library(libaswm src/aswm/aswm.c @@ -51,14 +45,4 @@ add_executable(aswm src/aswm/main.c ${argparse_SOURCE_DIR}/argparse.c) target_include_directories(aswm PUBLIC ${argparse_SOURCE_DIR}) target_link_libraries(aswm libaswm) -add_compile_definitions(ASWM_TEST_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test/") -add_executable(test_aswm - test/test_set_up.c - test/aswm/test_aswm.c - test/aswm/test_aswm_create_windows.c -) -target_include_directories(test_aswm PUBLIC ${unity_SOURCE_DIR}/src) -target_link_libraries(test_aswm libaswm unity) - -enable_testing() -add_test(aswm test_aswm) +add_subdirectory(test) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..623afae --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,18 @@ +FetchContent_Declare( + unity + GIT_REPOSITORY https://github.com/ThrowTheSwitch/Unity.git + GIT_TAG v2.6.1 +) +FetchContent_MakeAvailable(unity) + +add_compile_definitions(ASWM_TEST_DIR="${CMAKE_CURRENT_SOURCE_DIR}") +add_executable(test_aswm + test_set_up.c + aswm/test_aswm.c + aswm/test_aswm_create_windows.c +) +target_include_directories(test_aswm PUBLIC ${unity_SOURCE_DIR}/src) +target_link_libraries(test_aswm libaswm unity) + +enable_testing() +add_test(aswm test_aswm)