✅ Unity test set up
This commit is contained in:
parent
2b0014be11
commit
8e6f89cb2d
7 changed files with 193 additions and 11 deletions
|
|
@ -8,7 +8,7 @@ find_package(X11 REQUIRED)
|
|||
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -pg")
|
||||
|
||||
add_executable(aswm
|
||||
add_library(libaswm
|
||||
src/aswm/aswm.c
|
||||
src/aswm/mapper/mapper.c
|
||||
src/aswm/event_handlers/create.c
|
||||
|
|
@ -21,5 +21,25 @@ add_executable(aswm
|
|||
src/aswm/event_handlers/message.c
|
||||
src/aswm/log/log.c
|
||||
)
|
||||
target_include_directories(aswm PUBLIC ${X11_INCLUDE_DIR} src)
|
||||
target_link_libraries(aswm ${X11_LIBRARIES})
|
||||
target_include_directories(libaswm PUBLIC ${X11_INCLUDE_DIR} src)
|
||||
target_link_libraries(libaswm ${X11_LIBRARIES})
|
||||
|
||||
add_executable(aswm src/aswm/main.c)
|
||||
target_link_libraries(aswm libaswm)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
unity
|
||||
GIT_REPOSITORY https://github.com/ThrowTheSwitch/Unity.git
|
||||
GIT_TAG v2.6.1
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(unity)
|
||||
|
||||
add_executable(test_aswm test/test_aswm.c)
|
||||
target_include_directories(test_aswm PUBLIC unity)
|
||||
target_link_libraries(test_aswm libaswm unity)
|
||||
|
||||
enable_testing()
|
||||
add_test(aswm test_aswm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue