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