aboutsummaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
blob: 717e065f2a061f5b7dc3c72cff96ccae42153c15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
enable_testing()

# NOTE: This requires us to rebuild the cmake project since
# test file will not be automatically added or removed.
file(GLOB_RECURSE C_SRC_FILES "${CMAKE_SOURCE_DIR}/src/*.c")  

set(TEST_SOURCES
  ${C_SRC_FILES}
  ${CMAKE_SOURCE_DIR}/external/Unity/src/unity.c
  ${CMAKE_SOURCE_DIR}/external/Unity/extras/fixture/src/unity_fixture.c  
  main.c)

add_executable(${PROJECT_NAME}_test ${TEST_SOURCES})
target_include_directories(${PROJECT_NAME}_test PRIVATE
  ${CMAKE_SOURCE_DIR}/test
  ${CMAKE_SOURCE_DIR}/src
  ${CMAKE_SOURCE_DIR}/src/private
  ${CMAKE_SOURCE_DIR}/external/Unity/src
)

add_test(NAME UnitTests COMMAND ${PROJECT_NAME}_test)