From af17ead850f90cf6e4476aa74975e68d7293fb27 Mon Sep 17 00:00:00 2001 From: Anastasis Grammenos Date: Sun, 16 Sep 2018 15:27:31 +0300 Subject: Add unit test infrastructure --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d1b628..008a402 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,11 +25,12 @@ endif(CK_ASAN) set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) set(RES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/res) set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests) +set(UNIT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/unit) # Set source code locations set(ckBin_src ${SRC_DIR}/ck.c) +set(ckUnitTest_src ${UNIT_TEST_DIR}/ck-test.c) set(ckLib_src - ${SRC_DIR}/ck.c ${SRC_DIR}/actionparser.c ${SRC_DIR}/actions.c ${SRC_DIR}/actionhelper.c @@ -69,8 +70,12 @@ add_library (ckLib SHARED # Link add_executable(ck ${ckBin_src}) -target_link_libraries (ck ckLib) -target_link_libraries (ck ${SQLITE3_LIBRARIES}) +target_link_libraries(ck ckLib) +target_link_libraries(ck ${SQLITE3_LIBRARIES}) +## unit test +add_executable(ck-test ${ckUnitTest_src}) +target_link_libraries(ck-test ckLib) +target_link_libraries(ck-test ${SQLITE3_LIBRARIES}) # copy test files set(BIN_TESTS_DIR ${CMAKE_BINARY_DIR}/res/tests) -- cgit v1.2.3