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