James E. King III | 3ae3042 | 2018-03-12 07:33:22 -0400 | [diff] [blame^] | 1 | # |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
Nobuaki Sukegawa | c444fb5 | 2015-01-02 23:16:55 +0900 | [diff] [blame] | 20 | include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 21 | |
James E. King, III | 7edc8fa | 2017-01-20 10:11:41 -0500 | [diff] [blame] | 22 | if (WITH_DYN_LINK_TEST) |
| 23 | add_definitions( -DBOOST_TEST_DYN_LINK ) |
| 24 | endif() |
| 25 | |
| 26 | # Make sure gen-cpp files can be included |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 27 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") |
| 28 | |
| 29 | # Create the thrift C++ test library |
| 30 | set(testgencpp_SOURCES |
James E. King, III | b4c190b | 2017-02-13 16:39:59 -0500 | [diff] [blame] | 31 | gen-cpp/AnnotationTest_types.cpp |
| 32 | gen-cpp/AnnotationTest_types.h |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 33 | gen-cpp/DebugProtoTest_types.cpp |
| 34 | gen-cpp/DebugProtoTest_types.h |
| 35 | gen-cpp/EnumTest_types.cpp |
| 36 | gen-cpp/EnumTest_types.h |
| 37 | gen-cpp/OptionalRequiredTest_types.cpp |
| 38 | gen-cpp/OptionalRequiredTest_types.h |
| 39 | gen-cpp/Recursive_types.cpp |
| 40 | gen-cpp/Recursive_types.h |
| 41 | gen-cpp/ThriftTest_types.cpp |
| 42 | gen-cpp/ThriftTest_types.h |
Chet Murthy | ad08a8b | 2017-12-19 15:55:56 -0800 | [diff] [blame] | 43 | gen-cpp/OneWayTest_types.cpp |
| 44 | gen-cpp/OneWayTest_types.h |
| 45 | gen-cpp/OneWayService.cpp |
| 46 | gen-cpp/OneWayService.h |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 47 | gen-cpp/TypedefTest_types.cpp |
| 48 | gen-cpp/TypedefTest_types.h |
| 49 | ThriftTest_extras.cpp |
| 50 | DebugProtoTest_extras.cpp |
| 51 | ) |
| 52 | |
| 53 | add_library(testgencpp STATIC ${testgencpp_SOURCES}) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 54 | |
Nobuaki Sukegawa | 6304a53 | 2014-12-18 01:30:58 +0900 | [diff] [blame] | 55 | set(testgencpp_cob_SOURCES |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 56 | gen-cpp/ChildService.cpp |
| 57 | gen-cpp/ChildService.h |
Ben Craig | 1684c42 | 2015-04-24 08:52:44 -0500 | [diff] [blame] | 58 | gen-cpp/EmptyService.cpp |
| 59 | gen-cpp/EmptyService.h |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 60 | gen-cpp/ParentService.cpp |
| 61 | gen-cpp/ParentService.h |
| 62 | gen-cpp/proc_types.cpp |
| 63 | gen-cpp/proc_types.h |
| 64 | ) |
Nobuaki Sukegawa | 6304a53 | 2014-12-18 01:30:58 +0900 | [diff] [blame] | 65 | add_library(testgencpp_cob STATIC ${testgencpp_cob_SOURCES}) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 66 | |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 67 | add_executable(Benchmark Benchmark.cpp) |
| 68 | target_link_libraries(Benchmark testgencpp) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 69 | LINK_AGAINST_THRIFT_LIBRARY(Benchmark thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 70 | add_test(NAME Benchmark COMMAND Benchmark) |
Nobuaki Sukegawa | e8c71d8 | 2015-11-23 19:51:37 +0900 | [diff] [blame] | 71 | target_link_libraries(Benchmark testgencpp) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 72 | |
| 73 | set(UnitTest_SOURCES |
| 74 | UnitTestMain.cpp |
Chet Murthy | ad08a8b | 2017-12-19 15:55:56 -0800 | [diff] [blame] | 75 | OneWayHTTPTest.cpp |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 76 | TMemoryBufferTest.cpp |
| 77 | TBufferBaseTest.cpp |
| 78 | Base64Test.cpp |
| 79 | ToStringTest.cpp |
| 80 | TypedefTest.cpp |
Roger Meier | 3815e0b | 2015-04-04 16:26:30 +0200 | [diff] [blame] | 81 | TServerSocketTest.cpp |
Ben Craig | 1684c42 | 2015-04-24 08:52:44 -0500 | [diff] [blame] | 82 | TServerTransportTest.cpp |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 83 | ) |
| 84 | |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 85 | if(NOT WITH_BOOSTTHREADS AND NOT WITH_STDTHREADS AND NOT MSVC AND NOT MINGW) |
James E. King, III | 00d4252 | 2017-04-04 09:32:45 -0400 | [diff] [blame] | 86 | list(APPEND UnitTest_SOURCES concurrency/MutexTest.cpp) |
| 87 | list(APPEND UnitTest_SOURCES concurrency/RWMutexStarveTest.cpp) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 88 | endif() |
| 89 | |
| 90 | add_executable(UnitTests ${UnitTest_SOURCES}) |
Nobuaki Sukegawa | e8c71d8 | 2015-11-23 19:51:37 +0900 | [diff] [blame] | 91 | target_link_libraries(UnitTests testgencpp ${Boost_LIBRARIES}) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 92 | LINK_AGAINST_THRIFT_LIBRARY(UnitTests thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 93 | add_test(NAME UnitTests COMMAND UnitTests) |
ben-craig | fae08e7 | 2015-07-15 11:34:47 -0500 | [diff] [blame] | 94 | if ( MSVC ) |
| 95 | # Disable C4503: decorated name length exceeded, name was truncated |
| 96 | # 'insanity' results in very long decorated names |
| 97 | set_property( TARGET UnitTests APPEND_STRING PROPERTY COMPILE_FLAGS /wd4503 ) |
| 98 | endif ( MSVC ) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 99 | |
ben-craig | af2d9c8 | 2015-07-16 08:11:21 -0500 | [diff] [blame] | 100 | |
Martin Haimberger | 0ad6ee9 | 2015-11-13 03:18:50 -0800 | [diff] [blame] | 101 | set( TInterruptTest_SOURCES |
| 102 | TSocketInterruptTest.cpp |
| 103 | TSSLSocketInterruptTest.cpp |
| 104 | ) |
ben-craig | af2d9c8 | 2015-07-16 08:11:21 -0500 | [diff] [blame] | 105 | if (WIN32) |
| 106 | list(APPEND TInterruptTest_SOURCES |
| 107 | TPipeInterruptTest.cpp |
| 108 | ) |
| 109 | endif() |
| 110 | add_executable(TInterruptTest ${TInterruptTest_SOURCES}) |
| 111 | target_link_libraries(TInterruptTest |
Ben Craig | 1684c42 | 2015-04-24 08:52:44 -0500 | [diff] [blame] | 112 | testgencpp |
| 113 | ${Boost_LIBRARIES} |
Ben Craig | 1684c42 | 2015-04-24 08:52:44 -0500 | [diff] [blame] | 114 | ) |
ben-craig | af2d9c8 | 2015-07-16 08:11:21 -0500 | [diff] [blame] | 115 | LINK_AGAINST_THRIFT_LIBRARY(TInterruptTest thrift) |
Antonio Di Monaco | 796667b | 2016-01-04 23:05:19 +0100 | [diff] [blame] | 116 | if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW) |
ben-craig | af2d9c8 | 2015-07-16 08:11:21 -0500 | [diff] [blame] | 117 | target_link_libraries(TInterruptTest -lrt) |
Ben Craig | 1684c42 | 2015-04-24 08:52:44 -0500 | [diff] [blame] | 118 | endif () |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 119 | add_test(NAME TInterruptTest COMMAND TInterruptTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys") |
Ben Craig | 1684c42 | 2015-04-24 08:52:44 -0500 | [diff] [blame] | 120 | |
| 121 | add_executable(TServerIntegrationTest TServerIntegrationTest.cpp) |
| 122 | target_link_libraries(TServerIntegrationTest |
| 123 | testgencpp_cob |
| 124 | ${Boost_LIBRARIES} |
| 125 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 126 | LINK_AGAINST_THRIFT_LIBRARY(TServerIntegrationTest thrift) |
Antonio Di Monaco | 796667b | 2016-01-04 23:05:19 +0100 | [diff] [blame] | 127 | if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW) |
Ben Craig | 1684c42 | 2015-04-24 08:52:44 -0500 | [diff] [blame] | 128 | target_link_libraries(TServerIntegrationTest -lrt) |
| 129 | endif () |
| 130 | add_test(NAME TServerIntegrationTest COMMAND TServerIntegrationTest) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 131 | |
| 132 | if(WITH_ZLIB) |
Nobuaki Sukegawa | 3e5b9c2 | 2016-02-22 21:47:23 +0900 | [diff] [blame] | 133 | include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}") |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 134 | add_executable(TransportTest TransportTest.cpp) |
| 135 | target_link_libraries(TransportTest |
| 136 | testgencpp |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 137 | ${Boost_LIBRARIES} |
| 138 | ${ZLIB_LIBRARIES} |
| 139 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 140 | LINK_AGAINST_THRIFT_LIBRARY(TransportTest thrift) |
| 141 | LINK_AGAINST_THRIFT_LIBRARY(TransportTest thriftz) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 142 | add_test(NAME TransportTest COMMAND TransportTest) |
| 143 | |
| 144 | add_executable(ZlibTest ZlibTest.cpp) |
| 145 | target_link_libraries(ZlibTest |
| 146 | testgencpp |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 147 | ${Boost_LIBRARIES} |
| 148 | ${ZLIB_LIBRARIES} |
| 149 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 150 | LINK_AGAINST_THRIFT_LIBRARY(ZlibTest thrift) |
| 151 | LINK_AGAINST_THRIFT_LIBRARY(ZlibTest thriftz) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 152 | add_test(NAME ZlibTest COMMAND ZlibTest) |
| 153 | endif(WITH_ZLIB) |
| 154 | |
James E. King, III | b4c190b | 2017-02-13 16:39:59 -0500 | [diff] [blame] | 155 | add_executable(AnnotationTest AnnotationTest.cpp) |
| 156 | target_link_libraries(AnnotationTest |
| 157 | testgencpp |
| 158 | ${Boost_LIBRARIES} |
| 159 | ) |
| 160 | LINK_AGAINST_THRIFT_LIBRARY(AnnotationTest thrift) |
| 161 | add_test(NAME AnnotationTest COMMAND AnnotationTest) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 162 | |
| 163 | add_executable(EnumTest EnumTest.cpp) |
| 164 | target_link_libraries(EnumTest |
| 165 | testgencpp |
| 166 | ${Boost_LIBRARIES} |
| 167 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 168 | LINK_AGAINST_THRIFT_LIBRARY(EnumTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 169 | add_test(NAME EnumTest COMMAND EnumTest) |
| 170 | |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 171 | if(HAVE_GETOPT_H) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 172 | add_executable(TFileTransportTest TFileTransportTest.cpp) |
| 173 | target_link_libraries(TFileTransportTest |
| 174 | testgencpp |
| 175 | ${Boost_LIBRARIES} |
| 176 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 177 | LINK_AGAINST_THRIFT_LIBRARY(TFileTransportTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 178 | add_test(NAME TFileTransportTest COMMAND TFileTransportTest) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 179 | endif() |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 180 | |
| 181 | add_executable(TFDTransportTest TFDTransportTest.cpp) |
Claudius Heine | 5ef662b | 2015-06-24 10:03:50 +0200 | [diff] [blame] | 182 | target_link_libraries(TFDTransportTest |
| 183 | ${Boost_LIBRARIES} |
| 184 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 185 | LINK_AGAINST_THRIFT_LIBRARY(TFDTransportTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 186 | add_test(NAME TFDTransportTest COMMAND TFDTransportTest) |
| 187 | |
| 188 | add_executable(TPipedTransportTest TPipedTransportTest.cpp) |
Claudius Heine | 5ef662b | 2015-06-24 10:03:50 +0200 | [diff] [blame] | 189 | target_link_libraries(TPipedTransportTest |
| 190 | ${Boost_LIBRARIES} |
| 191 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 192 | LINK_AGAINST_THRIFT_LIBRARY(TPipedTransportTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 193 | add_test(NAME TPipedTransportTest COMMAND TPipedTransportTest) |
| 194 | |
| 195 | set(AllProtocolsTest_SOURCES |
| 196 | AllProtocolTests.cpp |
| 197 | AllProtocolTests.tcc |
| 198 | GenericHelpers |
| 199 | ) |
| 200 | |
| 201 | add_executable(AllProtocolsTest ${AllProtocolsTest_SOURCES}) |
Claudius Heine | 5ef662b | 2015-06-24 10:03:50 +0200 | [diff] [blame] | 202 | target_link_libraries(AllProtocolsTest |
| 203 | testgencpp |
| 204 | ${Boost_LIBRARIES} |
| 205 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 206 | LINK_AGAINST_THRIFT_LIBRARY(AllProtocolsTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 207 | add_test(NAME AllProtocolsTest COMMAND AllProtocolsTest) |
| 208 | |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 209 | # The debug run-time in Windows asserts on isprint() with negative inputs |
| 210 | if (NOT MSVC OR (MSVC AND CMAKE_BUILD_TYPE EQUAL "DEBUG")) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 211 | add_executable(DebugProtoTest DebugProtoTest.cpp) |
Claudius Heine | 5ef662b | 2015-06-24 10:03:50 +0200 | [diff] [blame] | 212 | target_link_libraries(DebugProtoTest |
| 213 | testgencpp |
| 214 | ${Boost_LIBRARIES} |
| 215 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 216 | LINK_AGAINST_THRIFT_LIBRARY(DebugProtoTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 217 | add_test(NAME DebugProtoTest COMMAND DebugProtoTest) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 218 | endif() |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 219 | |
| 220 | add_executable(JSONProtoTest JSONProtoTest.cpp) |
Claudius Heine | 5ef662b | 2015-06-24 10:03:50 +0200 | [diff] [blame] | 221 | target_link_libraries(JSONProtoTest |
| 222 | testgencpp |
| 223 | ${Boost_LIBRARIES} |
| 224 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 225 | LINK_AGAINST_THRIFT_LIBRARY(JSONProtoTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 226 | add_test(NAME JSONProtoTest COMMAND JSONProtoTest) |
| 227 | |
| 228 | add_executable(OptionalRequiredTest OptionalRequiredTest.cpp) |
Claudius Heine | 5ef662b | 2015-06-24 10:03:50 +0200 | [diff] [blame] | 229 | target_link_libraries(OptionalRequiredTest |
| 230 | testgencpp |
| 231 | ${Boost_LIBRARIES} |
| 232 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 233 | LINK_AGAINST_THRIFT_LIBRARY(OptionalRequiredTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 234 | add_test(NAME OptionalRequiredTest COMMAND OptionalRequiredTest) |
| 235 | |
| 236 | add_executable(RecursiveTest RecursiveTest.cpp) |
Claudius Heine | 5ef662b | 2015-06-24 10:03:50 +0200 | [diff] [blame] | 237 | target_link_libraries(RecursiveTest |
| 238 | testgencpp |
| 239 | ${Boost_LIBRARIES} |
| 240 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 241 | LINK_AGAINST_THRIFT_LIBRARY(RecursiveTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 242 | add_test(NAME RecursiveTest COMMAND RecursiveTest) |
| 243 | |
| 244 | add_executable(SpecializationTest SpecializationTest.cpp) |
Claudius Heine | 5ef662b | 2015-06-24 10:03:50 +0200 | [diff] [blame] | 245 | target_link_libraries(SpecializationTest |
| 246 | testgencpp |
| 247 | ${Boost_LIBRARIES} |
| 248 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 249 | LINK_AGAINST_THRIFT_LIBRARY(SpecializationTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 250 | add_test(NAME SpecializationTest COMMAND SpecializationTest) |
| 251 | |
| 252 | set(concurrency_test_SOURCES |
| 253 | concurrency/Tests.cpp |
| 254 | concurrency/ThreadFactoryTests.h |
| 255 | concurrency/ThreadManagerTests.h |
| 256 | concurrency/TimerManagerTests.h |
| 257 | ) |
| 258 | add_executable(concurrency_test ${concurrency_test_SOURCES}) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 259 | LINK_AGAINST_THRIFT_LIBRARY(concurrency_test thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 260 | add_test(NAME concurrency_test COMMAND concurrency_test) |
| 261 | |
| 262 | set(link_test_SOURCES |
| 263 | link/LinkTest.cpp |
Nobuaki Sukegawa | 6304a53 | 2014-12-18 01:30:58 +0900 | [diff] [blame] | 264 | gen-cpp/ParentService.h |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 265 | link/TemplatedService1.cpp |
| 266 | link/TemplatedService2.cpp |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 267 | ) |
Nobuaki Sukegawa | 6304a53 | 2014-12-18 01:30:58 +0900 | [diff] [blame] | 268 | |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 269 | add_executable(link_test ${link_test_SOURCES}) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 270 | target_link_libraries(link_test testgencpp_cob) |
| 271 | LINK_AGAINST_THRIFT_LIBRARY(link_test thrift) |
Nobuaki Sukegawa | e8c71d8 | 2015-11-23 19:51:37 +0900 | [diff] [blame] | 272 | target_link_libraries(link_test testgencpp) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 273 | add_test(NAME link_test COMMAND link_test) |
| 274 | |
| 275 | if(WITH_LIBEVENT) |
| 276 | set(processor_test_SOURCES |
| 277 | processor/ProcessorTest.cpp |
| 278 | processor/EventLog.cpp |
| 279 | processor/ServerThread.cpp |
| 280 | processor/EventLog.h |
| 281 | processor/Handlers.h |
| 282 | processor/ServerThread.h |
| 283 | ) |
| 284 | add_executable(processor_test ${processor_test_SOURCES}) |
| 285 | target_link_libraries(processor_test |
Nobuaki Sukegawa | 6304a53 | 2014-12-18 01:30:58 +0900 | [diff] [blame] | 286 | testgencpp_cob |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 287 | ${Boost_LIBRARIES} |
| 288 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 289 | LINK_AGAINST_THRIFT_LIBRARY(processor_test thrift) |
| 290 | LINK_AGAINST_THRIFT_LIBRARY(processor_test thriftnb) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 291 | add_test(NAME processor_test COMMAND processor_test) |
Nobuaki Sukegawa | 8016af8 | 2015-01-02 23:14:22 +0900 | [diff] [blame] | 292 | |
| 293 | set(TNonblockingServerTest_SOURCES TNonblockingServerTest.cpp) |
| 294 | add_executable(TNonblockingServerTest ${TNonblockingServerTest_SOURCES}) |
| 295 | include_directories(${LIBEVENT_INCLUDE_DIRS}) |
| 296 | target_link_libraries(TNonblockingServerTest |
| 297 | testgencpp_cob |
Nobuaki Sukegawa | 8016af8 | 2015-01-02 23:14:22 +0900 | [diff] [blame] | 298 | ${LIBEVENT_LIBRARIES} |
| 299 | ${Boost_LIBRARIES} |
| 300 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 301 | LINK_AGAINST_THRIFT_LIBRARY(TNonblockingServerTest thrift) |
| 302 | LINK_AGAINST_THRIFT_LIBRARY(TNonblockingServerTest thriftnb) |
Nobuaki Sukegawa | 8016af8 | 2015-01-02 23:14:22 +0900 | [diff] [blame] | 303 | add_test(NAME TNonblockingServerTest COMMAND TNonblockingServerTest) |
James E. King, III | 82ae957 | 2017-08-05 12:23:54 -0400 | [diff] [blame] | 304 | |
| 305 | if(OPENSSL_FOUND AND WITH_OPENSSL) |
| 306 | set(TNonblockingSSLServerTest_SOURCES TNonblockingSSLServerTest.cpp) |
| 307 | add_executable(TNonblockingSSLServerTest ${TNonblockingSSLServerTest_SOURCES}) |
| 308 | include_directories(${LIBEVENT_INCLUDE_DIRS}) |
| 309 | target_link_libraries(TNonblockingSSLServerTest |
| 310 | testgencpp_cob |
| 311 | ${LIBEVENT_LIBRARIES} |
| 312 | ${Boost_LIBRARIES} |
| 313 | ) |
| 314 | LINK_AGAINST_THRIFT_LIBRARY(TNonblockingSSLServerTest thrift) |
| 315 | LINK_AGAINST_THRIFT_LIBRARY(TNonblockingSSLServerTest thriftnb) |
| 316 | add_test(NAME TNonblockingSSLServerTest COMMAND TNonblockingSSLServerTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys") |
| 317 | endif(OPENSSL_FOUND AND WITH_OPENSSL) |
| 318 | endif(WITH_LIBEVENT) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 319 | |
| 320 | if(OPENSSL_FOUND AND WITH_OPENSSL) |
| 321 | add_executable(OpenSSLManualInitTest OpenSSLManualInitTest.cpp) |
| 322 | target_link_libraries(OpenSSLManualInitTest |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 323 | ${OPENSSL_LIBRARIES} |
| 324 | ${Boost_LIBRARIES} |
| 325 | ) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 326 | LINK_AGAINST_THRIFT_LIBRARY(OpenSSLManualInitTest thrift) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 327 | add_test(NAME OpenSSLManualInitTest COMMAND OpenSSLManualInitTest) |
Sergei Nikulov | 34e0bb6 | 2015-09-02 13:06:22 +0300 | [diff] [blame] | 328 | |
| 329 | add_executable(SecurityTest SecurityTest.cpp) |
| 330 | target_link_libraries(SecurityTest |
| 331 | testgencpp |
| 332 | ${Boost_LIBRARIES} |
| 333 | ) |
| 334 | LINK_AGAINST_THRIFT_LIBRARY(SecurityTest thrift) |
Antonio Di Monaco | 796667b | 2016-01-04 23:05:19 +0100 | [diff] [blame] | 335 | if (NOT MSVC AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT MINGW) |
Sergei Nikulov | 34e0bb6 | 2015-09-02 13:06:22 +0300 | [diff] [blame] | 336 | target_link_libraries(SecurityTest -lrt) |
| 337 | endif () |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 338 | add_test(NAME SecurityTest COMMAND SecurityTest -- "${CMAKE_CURRENT_SOURCE_DIR}/../../../test/keys") |
Sergei Nikulov | 34e0bb6 | 2015-09-02 13:06:22 +0300 | [diff] [blame] | 339 | |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 340 | endif() |
| 341 | |
Nobuaki Sukegawa | 6304a53 | 2014-12-18 01:30:58 +0900 | [diff] [blame] | 342 | if(WITH_QT4) |
Nobuaki Sukegawa | 6304a53 | 2014-12-18 01:30:58 +0900 | [diff] [blame] | 343 | set(CMAKE_AUTOMOC ON) |
| 344 | find_package(Qt4 REQUIRED COMPONENTS QtTest) |
| 345 | set(TQTcpServerTest_SOURCES |
| 346 | qt/TQTcpServerTest.cpp |
| 347 | ) |
| 348 | add_executable(TQTcpServerTest ${TQTcpServerTest_SOURCES}) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 349 | target_link_libraries(TQTcpServerTest testgencpp_cob thriftqt Qt4::QtTest) |
| 350 | LINK_AGAINST_THRIFT_LIBRARY(TQTcpServerTest thrift) |
Nobuaki Sukegawa | 6304a53 | 2014-12-18 01:30:58 +0900 | [diff] [blame] | 351 | add_test(NAME TQTcpServerTest COMMAND TQTcpServerTest) |
| 352 | endif() |
| 353 | |
Nobuaki Sukegawa | 6622877 | 2014-12-07 21:45:33 +0900 | [diff] [blame] | 354 | if(WITH_QT5) |
| 355 | add_subdirectory(qt) |
| 356 | endif() |
| 357 | |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 358 | # |
| 359 | # Common thrift code generation rules |
| 360 | # |
| 361 | |
James E. King, III | b4c190b | 2017-02-13 16:39:59 -0500 | [diff] [blame] | 362 | add_custom_command(OUTPUT gen-cpp/AnnotationTest_constants.cpp |
| 363 | gen-cpp/AnnotationTest_constants.h |
| 364 | gen-cpp/AnnotationTest_types.cpp |
| 365 | gen-cpp/AnnotationTest_types.h |
| 366 | gen-cpp/foo_service.cpp |
| 367 | gen-cpp/foo_service.h |
| 368 | COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/AnnotationTest.thrift |
| 369 | ) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 370 | |
James E. King, III | b4c190b | 2017-02-13 16:39:59 -0500 | [diff] [blame] | 371 | add_custom_command(OUTPUT gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h gen-cpp/EmptyService.cpp gen-cpp/EmptyService.h |
Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 372 | COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/DebugProtoTest.thrift |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 373 | ) |
| 374 | |
| 375 | add_custom_command(OUTPUT gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h |
Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 376 | COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/EnumTest.thrift |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 377 | ) |
| 378 | |
| 379 | add_custom_command(OUTPUT gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h |
Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 380 | COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/TypedefTest.thrift |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 381 | ) |
| 382 | |
| 383 | add_custom_command(OUTPUT gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h |
Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 384 | COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/OptionalRequiredTest.thrift |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 385 | ) |
| 386 | |
| 387 | add_custom_command(OUTPUT gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h |
Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 388 | COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/Recursive.thrift |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 389 | ) |
| 390 | |
| 391 | add_custom_command(OUTPUT gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp |
Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 392 | COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/StressTest.thrift |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 393 | ) |
| 394 | |
| 395 | add_custom_command(OUTPUT gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h |
Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 396 | COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 397 | ) |
| 398 | |
Chet Murthy | ad08a8b | 2017-12-19 15:55:56 -0800 | [diff] [blame] | 399 | add_custom_command(OUTPUT gen-cpp/OneWayService.cpp gen-cpp/OneWayTest_constants.cpp gen-cpp/OneWayTest_types.h gen-cpp/OneWayService.h gen-cpp/OneWayTest_constants.h gen-cpp/OneWayTest_types.cpp |
| 400 | COMMAND ${THRIFT_COMPILER} --gen cpp ${CMAKE_CURRENT_SOURCE_DIR}/OneWayTest.thrift |
| 401 | ) |
| 402 | |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 403 | add_custom_command(OUTPUT gen-cpp/ChildService.cpp gen-cpp/ChildService.h gen-cpp/ParentService.cpp gen-cpp/ParentService.h gen-cpp/proc_types.cpp gen-cpp/proc_types.h |
Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 404 | COMMAND ${THRIFT_COMPILER} --gen cpp:templates,cob_style ${CMAKE_CURRENT_SOURCE_DIR}/processor/proc.thrift |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 405 | ) |