19 lines
361 B
CMake
19 lines
361 B
CMake
cmake_minimum_required(VERSION 3.18)
|
|
|
|
enable_testing()
|
|
|
|
project(HelloWorld C)
|
|
|
|
add_executable(HelloWorld main.c)
|
|
|
|
find_library(CMocka cmocka)
|
|
|
|
target_link_libraries(HelloWorld cmocka)
|
|
|
|
add_test(
|
|
NAME HelloWorldTest
|
|
COMMAND HelloWorld)
|
|
|
|
add_test(
|
|
NAME HelloWorldMemoryTest
|
|
COMMAND valgrind --error-exitcode=1 --leak-check=full $<TARGET_FILE:HelloWorld>)
|