added testing, set c++11 standard
This commit is contained in:
@@ -24,6 +24,7 @@ if(NOT REVISION)
|
||||
endif(NOT REVISION)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_INSTALL_PREFIX "/")
|
||||
include(GNUInstallDirs)
|
||||
include(CheckFunctionExists)
|
||||
@@ -102,6 +103,10 @@ add_definitions(-DHAVE_CONFIG_H -DSYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}"
|
||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(BUILD_TESTING)
|
||||
enable_testing()
|
||||
endif(BUILD_TESTING)
|
||||
|
||||
add_subdirectory(src/ebusd)
|
||||
add_subdirectory(src/lib/utils)
|
||||
add_subdirectory(src/lib/ebus)
|
||||
|
||||
@@ -21,3 +21,7 @@ if(HAVE_CONTRIB)
|
||||
endif(HAVE_CONTRIB)
|
||||
|
||||
add_library(ebus ${libebus_a_SOURCES})
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif(BUILD_TESTING)
|
||||
|
||||
@@ -10,3 +10,7 @@ set(libebuscontrib_a_SOURCES
|
||||
include_directories(..)
|
||||
|
||||
add_library(ebuscontrib ${libebuscontrib_a_SOURCES})
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif(BUILD_TESTING)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
include_directories(..)
|
||||
include_directories(../..)
|
||||
include_directories(../../../utils)
|
||||
|
||||
add_executable(test_tem test_tem.cpp)
|
||||
target_link_libraries(test_tem ebus ebuscontrib)
|
||||
add_test(tem test_tem)
|
||||
@@ -0,0 +1,26 @@
|
||||
if(HAVE_CONTRIB)
|
||||
set(test_LIBS ${test_LIBS} ebuscontrib)
|
||||
endif(HAVE_CONTRIB)
|
||||
|
||||
include_directories(..)
|
||||
include_directories(../../utils)
|
||||
|
||||
add_executable(test_filereader test_filereader.cpp)
|
||||
target_link_libraries(test_filereader ebus)
|
||||
add_test(filereader test_filereader)
|
||||
|
||||
add_executable(test_device test_device.cpp)
|
||||
target_link_libraries(test_device ebus ${test_LIBS})
|
||||
add_test(device test_device)
|
||||
|
||||
add_executable(test_symbol test_symbol.cpp)
|
||||
target_link_libraries(test_symbol ebus)
|
||||
add_test(symbol test_symbol)
|
||||
|
||||
add_executable(test_data test_data.cpp)
|
||||
target_link_libraries(test_data ebus ${test_LIBS})
|
||||
add_test(data test_data)
|
||||
|
||||
add_executable(test_message test_message.cpp)
|
||||
target_link_libraries(test_message ebus ${test_LIBS})
|
||||
add_test(message test_message)
|
||||
Reference in New Issue
Block a user