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