]> git.proxmox.com Git - ceph.git/blob - ceph/src/test/CMakeLists.txt
import 15.2.0 Octopus source
[ceph.git] / ceph / src / test / CMakeLists.txt
1 include(AddCephTest)
2
3 set(UNITTEST_LIBS GMock::Main GMock::GMock GTest::GTest ${CMAKE_THREAD_LIBS_INIT}
4 ${GSSAPI_LIBRARIES} ${OPENLDAP_LIBRARIES} ${CMAKE_DL_LIBS})
5
6 add_library(unit-main OBJECT unit.cc)
7 target_include_directories(unit-main PRIVATE
8 $<TARGET_PROPERTY:GTest::GTest,INTERFACE_INCLUDE_DIRECTORIES>)
9
10 add_subdirectory(cls_hello)
11 add_subdirectory(cls_lock)
12 add_subdirectory(cls_log)
13 add_subdirectory(cls_numops)
14 add_subdirectory(cls_sdk)
15 if(WITH_RBD)
16 add_subdirectory(cls_journal)
17 add_subdirectory(cls_rbd)
18 endif(WITH_RBD)
19 add_subdirectory(cls_refcount)
20 add_subdirectory(cls_rgw)
21 add_subdirectory(cls_version)
22 add_subdirectory(cls_lua)
23 add_subdirectory(cls_rgw_gc)
24 add_subdirectory(cls_queue)
25 add_subdirectory(common)
26 add_subdirectory(compressor)
27 add_subdirectory(crush)
28 add_subdirectory(direct_messenger)
29 add_subdirectory(encoding)
30 add_subdirectory(erasure-code)
31 add_subdirectory(filestore)
32 add_subdirectory(fs)
33 add_subdirectory(journal)
34 add_subdirectory(libcephfs)
35 add_subdirectory(librados)
36 add_subdirectory(librados_test_stub)
37 if(WITH_LIBRADOSSTRIPER)
38 add_subdirectory(libradosstriper)
39 endif()
40 if(WITH_RBD)
41 add_subdirectory(librbd)
42 endif(WITH_RBD)
43 if (WITH_CEPHFS)
44 add_subdirectory(mds)
45 endif()
46 add_subdirectory(mon)
47 add_subdirectory(mgr)
48 add_subdirectory(msgr)
49 add_subdirectory(ObjectMap)
50 add_subdirectory(objectstore)
51 add_subdirectory(os)
52 add_subdirectory(osd)
53 add_subdirectory(osdc)
54 add_subdirectory(pybind)
55 add_subdirectory(immutable_object_cache)
56 if(WITH_RADOSGW)
57 set(rgw_libs rgw_a)
58 if(WITH_RADOSGW_AMQP_ENDPOINT)
59 list(APPEND rgw_libs amqp_mock)
60 endif()
61 if(WITH_RADOSGW_KAFKA_ENDPOINT)
62 list(APPEND rgw_libs kafka_stub)
63 endif()
64 add_subdirectory(rgw)
65 endif(WITH_RADOSGW)
66 if(WITH_RBD)
67 add_subdirectory(rbd_mirror)
68 endif(WITH_RBD)
69 if(WITH_SEASTAR)
70 add_subdirectory(crimson)
71 endif()
72 add_subdirectory(system)
73 if(WITH_FIO OR WITH_SYSTEM_FIO)
74 add_subdirectory(fio)
75 endif()
76 add_subdirectory(lazy-omap-stats)
77
78 # test_timers
79 add_executable(ceph_test_timers
80 TestTimers.cc
81 )
82 target_link_libraries(ceph_test_timers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
83
84 # test_signal_handlers
85 add_executable(ceph_test_signal_handlers
86 TestSignalHandlers.cc
87 )
88 target_link_libraries(ceph_test_signal_handlers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
89
90 # test_rewrite_latency
91 add_executable(ceph_test_rewrite_latency
92 test_rewrite_latency.cc
93 )
94 target_link_libraries(ceph_test_rewrite_latency ceph-common)
95
96 # test_crypt
97 add_executable(test_crypto
98 testcrypto.cc)
99 target_link_libraries(test_crypto
100 ceph-common)
101
102 add_executable(test_build_libcommon buildtest_skeleton.cc)
103 target_link_libraries(test_build_libcommon ceph-common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
104
105 if(WITH_RADOSGW)
106 add_executable(test_build_librgw buildtest_skeleton.cc)
107 target_link_libraries(test_build_librgw rgw_a pthread ${CRYPTO_LIBS} ${EXTRALIBS})
108 endif(WITH_RADOSGW)
109
110 if(WITH_RADOSGW)
111 add_executable(test_build_librgw_admin_user buildtest_skeleton.cc)
112 target_link_libraries(test_build_librgw_admin_user pthread ${CRYPTO_LIBS} ${EXTRALIBS})
113 endif(WITH_RADOSGW)
114
115 if(WITH_LIBCEPHFS)
116 # From src/test/Makefile-client.am: I dont get this one... testing the osdc build but link in libcephfs?
117 add_executable(test_build_libcephfs buildtest_skeleton.cc)
118 target_link_libraries(test_build_libcephfs cephfs pthread ${CRYPTO_LIBS} ${EXTRALIBS})
119 endif(WITH_LIBCEPHFS)
120
121 add_executable(test_build_librados buildtest_skeleton.cc)
122 target_link_libraries(test_build_librados librados pthread ${CRYPTO_LIBS} ${EXTRALIBS} osdc osd os ceph-common cls_lock_client ${BLKID_LIBRARIES})
123
124 # bench_log
125 set(bench_log_srcs
126 bench_log.cc
127 )
128 add_executable(ceph_bench_log
129 ${bench_log_srcs}
130 )
131 target_link_libraries(ceph_bench_log global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
132
133 # ceph_test_mutate
134 add_executable(ceph_test_mutate
135 test_mutate.cc
136 )
137 target_link_libraries(ceph_test_mutate global librados ${BLKID_LIBRARIES}
138 ${CMAKE_DL_LIBS})
139
140 # test_trans
141 add_executable(test_trans
142 test_trans.cc
143 )
144 target_link_libraries(test_trans os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
145
146 ## Benchmarks
147
148
149 # ceph_omapbench
150 set(omapbench_srcs
151 omap_bench.cc
152 )
153 add_executable(ceph_omapbench
154 ${omapbench_srcs}
155 )
156 target_link_libraries(ceph_omapbench
157 librados
158 ceph-common
159 Boost::program_options)
160
161 if(WITH_KVS)
162 # ceph_kvstorebench
163 set(kvstorebench_srcs
164 kv_store_bench.cc
165 ${CMAKE_SOURCE_DIR}/src/key_value_store/kv_flat_btree_async.cc
166 )
167 add_executable(ceph_kvstorebench ${kvstorebench_srcs})
168 target_link_libraries(ceph_kvstorebench librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
169 install(TARGETS ceph_kvstorebench DESTINATION bin)
170 endif(WITH_KVS)
171
172 # ceph_objectstore_bench
173 add_executable(ceph_objectstore_bench objectstore_bench.cc)
174 target_link_libraries(ceph_objectstore_bench os global ${BLKID_LIBRARIES})
175
176 if(${WITH_RADOSGW})
177 # test_cors
178 set(test_cors_srcs test_cors.cc)
179 add_executable(test_cors
180 ${test_cors_srcs}
181 )
182 target_link_libraries(test_cors
183 librados
184 ${rgw_libs}
185 global
186 ${BLKID_LIBRARIES}
187 ${CURL_LIBRARIES}
188 ${EXPAT_LIBRARIES}
189 ${CMAKE_DL_LIBS} ${UNITTEST_LIBS})
190
191 # ceph_test_cls_rgw_meta
192 set(test_cls_rgw_meta_srcs test_rgw_admin_meta.cc)
193 add_executable(ceph_test_cls_rgw_meta
194 ${test_cls_rgw_meta_srcs}
195 )
196 target_link_libraries(ceph_test_cls_rgw_meta
197 librados
198 ${rgw_libs}
199 global
200 cls_version_client
201 cls_log_client
202 cls_refcount_client
203 cls_rgw_client
204 cls_user_client
205 cls_lock_client
206 ${BLKID_LIBRARIES}
207 ${CURL_LIBRARIES}
208 ${EXPAT_LIBRARIES}
209 ${CMAKE_DL_LIBS} ${UNITTEST_LIBS} ${CRYPTO_LIBS})
210
211 install(TARGETS
212 ceph_test_cls_rgw_meta
213 DESTINATION ${CMAKE_INSTALL_BINDIR})
214
215 # ceph_test_cls_rgw_log
216 set(ceph_test_cls_rgw_log_srcs
217 test_rgw_admin_log.cc
218 )
219 add_executable(ceph_test_cls_rgw_log
220 ${ceph_test_cls_rgw_log_srcs}
221 )
222 target_link_libraries(ceph_test_cls_rgw_log
223 librados
224 ${rgw_libs}
225 global
226 cls_version_client
227 cls_log_client
228 cls_refcount_client
229 cls_rgw_client
230 cls_user_client
231 cls_lock_client
232 ${BLKID_LIBRARIES}
233 ${CURL_LIBRARIES}
234 ${EXPAT_LIBRARIES}
235 ${CMAKE_DL_LIBS}
236 ${UNITTEST_LIBS}
237 ${EXTRALIBS}
238 ${CRYPTO_LIBS}
239 )
240
241 # ceph_test_librgw_file (nfs-like RGW interface)
242 add_executable(ceph_test_librgw_file
243 librgw_file.cc
244 )
245 if(WITH_RADOSGW_FCGI_FRONTEND)
246 target_include_directories(ceph_test_librgw_file SYSTEM PRIVATE ${FCGI_INCLUDE_DIR})
247 endif(WITH_RADOSGW_FCGI_FRONTEND)
248 target_link_libraries(ceph_test_librgw_file
249 rgw
250 librados
251 ceph-common
252 ${UNITTEST_LIBS}
253 ${EXTRALIBS}
254 )
255
256 # ceph_test_librgw_file_cd (just the rgw_file create-delete bucket ops)
257 add_executable(ceph_test_librgw_file_cd
258 librgw_file_cd.cc
259 )
260 target_link_libraries(ceph_test_librgw_file_cd
261 rgw
262 librados
263 ceph-common
264 ${UNITTEST_LIBS}
265 ${EXTRALIBS}
266 )
267
268 # ceph_test_librgw_file_gp (just the rgw_file get-put bucket ops)
269 add_executable(ceph_test_librgw_file_gp
270 librgw_file_gp.cc
271 )
272 target_link_libraries(ceph_test_librgw_file_gp
273 rgw
274 librados
275 ceph-common
276 ${UNITTEST_LIBS}
277 ${EXTRALIBS}
278 )
279
280 # ceph_test_librgw_file_nfsns (nfs namespace tests)
281 add_executable(ceph_test_librgw_file_nfsns
282 librgw_file_nfsns.cc
283 )
284 if(WITH_RADOSGW_FCGI_FRONTEND)
285 target_include_directories(ceph_test_librgw_file_nfsns SYSTEM PRIVATE ${FCGI_INCLUDE_DIR})
286 endif(WITH_RADOSGW_FCGI_FRONTEND)
287 target_link_libraries(ceph_test_librgw_file_nfsns
288 rgw
289 librados
290 ceph-common
291 ${UNITTEST_LIBS}
292 ${EXTRALIBS}
293 )
294 if(WITH_BOOST_CONTEXT)
295 target_link_libraries(ceph_test_librgw_file_nfsns spawn)
296 endif()
297
298
299 # ceph_test_librgw_file_aw (nfs write transaction [atomic write] tests)
300 add_executable(ceph_test_librgw_file_aw
301 librgw_file_aw.cc
302 )
303 target_link_libraries(ceph_test_librgw_file_aw
304 rgw
305 librados
306 ceph-common
307 ${UNITTEST_LIBS}
308 ${EXTRALIBS}
309 )
310
311 # ceph_test_librgw_file_marker (READDIR with string and uint64 offsets)
312 add_executable(ceph_test_librgw_file_marker
313 librgw_file_marker.cc
314 )
315 target_link_libraries(ceph_test_librgw_file_marker
316 rgw
317 librados
318 ceph-common
319 ${UNITTEST_LIBS}
320 ${EXTRALIBS}
321 )
322 if(WITH_BOOST_CONTEXT)
323 target_link_libraries(ceph_test_librgw_file_marker spawn)
324 endif()
325
326 # ceph_test_rgw_token
327 add_executable(ceph_test_rgw_token
328 test_rgw_token.cc
329 )
330 target_link_libraries(ceph_test_rgw_token
331 rgw
332 ceph-common
333 ${UNITTEST_LIBS}
334 ${EXTRALIBS}
335 )
336
337 # librgw_file_gp (just the rgw_file get-put bucket ops)
338 add_executable(test_rgw_ldap
339 ${CMAKE_SOURCE_DIR}/src/rgw/rgw_ldap.cc
340 test_rgw_ldap.cc
341 )
342 target_link_libraries(test_rgw_ldap
343 librados
344 ceph-common
345 ${OPENLDAP_LIBRARIES}
346 ${UNITTEST_LIBS}
347 )
348
349 # unittest_librgw_admin_user
350 add_executable(ceph_test_librgw_admin_user test_librgw_admin_user.cc)
351 target_link_libraries(ceph_test_librgw_admin_user
352 rgw_admin_user
353 cls_otp_client
354 librados
355 ceph-common
356 ${UNITTEST_LIBS}
357 ${EXTRALIBS}
358 )
359
360 endif(${WITH_RADOSGW})
361
362 # ceph_multi_stress_watch
363 add_executable(ceph_multi_stress_watch
364 multi_stress_watch.cc
365 )
366 target_link_libraries(ceph_multi_stress_watch librados global radostest-cxx)
367
368 #ceph_perf_local
369 add_executable(ceph_perf_local
370 perf_local.cc
371 perf_helper.cc)
372 if(HAVE_SSE)
373 set(PERF_LOCAL_FLAGS ${SSE3_FLAGS})
374 endif(HAVE_SSE)
375 if(HAVE_NEON)
376 set(PERF_LOCAL_FLAGS ${ARM_NEON_FLAGS})
377 endif(HAVE_NEON)
378 if(PERF_LOCAL_FLAGS)
379 set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS
380 ${PERF_LOCAL_FLAGS})
381 endif()
382 target_link_libraries(ceph_perf_local global ${UNITTEST_LIBS})
383
384 install(TARGETS
385 ceph_bench_log
386 ceph_multi_stress_watch
387 ceph_objectstore_bench
388 ceph_omapbench
389 ceph_perf_local
390 DESTINATION bin)
391
392 # ceph_test_filejournal
393 add_executable(ceph_test_filejournal
394 test_filejournal.cc
395 )
396 target_link_libraries(ceph_test_filejournal
397 os
398 ceph-common
399 ${UNITTEST_LIBS}
400 global
401 ${EXTRALIBS}
402 ${BLKID_LIBRARIES}
403 ${CMAKE_DL_LIBS}
404 ${EXTRALIBS}
405 )
406 install(TARGETS
407 ceph_test_filejournal
408 DESTINATION ${CMAKE_INSTALL_BINDIR})
409
410 # ceph_test_keys
411 add_executable(ceph_test_keys
412 testkeys.cc
413 )
414 target_link_libraries(ceph_test_keys mon global ${CMAKE_DL_LIBS})
415
416 # ceph_test_snap_mapper
417 add_executable(ceph_test_snap_mapper
418 test_snap_mapper.cc
419 $<TARGET_OBJECTS:unit-main>
420 )
421 target_link_libraries(ceph_test_snap_mapper osd global ${BLKID_LIBRARIES} ${UNITTEST_LIBS})
422
423 add_executable(ceph_test_stress_watch
424 test_stress_watch.cc
425 )
426 target_link_libraries(ceph_test_stress_watch
427 librados
428 ${UNITTEST_LIBS}
429 radostest-cxx
430 ${EXTRALIBS}
431 ${BLKID_LIBRARIES}
432 ${CMAKE_DL_LIBS}
433 )
434 install(TARGETS
435 ceph_test_stress_watch
436 DESTINATION ${CMAKE_INSTALL_BINDIR})
437
438 if(WITH_FUSE)
439 add_executable(ceph_test_cfuse_cache_invalidate
440 test_cfuse_cache_invalidate.cc
441 )
442 target_link_libraries(ceph_test_cfuse_cache_invalidate
443 ceph-common
444 )
445 endif(WITH_FUSE)
446
447 if(${WITH_CEPHFS})
448 add_executable(test_c_headers
449 test_c_headers.c
450 )
451 target_link_libraries(test_c_headers
452 librados
453 cephfs)
454 endif(${WITH_CEPHFS})
455
456 if(HAVE_BLKID OR FREEBSD)
457 add_executable(ceph_test_get_blkdev_props
458 test_get_blkdev_props.cc
459 )
460 target_link_libraries(ceph_test_get_blkdev_props
461 ceph-common
462 pthread
463 ${EXTRALIBS}
464 ${BLKID_LIBRARIES}
465 ${CMAKE_DL_LIBS}
466 )
467 endif(HAVE_BLKID OR FREEBSD)
468
469 # ceph_test_admin_socket_output
470
471 if(StdFilesystem_FOUND)
472 add_executable(ceph_test_admin_socket_output
473 test_admin_socket_output.cc
474 admin_socket_output.cc
475 admin_socket_output_tests.cc)
476 target_link_libraries(ceph_test_admin_socket_output
477 ceph-common StdFilesystem::filesystem)
478 install(TARGETS
479 ceph_test_admin_socket_output
480 DESTINATION ${CMAKE_INSTALL_BINDIR})
481 endif()
482
483 #make check starts here
484
485 #following dependencies are run inside make check unit tests
486 add_dependencies(tests
487 ceph-mon
488 ceph-authtool
489 get_command_descriptions
490 crushtool
491 ceph-conf
492 rados
493 monmaptool
494 ceph-osd
495 ceph-dencoder
496 ceph-objectstore-tool
497 ceph-kvstore-tool
498 ceph-monstore-tool
499 osdmaptool
500 ceph_example
501 ceph_snappy
502 cls_lock
503 ceph_test_objectstore
504 ceph_erasure_code_non_regression
505 ceph_erasure_code
506 cython_modules)
507 if (WITH_CEPHFS)
508 add_dependencies(tests ceph-mds)
509 endif()
510 if(WITH_MGR)
511 add_dependencies(tests ceph-mgr)
512 endif()
513 if(WITH_RBD)
514 add_dependencies(tests unittest_librbd rbd)
515 if(FREEBSD)
516 add_dependencies(tests rbd-ggate)
517 endif(FREEBSD)
518 endif(WITH_RBD)
519 if(WITH_RADOSGW)
520 add_dependencies(tests radosgwd radosgw-admin)
521 endif()
522 #add dependency from fio just to ensure the plugin build isn't failing
523 if(WITH_FIO OR WITH_SYSTEM_FIO)
524 add_dependencies(tests fio_ceph_objectstore)
525 endif()
526
527 if(WITH_RBD)
528 # Run rbd-unit-tests separate so they an run in parallel
529 # For values see: src/include/rbd/features.h
530 add_ceph_test(run-rbd-unit-tests-N.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh N)
531 add_ceph_test(run-rbd-unit-tests-0.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 0)
532 add_ceph_test(run-rbd-unit-tests-1.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 1)
533 add_ceph_test(run-rbd-unit-tests-61.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 61)
534 add_ceph_test(run-rbd-unit-tests-109.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 109)
535 add_ceph_test(run-rbd-unit-tests-127.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 127)
536 if(FREEBSD)
537 add_ceph_test(rbd-ggate.sh ${CMAKE_CURRENT_SOURCE_DIR}/rbd-ggate.sh)
538 endif(FREEBSD)
539 endif(WITH_RBD)
540 add_ceph_test(run-cli-tests ${CMAKE_CURRENT_SOURCE_DIR}/run-cli-tests)
541
542 # flaky, see https://tracker.ceph.com/issues/44243
543 #add_ceph_test(test_objectstore_memstore.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_objectstore_memstore.sh)
544
545 # flaky
546 #add_ceph_test(test_pidfile.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_pidfile.sh)
547
548 add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh)
549
550 set_property(
551 TEST ${tox_tests}
552 PROPERTY ENVIRONMENT ${env_vars_for_tox_tests})
553
554 # unittest_admin_socket
555 add_executable(unittest_admin_socket
556 admin_socket.cc
557 $<TARGET_OBJECTS:unit-main>
558 )
559 add_ceph_unittest(unittest_admin_socket)
560 target_link_libraries(unittest_admin_socket global)
561
562 # unittest_encoding
563 add_executable(unittest_encoding
564 encoding.cc
565 )
566 add_ceph_unittest(unittest_encoding)
567 target_link_libraries(unittest_encoding ceph-common)
568
569 # unittest_addrs
570 add_executable(unittest_addrs
571 test_addrs.cc
572 )
573 add_ceph_unittest(unittest_addrs)
574 target_link_libraries(unittest_addrs ceph-common)
575
576 # unittest_auth
577 add_executable(unittest_auth
578 test_auth.cc
579 $<TARGET_OBJECTS:unit-main>
580 )
581 add_ceph_unittest(unittest_auth)
582 target_link_libraries(unittest_auth global)
583
584 # unittest_workqueue
585 add_executable(unittest_workqueue
586 test_workqueue.cc
587 $<TARGET_OBJECTS:unit-main>
588 )
589 add_ceph_unittest(unittest_workqueue)
590 target_link_libraries(unittest_workqueue global)
591
592 # unittest_striper
593 if(WITH_LIBRADOSSTRIPER)
594 add_executable(unittest_striper
595 test_striper.cc
596 $<TARGET_OBJECTS:unit-main>
597 )
598 add_ceph_unittest(unittest_striper)
599 target_link_libraries(unittest_striper global ${BLKID_LIBRARIES})
600 endif()
601
602 # unittest_str_list
603 add_executable(unittest_str_list
604 test_str_list.cc
605 )
606 add_ceph_unittest(unittest_str_list)
607 target_link_libraries(unittest_str_list global)
608
609 # unittest_log
610 add_executable(unittest_log
611 ${CMAKE_SOURCE_DIR}/src/log/test.cc
612 )
613 add_ceph_unittest(unittest_log)
614 target_link_libraries(unittest_log global)
615
616 # unittest_base64
617 add_executable(unittest_base64
618 base64.cc
619 )
620 add_ceph_unittest(unittest_base64)
621 target_link_libraries(unittest_base64 global)
622
623 # unittest_ceph_argparse
624 add_executable(unittest_ceph_argparse
625 ceph_argparse.cc
626 )
627 add_ceph_unittest(unittest_ceph_argparse)
628 target_link_libraries(unittest_ceph_argparse global)
629
630 # unittest_ceph_compatset
631 add_executable(unittest_ceph_compatset
632 ceph_compatset.cc
633 )
634 add_ceph_unittest(unittest_ceph_compatset)
635 target_link_libraries(unittest_ceph_compatset global)
636
637 # unittest_gather
638 add_executable(unittest_gather
639 gather.cc
640 $<TARGET_OBJECTS:unit-main>
641 )
642 add_ceph_unittest(unittest_gather)
643 target_link_libraries(unittest_gather global)
644
645 # unittest_run_cmd
646 add_executable(unittest_run_cmd
647 run_cmd.cc
648 )
649 add_ceph_unittest(unittest_run_cmd)
650 target_link_libraries(unittest_run_cmd global)
651
652 # signals
653 add_executable(unittest_signals
654 signals.cc
655 $<TARGET_OBJECTS:unit-main>
656 )
657 add_ceph_unittest(unittest_signals)
658 target_link_libraries(unittest_signals global)
659
660 # unittest_simple_spin
661 add_executable(unittest_simple_spin
662 simple_spin.cc
663 )
664 add_ceph_unittest(unittest_simple_spin)
665 target_link_libraries(unittest_simple_spin global)
666
667 # unittest_bufferlist
668 add_executable(unittest_bufferlist
669 bufferlist.cc
670 $<TARGET_OBJECTS:unit-main>
671 )
672 add_ceph_unittest(unittest_bufferlist)
673 target_link_libraries(unittest_bufferlist global)
674
675 # compiletest_cxx11_client
676 add_executable(compiletest_cxx11_client
677 cxx11_client.cc
678 )
679 if(CMAKE_VERSION VERSION_LESS "3.8")
680 # this is ugly as we'll end with -std=c++11 overriding the previous -std=c++17
681 # I would love to have a better way for old Cmakes
682 set_target_properties(compiletest_cxx11_client
683 PROPERTIES COMPILE_FLAGS "-std=c++11 -Werror -pedantic"
684 )
685 else()
686 set_target_properties(compiletest_cxx11_client
687 PROPERTIES COMPILE_FLAGS "-Werror -pedantic"
688 CMAKE_CXX_STANDARD 11
689 CXX_STANDARD_REQUIRED ON
690 )
691 endif()
692 add_ceph_test(compiletest_cxx11_client
693 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/compiletest_cxx11_client"
694 )
695 target_link_libraries(compiletest_cxx11_client global)
696
697 # unittest_xlist
698 add_executable(unittest_xlist
699 test_xlist.cc
700 )
701 add_ceph_unittest(unittest_xlist)
702 target_link_libraries(unittest_xlist ceph-common)
703
704 # unittest_arch
705 add_executable(unittest_arch
706 test_arch.cc
707 $<TARGET_OBJECTS:unit-main>
708 )
709 add_ceph_unittest(unittest_arch)
710 target_link_libraries(unittest_arch global)
711
712 # unittest_denc
713 add_executable(unittest_denc
714 test_denc.cc
715 )
716 add_ceph_unittest(unittest_denc)
717 target_link_libraries(unittest_denc global)
718
719 # unittest_mempool
720 add_executable(unittest_mempool
721 test_mempool.cc
722 )
723 add_ceph_unittest(unittest_mempool)
724 target_link_libraries(unittest_mempool global)
725
726 # unittest_features
727 add_executable(unittest_features
728 test_features.cc
729 )
730 add_ceph_unittest(unittest_features)
731 target_link_libraries(unittest_features global)
732
733 # unittest_crypto
734 add_executable(unittest_crypto
735 crypto.cc
736 $<TARGET_OBJECTS:unit-main>
737 )
738 add_ceph_unittest(unittest_crypto)
739 target_link_libraries(unittest_crypto global)
740
741 # unittest_crypto_init
742 add_executable(unittest_crypto_init
743 crypto_init.cc
744 )
745 add_ceph_unittest(unittest_crypto_init)
746 target_link_libraries(unittest_crypto_init global)
747
748 # unittest_perf_counters
749 add_executable(unittest_perf_counters
750 perf_counters.cc
751 )
752 add_ceph_unittest(unittest_perf_counters)
753 target_link_libraries(unittest_perf_counters global)
754
755 # unittest_ceph_crypto
756 add_executable(unittest_ceph_crypto
757 ceph_crypto.cc)
758 add_ceph_unittest(unittest_ceph_crypto)
759 target_link_libraries(unittest_ceph_crypto global)
760
761 # unittest_utf8
762 add_executable(unittest_utf8
763 utf8.cc)
764 add_ceph_unittest(unittest_utf8)
765 target_link_libraries(unittest_utf8 global)
766
767 # unittest_mime
768 add_executable(unittest_mime
769 mime.cc)
770 add_ceph_unittest(unittest_mime)
771 target_link_libraries(unittest_mime ceph-common)
772
773 # unittest_escape
774 add_executable(unittest_escape
775 escape.cc)
776 add_ceph_unittest(unittest_escape)
777 target_link_libraries(unittest_escape ceph-common)
778
779 # unittest_strtol
780 add_executable(unittest_strtol
781 strtol.cc)
782 add_ceph_unittest(unittest_strtol)
783 target_link_libraries(unittest_strtol ceph-common)
784
785 # unittest_confutils
786 add_executable(unittest_confutils
787 confutils.cc)
788 add_ceph_unittest(unittest_confutils)
789 target_link_libraries(unittest_confutils ceph-common)
790
791 # unittest_heartbeatmap
792 add_executable(unittest_heartbeatmap
793 heartbeat_map.cc
794 $<TARGET_OBJECTS:unit-main>
795 )
796 add_ceph_unittest(unittest_heartbeatmap)
797 target_link_libraries(unittest_heartbeatmap global ceph-common)
798
799 if(${WITH_RADOSGW})
800 # unittest_formatter
801 add_executable(unittest_formatter
802 formatter.cc
803 $<TARGET_OBJECTS:unit-main>
804 )
805 add_ceph_unittest(unittest_formatter)
806 target_link_libraries(unittest_formatter global)
807 endif(${WITH_RADOSGW})
808
809 # unittest_daemon_config
810 add_executable(unittest_daemon_config
811 daemon_config.cc
812 $<TARGET_OBJECTS:unit-main>
813 )
814 add_ceph_unittest(unittest_daemon_config)
815 target_link_libraries(unittest_daemon_config
816 ceph-common
817 global
818 ${BLKID_LIBRARIES}
819 ${EXTRALIBS}
820 )
821
822 if(WITH_LIBCEPHFS)
823 # unittest_libcephfs_config
824 add_executable(unittest_libcephfs_config
825 libcephfs_config.cc
826 )
827 add_ceph_unittest(unittest_libcephfs_config)
828 target_link_libraries(unittest_libcephfs_config cephfs)
829 endif(WITH_LIBCEPHFS)
830
831 if(WITH_RBD)
832 # unittest_rbd_replay
833 add_executable(unittest_rbd_replay
834 test_rbd_replay.cc)
835 add_ceph_unittest(unittest_rbd_replay)
836 target_link_libraries(unittest_rbd_replay
837 librbd
838 librados
839 global
840 rbd_replay
841 rbd_replay_ios
842 ${BLKID_LIBRARIES}
843 )
844 endif(WITH_RBD)
845
846 # unittest_ipaddr
847 add_executable(unittest_ipaddr
848 test_ipaddr.cc)
849 add_ceph_unittest(unittest_ipaddr)
850 target_link_libraries(unittest_ipaddr global)
851
852 # unittest_utime
853 add_executable(unittest_utime
854 test_utime.cc)
855 add_ceph_unittest(unittest_utime)
856 target_link_libraries(unittest_utime ceph-common)
857
858 # unittest_texttable
859 add_executable(unittest_texttable
860 test_texttable.cc
861 $<TARGET_OBJECTS:common_texttable_obj>)
862 add_ceph_unittest(unittest_texttable)
863 target_link_libraries(unittest_texttable ceph-common)
864
865 # unittest_on_exit
866 add_executable(unittest_on_exit
867 on_exit.cc)
868 add_ceph_unittest(unittest_on_exit)
869 target_link_libraries(unittest_on_exit ceph-common)
870
871 # unittest_subprocess
872 add_executable(unittest_subprocess
873 test_subprocess.cc)
874 add_ceph_unittest(unittest_subprocess)
875 target_link_libraries(unittest_subprocess ceph-common)
876
877 # unittest_pageset
878 add_executable(unittest_pageset test_pageset.cc)
879 add_ceph_unittest(unittest_pageset)
880 target_link_libraries(unittest_pageset ceph-common)
881
882 add_executable(unittest_random_string test_random_string.cc $<TARGET_OBJECTS:unit-main>)
883 add_ceph_unittest(unittest_random_string)
884 target_link_libraries(unittest_random_string global)
885
886 # unittest_any_
887 add_executable(unittest_any test_any.cc)
888 add_ceph_unittest(unittest_any)
889
890 # unittest_weighted_shuffle
891 add_executable(unittest_weighted_shuffle test_weighted_shuffle.cc)
892 add_ceph_unittest(unittest_weighted_shuffle)
893
894 #make check ends here