Rename test to autotest

This commit is contained in:
Chunting Gu
2019-04-17 17:05:29 +08:00
parent de4574a437
commit ba9f6c4c23
5 changed files with 15 additions and 8 deletions
+28
View File
@@ -0,0 +1,28 @@
# Auto test
set(AT_SRCS
test_http_client.cc
)
set(AT_TARGET_NAME webcc_autotest)
# Common libraries to link.
set(TEST_LIBS webcc ${Boost_LIBRARIES} "${CMAKE_THREAD_LIBS_INIT}")
if(WEBCC_ENABLE_SSL)
set(TEST_LIBS ${TEST_LIBS} ${OPENSSL_LIBRARIES})
endif()
if(WIN32)
set(TEST_LIBS ${TEST_LIBS} zlibstatic crypt32)
else()
set(TEST_LIBS ${TEST_LIBS} ${ZLIB_LIBRARIES})
endif()
if(UNIX)
# Add `-ldl` for Linux to avoid "undefined reference to `dlopen'".
set(TEST_LIBS ${TEST_LIBS} ${CMAKE_DL_LIBS})
endif()
add_executable(${AT_TARGET_NAME} ${AT_SRCS})
target_link_libraries(${AT_TARGET_NAME} webcc gtest ${TEST_LIBS})