diff options
author | Mattes D <github@xoft.cz> | 2016-01-03 16:07:53 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-03-01 16:19:57 +0100 |
commit | 1d05fc95aeb67876452c9e25d67b18fc18d1765d (patch) | |
tree | 5b76aaca50c7d6ad9c02ff3652a732e267372461 /tests/HTTP/CMakeLists.txt | |
parent | Renamed HTTPServer folder to HTTP. (diff) | |
download | cuberite-1d05fc95aeb67876452c9e25d67b18fc18d1765d.tar cuberite-1d05fc95aeb67876452c9e25d67b18fc18d1765d.tar.gz cuberite-1d05fc95aeb67876452c9e25d67b18fc18d1765d.tar.bz2 cuberite-1d05fc95aeb67876452c9e25d67b18fc18d1765d.tar.lz cuberite-1d05fc95aeb67876452c9e25d67b18fc18d1765d.tar.xz cuberite-1d05fc95aeb67876452c9e25d67b18fc18d1765d.tar.zst cuberite-1d05fc95aeb67876452c9e25d67b18fc18d1765d.zip |
Diffstat (limited to 'tests/HTTP/CMakeLists.txt')
-rw-r--r-- | tests/HTTP/CMakeLists.txt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/HTTP/CMakeLists.txt b/tests/HTTP/CMakeLists.txt new file mode 100644 index 000000000..f6989d831 --- /dev/null +++ b/tests/HTTP/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required (VERSION 2.6) + +enable_testing() + +include_directories(${CMAKE_SOURCE_DIR}/src/) +include_directories(${CMAKE_SOURCE_DIR}/lib/libevent/include) + +add_definitions(-DTEST_GLOBALS=1) + +# Create a single HTTP library that contains all the HTTP code: +set (HTTP_SRCS + ${CMAKE_SOURCE_DIR}/src/HTTP/EnvelopeParser.cpp + ${CMAKE_SOURCE_DIR}/src/HTTP/HTTPMessage.cpp + ${CMAKE_SOURCE_DIR}/src/HTTP/HTTPResponseParser.cpp + ${CMAKE_SOURCE_DIR}/src/HTTP/TransferEncodingParser.cpp + ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp +) + +set (HTTP_HDRS + ${CMAKE_SOURCE_DIR}/src/HTTP/EnvelopeParser.h + ${CMAKE_SOURCE_DIR}/src/HTTP/HTTPMessage.h + ${CMAKE_SOURCE_DIR}/src/HTTP/HTTPResponseParser.h + ${CMAKE_SOURCE_DIR}/src/HTTP/TransferEncodingParser.h + ${CMAKE_SOURCE_DIR}/src/StringUtils.h +) + +add_library(HTTP + ${HTTP_SRCS} + ${HTTP_HDRS} +) + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_flags_cxx("-Wno-error=conversion -Wno-error=old-style-cast") +endif() + + + + + +# Define individual tests: + +# HTTPResponseParser_file: Feed file contents into a cHTTPResponseParser and print the callbacks as they're called: +add_executable(HTTPResponseParser_file-exe HTTPResponseParser_file.cpp) +target_link_libraries(HTTPResponseParser_file-exe HTTP) +add_test(NAME HTTPResponseParser_file-test1 COMMAND HTTPResponseParser_file-exe HTTPResponse1.data) +add_test(NAME HTTPResponseParser_file-test2 COMMAND HTTPResponseParser_file-exe HTTPResponse2.data) |