2016-10-24 19:47:00 -04:00
|
|
|
#
|
|
|
|
# Based on https://github.com/modern-cpp-examples/match3/blob/master/test/CMakeLists.txt
|
|
|
|
#
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -include common/test.hpp")
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2016-11-20 17:04:31 -05:00
|
|
|
include_directories(
|
|
|
|
${APP_INCLUDE_DIRS}
|
|
|
|
${PROJECT_SOURCE_DIR}/src
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
link_libraries(${APP_LIBRARIES})
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2016-10-24 19:47:00 -04:00
|
|
|
function(unit_test file)
|
|
|
|
string(REPLACE "/" "_" testname ${file})
|
2016-11-20 17:04:31 -05:00
|
|
|
add_executable(unit_test.${testname} ${CMAKE_CURRENT_LIST_DIR}/unit_tests/${file}.cpp ${SOURCE_DEPS})
|
2016-10-24 19:47:00 -04:00
|
|
|
add_test(unit_test.${testname} unit_test.${testname})
|
|
|
|
endfunction()
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2016-10-30 20:21:24 -04:00
|
|
|
unit_test("utils/color")
|
2016-10-25 01:04:14 -04:00
|
|
|
unit_test("utils/math")
|
2016-10-24 19:47:00 -04:00
|
|
|
unit_test("utils/memory")
|
|
|
|
unit_test("utils/string")
|
|
|
|
unit_test("components/command_line")
|
|
|
|
unit_test("components/di")
|
2016-11-20 17:04:31 -05:00
|
|
|
unit_test("x11/color")
|
2016-11-20 18:07:34 -05:00
|
|
|
|
|
|
|
# XXX: Requires mocked xcb connection
|
|
|
|
#unit_test("x11/connection")
|
|
|
|
#unit_test("x11/winspec")
|