Commit bff9625e authored by Andriy Senkovych's avatar Andriy Senkovych

Add travis tests to be run from CTest

parent 40648f16
...@@ -9,6 +9,8 @@ target_link_libraries(perftest ${TEST_LIBRARIES}) ...@@ -9,6 +9,8 @@ target_link_libraries(perftest ${TEST_LIBRARIES})
add_dependencies(tests perftest) add_dependencies(tests perftest)
IF(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug"))
add_test(NAME perftest add_test(NAME perftest
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/perftest COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/perftest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
ENDIF()
...@@ -4,18 +4,29 @@ set(UNITTEST_SOURCES ...@@ -4,18 +4,29 @@ set(UNITTEST_SOURCES
encodingstest.cpp encodingstest.cpp
filestreamtest.cpp filestreamtest.cpp
jsoncheckertest.cpp jsoncheckertest.cpp
namespacetest.cpp
readertest.cpp readertest.cpp
unittest.cpp unittest.cpp
unittest.h unittest.h
valuetest.cpp valuetest.cpp
writertest.cpp) writertest.cpp)
add_library(namespacetest STATIC namespacetest.cpp)
add_executable(unittest ${UNITTEST_SOURCES}) add_executable(unittest ${UNITTEST_SOURCES})
target_link_libraries(unittest ${TEST_LIBRARIES}) target_link_libraries(unittest ${TEST_LIBRARIES} namespacetest)
add_dependencies(tests unittest) add_dependencies(tests unittest)
add_test(NAME unittest add_test(NAME unittest
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
add_test(NAME valgrind_unittest
COMMAND valgrind --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
IF((NOT MSVC) AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
add_test(NAME symbol_check
COMMAND sh -c "objdump -t -C libnamespacetest.a | grep rapidjson ; test $? -ne 0"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
ENDIF()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment