Compare commits

...
2 Commits
Author SHA1 Message Date
zheiling 7711749d03 adds cmocka submodule 2026-07-29 19:06:59 +03:00
zheiling 5b42ea6a73 activates CTest and adds Cmocka as a dependency 2026-07-29 18:46:27 +03:00
5 changed files with 20 additions and 13 deletions
+6
View File
@@ -0,0 +1,6 @@
# [submodule "external/Unity"]
# path = external/Unity
# url = https://github.com/ThrowTheSwitch/Unity.git
[submodule "external/cmocka"]
path = external/cmocka
url = https://git.cryptomilk.org/projects/cmocka.git
+6
View File
@@ -27,6 +27,12 @@ add_subdirectory(src/core)
add_subdirectory(src)
# Testing
include(CTest)
include(cmake/OptionsCMocka.cmake)
add_subdirectory(external/cmocka)
add_subdirectory(test)
install(
TARGETS zbbs-client-tui
)
+7
View File
@@ -0,0 +1,7 @@
# Disable things we don't need from CMocka
set(WITH_EXAMPLES OFF CACHE BOOL "Build examples" FORCE)
set(UNIT_TESTING OFF CACHE BOOL "Build CMocka's own tests" FORCE)
set(WITH_CMOCKERY_SUPPORT OFF CACHE BOOL "" FORCE)
# Force static library (easier for most projects)
set(WITH_STATIC_LIB ON CACHE BOOL "Build static library" FORCE)
Vendored Submodule
+1
Submodule external/cmocka added at 7f736f65dc
-13
View File
@@ -1,13 +0,0 @@
project("My Awesome Tested Project" C)
cmake_minimum_required(VERSION 3.0) # Let's tell it a bit about our environment
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) # We declare a variable to select what to build
set (TARGET_GROUP production CACHE STRING "What Should I Build?") # Modules that exist in both our release and our unit tests, are added now
add_subdirectory(src) if(TARGET_GROUP STREQUAL release) # If we had any files that ONLY were compiled into our release, for example startup code,
# it's really handy to put it here.
elseif(TARGET_GROUP STREQUAL test) # Our tests need to let CTest know we're running tests
include(CTest) # It also needs to understand we have code in source and test directories
add_subdirectory(unity)
add_subdirectory(test)
else()
message(FATAL_ERROR "I don't know the TARGET_GROUP you gave me!")
endif()