switch to cmake

This commit is contained in:
2019-08-19 21:28:04 +02:00
parent e7ca9d9036
commit 823fcecc03
5 changed files with 95 additions and 8 deletions

20
tests/CMakeLists.txt Normal file
View File

@@ -0,0 +1,20 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
SET(TESTS
"test_dice_evaluate"
"test_dice_fudge"
"test_dice_parse"
"test_dice_simple_roll"
"test_expr_parse"
)
INCLUDE_DIRECTORIES(
"${CMAKE_CURRENT_SOURCE_DIR}/../lib/"
${CMOCKA_INCLUDE_DIRS}
)
FOREACH(TEST ${TESTS})
ADD_EXECUTABLE(${TEST} ${TEST}.c)
TARGET_LINK_LIBRARIES(${TEST} dice ${CMOCKA_LIBRARIES})
ADD_TEST(NAME "${TEST}" COMMAND ${TEST})
ENDFOREACH()