activates CTest and adds Cmocka as a dependency
This commit is contained in:
@@ -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
|
||||||
@@ -27,6 +27,16 @@ add_subdirectory(src/core)
|
|||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
# Testing
|
||||||
|
include(CTest)
|
||||||
|
include(cmake/OptionsCMocka.cmake)
|
||||||
|
add_subdirectory(external/cmocka)
|
||||||
|
add_subdirectory(test)
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS zbbs-server
|
||||||
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS zbbs-client-tui
|
TARGETS zbbs-client-tui
|
||||||
)
|
)
|
||||||
@@ -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)
|
||||||
@@ -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()
|
|
||||||
Reference in New Issue
Block a user