1
0

Added Testing capability

This commit is contained in:
Tycho 2014-04-27 12:25:03 -07:00
parent 6f1fea759e
commit 1d3ad6faa2
5 changed files with 30 additions and 2 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.6)
cmake_minimum_required (VERSION 2.8.2)
# Without this, the MSVC variable isn't defined for MSVC builds ( http://www.cmake.org/pipermail/cmake/2011-November/047130.html )
enable_language(CXX C)
@ -69,3 +69,8 @@ set_exe_flags()
add_subdirectory (src)
if(${SELF_TEST})
enable_testing()
add_subdirectory (tests)
endif()

View File

@ -1,5 +1,9 @@
if(NOT TARGET polarssl)
message("including polarssl")
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl EXCLUDE_FROM_ALL )
if (SELF_TEST)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl)
else()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl EXCLUDE_FROM_ALL)
endif()
endif()

5
tests/CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
cmake_minimum_required (VERSION 2.6)
enable_testing()
add_subdirectory(ChunkBuffer)

View File

@ -0,0 +1,10 @@
cmake_minimum_required (VERSION 2.6)
enable_testing()
add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkBuffer.cpp)
add_executable(creatable-exe creatable.cpp)
target_link_libraries(creatable-exe ChunkBuffer)
add_test(NAME creatable-test COMMAND creatable-exe)

View File

@ -0,0 +1,4 @@
int main(int argc, char** argv)
{
return 0;
}