Add tests.

This commit is contained in:
Victor Zverovich
2014-05-15 07:45:44 -07:00
parent e1ba41f0ce
commit d758dbb33a
5 changed files with 134 additions and 5 deletions
+10 -2
View File
@@ -82,8 +82,8 @@ enable_testing()
include_directories(.)
add_library(test-main
test/test-main.cc test/gtest-extra.cc test/gtest-extra.h)
set(TEST_MAIN_SRC test/test-main.cc test/gtest-extra.cc test/gtest-extra.h)
add_library(test-main ${TEST_MAIN_SRC})
target_link_libraries(test-main gtest format)
cxx_test(gtest-extra-test test-main)
@@ -96,6 +96,14 @@ if (HAVE_STD_CPP11_FLAG)
set_target_properties(format-test PROPERTIES COMPILE_FLAGS "-std=c++11")
endif ()
if (HAVE_OPEN)
add_executable(posix-test test/posix-test.cc ${TEST_MAIN_SRC})
set_target_properties(posix-test
PROPERTIES COMPILE_DEFINITIONS "FMT_INCLUDE_POSIX_TEST=1")
target_link_libraries(posix-test gtest format)
add_test(posix-test posix-test)
endif ()
add_test(compile-test ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMAKE_CURRENT_SOURCE_DIR}/test"