]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | # |
2 | # This file is open source software, licensed to you under the terms | |
3 | # of the Apache License, Version 2.0 (the "License"). See the NOTICE file | |
4 | # distributed with this work for additional information regarding copyright | |
5 | # ownership. You may not use this file except in compliance with the License. | |
6 | # | |
7 | # You may obtain a copy of the License at | |
8 | # | |
9 | # http://www.apache.org/licenses/LICENSE-2.0 | |
10 | # | |
11 | # Unless required by applicable law or agreed to in writing, | |
12 | # software distributed under the License is distributed on an | |
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
14 | # KIND, either express or implied. See the License for the | |
15 | # specific language governing permissions and limitations | |
16 | # under the License. | |
17 | # | |
18 | ||
19 | # | |
20 | # Copyright (C) 2018 Scylladb, Ltd. | |
21 | # | |
22 | ||
23 | # Logical target for all unit tests. | |
24 | add_custom_target (unit_tests) | |
25 | ||
9f95a23c TL |
26 | set (Seastar_UNIT_TEST_SMP |
27 | 2 | |
28 | CACHE | |
29 | STRING | |
30 | "Run unit tests with this many cores.") | |
11fdf7f2 | 31 | |
9f95a23c TL |
32 | # |
33 | # Define a new unit test with the given name. | |
34 | # | |
35 | # seastar_add_test (name | |
36 | # [KIND {SEASTAR,BOOST,CUSTOM}] | |
37 | # [SOURCES source1 source2 ... sourcen] | |
38 | # [WORKING_DIRECTORY dir] | |
39 | # [LIBRARIES library1 library2 ... libraryn] | |
40 | # [RUN_ARGS arg1 arg2 ... argn]) | |
41 | # | |
42 | # There are three kinds of test we support (the KIND parameter): | |
43 | # | |
44 | # - SEASTAR: Unit tests which use macros like `SEASTAR_TEST_CASE` | |
45 | # - BOOST: Unit tests which use macros like `BOOST_AUTO_TEST_CASE` | |
46 | # - CUSTOM: Custom tests which need to be specified | |
47 | # | |
48 | # SEASTAR and BOOST tests will have their output saved for interpretation by the Jenkins continuous integration service | |
49 | # if this is configured for the build. | |
50 | # | |
51 | # KIND can be omitted, in which case it is assumed to be SEASTAR. | |
52 | # | |
53 | # If SOURCES is provided, then the test files are first compiled into an executable which has the same name as the test | |
54 | # but with a suffix ("_test"). | |
55 | # | |
56 | # WORKING_DIRECTORY can be optionally provided to choose where the test is executed. | |
57 | # | |
58 | # If LIBRARIES is provided along with SOURCES, then the executable is additionally linked with these libraries. | |
59 | # | |
60 | # RUN_ARGS are optional additional arguments to pass to the executable. For SEASTAR tests, these come after `--`. For | |
61 | # CUSTOM tests with no SOURCES, this parameter can be used to specify the executable name as well as its arguments since | |
62 | # no executable is compiled. | |
63 | # | |
64 | function (seastar_add_test name) | |
65 | set (test_kinds | |
66 | SEASTAR | |
67 | BOOST | |
68 | CUSTOM) | |
11fdf7f2 | 69 | |
9f95a23c TL |
70 | cmake_parse_arguments (parsed_args |
71 | "" | |
72 | "WORKING_DIRECTORY;KIND" | |
f67539c2 | 73 | "RUN_ARGS;SOURCES;LIBRARIES;DEPENDS" |
9f95a23c TL |
74 | ${ARGN}) |
75 | ||
76 | if (NOT parsed_args_KIND) | |
77 | set (parsed_args_KIND SEASTAR) | |
78 | elseif (NOT (parsed_args_KIND IN_LIST test_kinds)) | |
79 | message (FATAL_ERROR "Invalid test kind. KIND must be one of ${test_kinds}") | |
80 | endif () | |
11fdf7f2 TL |
81 | |
82 | if (parsed_args_SOURCES) | |
9f95a23c TL |
83 | # These may be unused. |
84 | seastar_jenkins_arguments (${name} jenkins_args) | |
11fdf7f2 | 85 | |
9f95a23c TL |
86 | # |
87 | # Each kind of test must populate the `args` and `libraries` lists. | |
88 | # | |
89 | ||
90 | set (libraries "${parsed_args_LIBRARIES}") | |
91 | ||
f67539c2 | 92 | set (args "") |
9f95a23c | 93 | if (parsed_args_KIND STREQUAL "SEASTAR") |
9f95a23c TL |
94 | list (APPEND libraries |
95 | seastar_testing | |
96 | seastar_private) | |
11fdf7f2 TL |
97 | |
98 | if (NOT (Seastar_JENKINS STREQUAL "")) | |
9f95a23c | 99 | list (APPEND args ${jenkins_args}) |
11fdf7f2 TL |
100 | endif () |
101 | ||
9f95a23c | 102 | list (APPEND args -- -c ${Seastar_UNIT_TEST_SMP}) |
9f95a23c | 103 | elseif (parsed_args_KIND STREQUAL "BOOST") |
9f95a23c TL |
104 | list (APPEND libraries |
105 | Boost::unit_test_framework | |
106 | seastar_private) | |
107 | ||
108 | if (NOT (Seastar_JENKINS STREQUAL "")) | |
109 | list (APPEND args ${jenkins_args}) | |
11fdf7f2 | 110 | endif () |
11fdf7f2 TL |
111 | endif () |
112 | ||
f67539c2 TL |
113 | list (APPEND args ${parsed_args_RUN_ARGS}) |
114 | ||
11fdf7f2 TL |
115 | set (executable_target test_unit_${name}) |
116 | add_executable (${executable_target} ${parsed_args_SOURCES}) | |
117 | ||
118 | target_link_libraries (${executable_target} | |
119 | PRIVATE ${libraries}) | |
120 | ||
121 | target_compile_definitions (${executable_target} | |
122 | PRIVATE SEASTAR_TESTING_MAIN) | |
123 | ||
f67539c2 TL |
124 | if ((Seastar_STACK_GUARDS STREQUAL "ON") OR |
125 | ((Seastar_STACK_GUARDS STREQUAL "DEFAULT") AND | |
126 | (CMAKE_BUILD_TYPE IN_LIST Seastar_STACK_GUARD_MODES))) | |
127 | target_compile_definitions (${executable_target} | |
128 | PRIVATE | |
129 | SEASTAR_THREAD_STACK_GUARDS) | |
130 | endif () | |
131 | ||
11fdf7f2 TL |
132 | target_include_directories (${executable_target} |
133 | PRIVATE | |
134 | ${CMAKE_CURRENT_SOURCE_DIR} | |
135 | ${Seastar_SOURCE_DIR}/src) | |
136 | ||
137 | set_target_properties (${executable_target} | |
138 | PROPERTIES | |
9f95a23c | 139 | OUTPUT_NAME ${name}_test) |
11fdf7f2 TL |
140 | |
141 | add_dependencies (unit_tests ${executable_target}) | |
9f95a23c TL |
142 | set (forwarded_args COMMAND ${executable_target} ${args}) |
143 | else () | |
144 | if (NOT (parsed_args_KIND STREQUAL "CUSTOM")) | |
145 | message (FATAL_ERROR "SOURCES are required for ${parsed_args_KIND} tests") | |
146 | endif () | |
147 | ||
148 | set (forwarded_args COMMAND ${parsed_args_RUN_ARGS}) | |
11fdf7f2 TL |
149 | endif () |
150 | ||
9f95a23c TL |
151 | # |
152 | # We expect `forwarded_args` to be populated correctly at this point. | |
153 | # | |
154 | ||
11fdf7f2 TL |
155 | set (target test_unit_${name}_run) |
156 | ||
157 | if (parsed_args_WORKING_DIRECTORY) | |
9f95a23c | 158 | list (APPEND forwarded_args WORKING_DIRECTORY ${parsed_args_WORKING_DIRECTORY}) |
11fdf7f2 TL |
159 | endif () |
160 | ||
f67539c2 TL |
161 | if (parsed_args_DEPENDS) |
162 | add_dependencies(${executable_target} ${parsed_args_DEPENDS}) | |
163 | endif() | |
164 | ||
11fdf7f2 | 165 | add_custom_target (${target} |
9f95a23c | 166 | ${forwarded_args} |
11fdf7f2 TL |
167 | USES_TERMINAL) |
168 | ||
169 | add_test ( | |
170 | NAME Seastar.unit.${name} | |
171 | COMMAND ${CMAKE_COMMAND} --build ${Seastar_BINARY_DIR} --target ${target}) | |
172 | ||
173 | set_tests_properties (Seastar.unit.${name} | |
174 | PROPERTIES | |
9f95a23c TL |
175 | TIMEOUT ${Seastar_TEST_TIMEOUT} |
176 | ENVIRONMENT "${Seastar_TEST_ENVIRONMENT}") | |
177 | endfunction () | |
178 | ||
179 | # | |
180 | # Define a new custom unit test whose entry point is a Seastar application. | |
181 | # | |
182 | # seastar_add_app_test (name | |
183 | # [SOURCES source1 source2 ... sourcen] | |
184 | # [LIBRARIES library1 library2 ... libraryn] | |
185 | # [RUN_ARGS arg1 arg2 ... argn]) | |
186 | # | |
187 | # These kinds of tests are structured like Seastar applications. | |
188 | # | |
189 | # These tests always link against `seastar_private` and are always invoked with | |
190 | # `-c ${Seastar_UNIT_TEST_SMP}`. | |
191 | # | |
192 | function (seastar_add_app_test name) | |
193 | cmake_parse_arguments (parsed_args | |
194 | "" | |
195 | "" | |
196 | "RUN_ARGS;SOURCES;LIBRARIES" | |
197 | ${ARGN}) | |
198 | ||
199 | seastar_add_test (${name} | |
200 | KIND CUSTOM | |
201 | SOURCES ${parsed_args_SOURCES} | |
202 | LIBRARIES | |
203 | seastar_private | |
204 | ${parsed_args_LIBRARIES} | |
205 | RUN_ARGS | |
206 | -c ${Seastar_UNIT_TEST_SMP} | |
207 | ${parsed_args_RUN_ARGS}) | |
208 | endfunction () | |
11fdf7f2 TL |
209 | |
210 | function (prepend_each var prefix) | |
211 | set (result "") | |
212 | ||
213 | foreach (x ${ARGN}) | |
214 | list (APPEND result ${prefix}/${x}) | |
215 | endforeach () | |
216 | ||
217 | set (${var} ${result} PARENT_SCOPE) | |
218 | endfunction () | |
219 | ||
220 | add_custom_target (test_unit | |
221 | COMMAND ctest --verbose -R Seastar.unit | |
222 | USES_TERMINAL) | |
223 | ||
224 | seastar_add_test (abort_source | |
225 | SOURCES abort_source_test.cc) | |
226 | ||
227 | seastar_add_test (alloc | |
228 | SOURCES alloc_test.cc) | |
229 | ||
230 | if (NOT Seastar_EXECUTE_ONLY_FAST_TESTS) | |
231 | set (allocator_test_args "") | |
232 | else () | |
233 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") | |
234 | set (allocator_test_args --iterations 5) | |
235 | else () | |
236 | set (allocator_test_args --time 0.1) | |
237 | endif () | |
238 | endif () | |
239 | ||
240 | seastar_add_test (allocator | |
241 | SOURCES allocator_test.cc | |
242 | RUN_ARGS ${allocator_test_args}) | |
243 | ||
9f95a23c TL |
244 | seastar_add_app_test (alien |
245 | SOURCES alien_test.cc) | |
11fdf7f2 TL |
246 | |
247 | seastar_add_test (checked_ptr | |
248 | SOURCES checked_ptr_test.cc) | |
249 | ||
250 | seastar_add_test (chunked_fifo | |
251 | SOURCES chunked_fifo_test.cc) | |
252 | ||
253 | seastar_add_test (circular_buffer | |
254 | SOURCES circular_buffer_test.cc) | |
255 | ||
256 | seastar_add_test (circular_buffer_fixed_capacity | |
257 | SOURCES circular_buffer_fixed_capacity_test.cc) | |
258 | ||
259 | seastar_add_test (connect | |
260 | SOURCES connect_test.cc) | |
261 | ||
f67539c2 TL |
262 | seastar_add_test (coroutines |
263 | SOURCES coroutines_test.cc) | |
9f95a23c | 264 | |
11fdf7f2 TL |
265 | seastar_add_test (defer |
266 | SOURCES defer_test.cc) | |
267 | ||
9f95a23c TL |
268 | seastar_add_test (deleter |
269 | SOURCES deleter_test.cc) | |
270 | ||
271 | seastar_add_app_test (directory | |
272 | SOURCES directory_test.cc) | |
11fdf7f2 | 273 | |
f67539c2 | 274 | seastar_add_test (distributed |
9f95a23c | 275 | SOURCES distributed_test.cc) |
11fdf7f2 TL |
276 | |
277 | seastar_add_test (dns | |
278 | SOURCES dns_test.cc) | |
279 | ||
280 | seastar_add_test (execution_stage | |
281 | SOURCES execution_stage_test.cc) | |
282 | ||
283 | seastar_add_test (expiring_fifo | |
284 | SOURCES expiring_fifo_test.cc) | |
285 | ||
286 | seastar_add_test (fair_queue | |
287 | SOURCES fair_queue_test.cc) | |
288 | ||
289 | seastar_add_test (file_io | |
290 | SOURCES file_io_test.cc) | |
291 | ||
f67539c2 TL |
292 | seastar_add_test (file_utils |
293 | SOURCES file_utils_test.cc) | |
294 | ||
11fdf7f2 TL |
295 | seastar_add_test (foreign_ptr |
296 | SOURCES foreign_ptr_test.cc) | |
297 | ||
f67539c2 TL |
298 | seastar_add_test (fsnotifier |
299 | SOURCES fsnotifier_test.cc) | |
300 | ||
11fdf7f2 TL |
301 | seastar_add_test (fstream |
302 | SOURCES | |
303 | fstream_test.cc | |
304 | mock_file.hh) | |
305 | ||
306 | seastar_add_test (futures | |
307 | SOURCES futures_test.cc) | |
308 | ||
9f95a23c TL |
309 | seastar_add_test (sharded |
310 | SOURCES sharded_test.cc) | |
311 | ||
11fdf7f2 TL |
312 | seastar_add_test (httpd |
313 | SOURCES | |
314 | httpd_test.cc | |
315 | loopback_socket.hh) | |
316 | ||
9f95a23c TL |
317 | seastar_add_test (ipv6 |
318 | SOURCES ipv6_test.cc) | |
319 | ||
320 | seastar_add_test (network_interface | |
321 | SOURCES network_interface_test.cc) | |
322 | ||
11fdf7f2 TL |
323 | seastar_add_test (json_formatter |
324 | SOURCES json_formatter_test.cc) | |
325 | ||
f67539c2 TL |
326 | seastar_add_test (locking |
327 | SOURCES locking_test.cc) | |
328 | ||
11fdf7f2 TL |
329 | seastar_add_test (lowres_clock |
330 | SOURCES lowres_clock_test.cc) | |
331 | ||
9f95a23c TL |
332 | seastar_add_test (metrics |
333 | SOURCES metrics_test.cc) | |
334 | ||
11fdf7f2 | 335 | seastar_add_test (net_config |
9f95a23c | 336 | KIND BOOST |
11fdf7f2 TL |
337 | SOURCES net_config_test.cc) |
338 | ||
339 | seastar_add_test (noncopyable_function | |
9f95a23c | 340 | KIND BOOST |
11fdf7f2 TL |
341 | SOURCES noncopyable_function_test.cc) |
342 | ||
343 | seastar_add_test (output_stream | |
344 | SOURCES output_stream_test.cc) | |
345 | ||
346 | seastar_add_test (packet | |
9f95a23c | 347 | KIND BOOST |
11fdf7f2 TL |
348 | SOURCES packet_test.cc) |
349 | ||
350 | seastar_add_test (program_options | |
9f95a23c | 351 | KIND BOOST |
11fdf7f2 TL |
352 | SOURCES program_options_test.cc) |
353 | ||
354 | seastar_add_test (queue | |
355 | SOURCES queue_test.cc) | |
356 | ||
f67539c2 TL |
357 | seastar_add_test (request_parser |
358 | SOURCES request_parser_test.cc) | |
359 | ||
11fdf7f2 TL |
360 | seastar_add_test (rpc |
361 | SOURCES | |
362 | loopback_socket.hh | |
363 | rpc_test.cc) | |
364 | ||
365 | seastar_add_test (semaphore | |
366 | SOURCES semaphore_test.cc) | |
367 | ||
368 | seastar_add_test (shared_ptr | |
9f95a23c | 369 | KIND BOOST |
11fdf7f2 TL |
370 | SOURCES shared_ptr_test.cc) |
371 | ||
372 | seastar_add_test (signal | |
373 | SOURCES signal_test.cc) | |
374 | ||
375 | seastar_add_test (simple_stream | |
9f95a23c | 376 | KIND BOOST |
11fdf7f2 TL |
377 | SOURCES simple_stream_test.cc) |
378 | ||
379 | # TODO: Disabled for now. See GH-520. | |
380 | # seastar_add_test (slab | |
381 | # SOURCES slab_test.cc | |
382 | # NO_SEASTAR_TESTING_LIBRARY) | |
383 | ||
9f95a23c TL |
384 | seastar_add_app_test (smp |
385 | SOURCES smp_test.cc) | |
386 | ||
387 | seastar_add_app_test (socket | |
388 | SOURCES socket_test.cc) | |
11fdf7f2 TL |
389 | |
390 | seastar_add_test (sstring | |
9f95a23c | 391 | KIND BOOST |
11fdf7f2 TL |
392 | SOURCES sstring_test.cc) |
393 | ||
394 | seastar_add_test (stall_detector | |
395 | SOURCES stall_detector_test.cc) | |
396 | ||
397 | seastar_add_test (thread | |
398 | SOURCES thread_test.cc) | |
399 | ||
9f95a23c TL |
400 | seastar_add_test (scheduling_group |
401 | SOURCES scheduling_group_test.cc) | |
402 | ||
403 | seastar_add_app_test (thread_context_switch | |
404 | SOURCES thread_context_switch_test.cc) | |
11fdf7f2 | 405 | |
9f95a23c TL |
406 | seastar_add_app_test (timer |
407 | SOURCES timer_test.cc) | |
408 | ||
409 | seastar_add_test (uname | |
410 | KIND BOOST | |
411 | SOURCES uname_test.cc) | |
11fdf7f2 | 412 | |
f67539c2 TL |
413 | function(seastar_add_certgen name) |
414 | cmake_parse_arguments(CERT | |
415 | "" | |
416 | "SUBJECT;SERVER;NAME;DOMAIN;COMMON;LOCALITY;ORG;WIDTH;STATE;COUNTRY;UNIT;EMAIL;DAYS;ALG" | |
417 | "ALG_OPTS" | |
418 | ${ARGN} | |
419 | ) | |
420 | ||
421 | if (NOT CERT_SERVER) | |
422 | execute_process(COMMAND hostname | |
423 | RESULT_VARIABLE CERT_SERVER | |
424 | ) | |
425 | endif() | |
426 | if (NOT CERT_DOMAIN) | |
427 | execute_process(COMMAND dnsdomainname | |
428 | RESULT_VARIABLE CERT_DOMAIN | |
429 | ) | |
430 | endif() | |
431 | if (NOT CERT_NAME) | |
432 | set(CERT_NAME ${CERT_SERVER}) | |
433 | endif() | |
434 | if (NOT CERT_COUNTRY) | |
435 | set(CERT_COUNTRY SE) | |
436 | endif() | |
437 | if (NOT CERT_STATE) | |
438 | set(CERT_STATE Stockholm) | |
439 | endif() | |
440 | if (NOT CERT_LOCALITY) | |
441 | set(CERT_LOCALITY ${CERT_STATE}) | |
442 | endif() | |
443 | if (NOT CERT_ORG) | |
444 | set(CERT_ORG ${CERT_DOMAIN}) | |
445 | endif() | |
446 | if (NOT CERT_UNIT) | |
447 | set(CERT_UNIT ${CERT_DOMAIN}) | |
448 | endif() | |
449 | if (NOT CERT_COMMON) | |
450 | set(CERT_COMMON ${CERT_SERVER}.${CERT_DOMAIN}) | |
451 | endif() | |
452 | if (NOT CERT_EMAIL) | |
453 | set(CERT_EMAIL postmaster@${CERT_DOMAIN}) | |
454 | endif() | |
455 | if (NOT CERT_WIDTH) | |
456 | set(CERT_WIDTH 4096) | |
457 | endif() | |
458 | if (NOT CERT_DAYS) | |
459 | set(CERT_DAYS 3650) | |
460 | endif() | |
461 | if ((NOT CERT_ALG) AND (NOT CERT_ALG_OPTS)) | |
462 | set(CERT_ALG_OPTS -pkeyopt rsa_keygen_bits:${CERT_WIDTH}) | |
463 | endif() | |
464 | if (NOT CERT_ALG) | |
465 | set(CERT_ALG RSA) | |
466 | endif() | |
467 | ||
468 | set(CERT_PRIVKEY ${CERT_NAME}.key) | |
469 | set(CERT_REQ ${CERT_NAME}.csr) | |
470 | set(CERT_CERT ${CERT_NAME}.crt) | |
471 | ||
472 | set(CERT_CAPRIVKEY ca${CERT_NAME}.key) | |
473 | set(CERT_CAROOT ca${CERT_NAME}.pem) | |
474 | ||
475 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cert.cfg.in" | |
476 | "${CMAKE_CURRENT_BINARY_DIR}/${CERT_NAME}.cfg" | |
477 | ) | |
478 | ||
479 | find_program(OPENSSL openssl) | |
480 | ||
481 | add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CERT_PRIVKEY}" | |
482 | COMMAND ${OPENSSL} genpkey -out ${CERT_PRIVKEY} -algorithm ${CERT_ALG} ${CERT_ALG_OPTS} | |
483 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | |
484 | ) | |
485 | add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CERT_REQ}" | |
486 | COMMAND ${OPENSSL} req -new -key ${CERT_PRIVKEY} -out ${CERT_REQ} -config ${CERT_NAME}.cfg | |
487 | DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CERT_PRIVKEY}" | |
488 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | |
489 | ) | |
490 | ||
491 | add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CERT_CAPRIVKEY}" | |
492 | COMMAND ${OPENSSL} genpkey -out ${CERT_CAPRIVKEY} -algorithm ${CERT_ALG} ${CERT_ALG_OPTS} | |
493 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | |
494 | ) | |
495 | add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CERT_CAROOT}" | |
496 | COMMAND ${OPENSSL} req -x509 -new -nodes -key ${CERT_CAPRIVKEY} -days ${CERT_DAYS} -config ${CERT_NAME}.cfg -out ${CERT_CAROOT} | |
497 | DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CERT_CAPRIVKEY}" | |
498 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | |
499 | ) | |
500 | ||
501 | add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CERT_CERT}" | |
502 | COMMAND ${OPENSSL} x509 -req -in ${CERT_REQ} -CA ${CERT_CAROOT} -CAkey ${CERT_CAPRIVKEY} -CAcreateserial -out ${CERT_CERT} -days ${CERT_DAYS} | |
503 | DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CERT_REQ}" "${CMAKE_CURRENT_BINARY_DIR}/${CERT_CAROOT}" | |
504 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | |
505 | ) | |
506 | ||
507 | add_custom_target(${name} | |
508 | DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CERT_CERT}" | |
509 | ) | |
510 | endfunction() | |
511 | ||
512 | seastar_add_certgen(testcrt DOMAIN scylladb.org SERVER test) | |
513 | seastar_add_certgen(othercrt DOMAIN apa.org SERVER other) | |
514 | ||
11fdf7f2 | 515 | set (tls_certificate_files |
11fdf7f2 | 516 | tls-ca-bundle.pem |
f67539c2 | 517 | ) |
11fdf7f2 TL |
518 | |
519 | prepend_each ( | |
520 | in_tls_certificate_files | |
521 | ${CMAKE_CURRENT_SOURCE_DIR}/ | |
522 | ${tls_certificate_files}) | |
523 | ||
524 | prepend_each ( | |
525 | out_tls_certificate_files | |
526 | ${CMAKE_CURRENT_BINARY_DIR}/ | |
527 | ${tls_certificate_files}) | |
528 | ||
529 | add_custom_command ( | |
530 | DEPENDS ${in_tls_certificate_files} | |
531 | OUTPUT ${out_tls_certificate_files} | |
532 | COMMAND ${CMAKE_COMMAND} -E copy ${in_tls_certificate_files} ${CMAKE_CURRENT_BINARY_DIR}) | |
533 | ||
f67539c2 TL |
534 | add_custom_target(tls_files |
535 | DEPENDS ${out_tls_certificate_files} | |
536 | ) | |
537 | ||
538 | seastar_add_test (tls | |
539 | DEPENDS tls_files testcrt othercrt | |
540 | SOURCES tls_test.cc | |
541 | LIBRARIES boost_filesystem | |
542 | WORKING_DIRECTORY ${Seastar_BINARY_DIR}) | |
11fdf7f2 TL |
543 | |
544 | seastar_add_test (tuple_utils | |
9f95a23c | 545 | KIND BOOST |
11fdf7f2 TL |
546 | SOURCES tuple_utils_test.cc) |
547 | ||
9f95a23c TL |
548 | seastar_add_test (unix_domain |
549 | SOURCES unix_domain_test.cc) | |
550 | ||
11fdf7f2 | 551 | seastar_add_test (unwind |
9f95a23c | 552 | KIND BOOST |
11fdf7f2 TL |
553 | SOURCES unwind_test.cc) |
554 | ||
555 | seastar_add_test (weak_ptr | |
9f95a23c | 556 | KIND BOOST |
11fdf7f2 | 557 | SOURCES weak_ptr_test.cc) |
f67539c2 TL |
558 | |
559 | seastar_add_test (log_buf | |
560 | SOURCES log_buf_test.cc) |