]> git.proxmox.com Git - ceph.git/blob - ceph/src/test/CMakeLists.txt
update sources to v12.2.0
[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
571 # buggy, see http://tracker.ceph.com/issues/20975
572 #add_ceph_test(test_pidfile.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_pidfile.sh)
573
574 add_ceph_test(test_subman.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_subman.sh)
575 add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh)
576 add_ceph_test(unittest_bufferlist.sh ${CMAKE_SOURCE_DIR}/src/unittest_bufferlist.sh)
577
578 add_test(NAME run-tox-ceph-disk COMMAND bash ${CMAKE_SOURCE_DIR}/src/ceph-disk/run-tox.sh)
579 add_test(NAME run-tox-ceph-detect-init COMMAND bash ${CMAKE_SOURCE_DIR}/src/ceph-detect-init/run-tox.sh)
580
581 set(CEPH_DISK_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-disk-virtualenv)
582 set(CEPH_DETECT_INIT_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-detect-init-virtualenv)
583
584 set_property(TEST
585 run-tox-ceph-disk
586 run-tox-ceph-detect-init
587 PROPERTY ENVIRONMENT
588 CEPH_BUILD_DIR=${CMAKE_BINARY_DIR}
589 CEPH_ROOT=${CMAKE_SOURCE_DIR}
590 CEPH_BIN=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
591 CEPH_LIB=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
592 CEPH_BUILD_VIRTUALENV=${CEPH_BUILD_VIRTUALENV}
593 CEPH_DISK_VIRTUALENV=${CEPH_DISK_VIRTUALENV}
594 CEPH_DETECT_INIT_VIRTUALENV=${CEPH_DETECT_INIT_VIRTUALENV}
595 LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib
596 PATH=$ENV{PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}:${CMAKE_SOURCE_DIR}/src
597 PYTHONPATH=${CMAKE_SOURCE_DIR}/src/pybind
598 )
599
600 # unittest_admin_socket
601 add_executable(unittest_admin_socket
602 admin_socket.cc
603 $<TARGET_OBJECTS:unit-main>
604 )
605 add_ceph_unittest(unittest_admin_socket ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_admin_socket)
606 target_link_libraries(unittest_admin_socket global)
607
608 # unittest_encoding
609 add_executable(unittest_encoding
610 encoding.cc
611 )
612 add_ceph_unittest(unittest_encoding ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_encoding)
613 target_link_libraries(unittest_encoding ceph-common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES})
614
615 # unittest_addrs
616 add_executable(unittest_addrs
617 test_addrs.cc
618 )
619 add_ceph_unittest(unittest_addrs ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_addrs)
620 target_link_libraries(unittest_addrs ceph-common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES})
621
622 # unittest_workqueue
623 add_executable(unittest_workqueue
624 test_workqueue.cc
625 $<TARGET_OBJECTS:unit-main>
626 )
627 add_ceph_unittest(unittest_workqueue ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_workqueue)
628 target_link_libraries(unittest_workqueue global ${BLKID_LIBRARIES})
629
630 # unittest_striper
631 add_executable(unittest_striper
632 test_striper.cc
633 $<TARGET_OBJECTS:unit-main>
634 )
635 add_ceph_unittest(unittest_striper ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_striper)
636 target_link_libraries(unittest_striper global ${BLKID_LIBRARIES})
637
638 # unittest_prebufferedstreambuf
639 add_executable(unittest_prebufferedstreambuf
640 test_prebufferedstreambuf.cc
641 )
642 add_ceph_unittest(unittest_prebufferedstreambuf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_prebufferedstreambuf)
643 target_link_libraries(unittest_prebufferedstreambuf global ${BLKID_LIBRARIES})
644
645 # unittest_str_list
646 add_executable(unittest_str_list
647 test_str_list.cc
648 )
649 add_ceph_unittest(unittest_str_list ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_str_list)
650 target_link_libraries(unittest_str_list global ${BLKID_LIBRARIES})
651
652 # unittest_log
653 add_executable(unittest_log
654 ${CMAKE_SOURCE_DIR}/src/log/test.cc
655 )
656 add_ceph_unittest(unittest_log ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_log)
657 target_link_libraries(unittest_log global)
658
659 # unittest_base64
660 add_executable(unittest_base64
661 base64.cc
662 )
663 add_ceph_unittest(unittest_base64 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_base64)
664 target_link_libraries(unittest_base64 global)
665
666 # unittest_ceph_argparse
667 add_executable(unittest_ceph_argparse
668 ceph_argparse.cc
669 )
670 add_ceph_unittest(unittest_ceph_argparse ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_argparse)
671 target_link_libraries(unittest_ceph_argparse global)
672
673 # unittest_ceph_compatset
674 add_executable(unittest_ceph_compatset
675 ceph_compatset.cc
676 )
677 add_ceph_unittest(unittest_ceph_compatset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_compatset)
678 target_link_libraries(unittest_ceph_compatset global)
679
680 # unittest_gather
681 add_executable(unittest_gather
682 gather.cc
683 $<TARGET_OBJECTS:unit-main>
684 )
685 add_ceph_unittest(unittest_gather ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_gather)
686 target_link_libraries(unittest_gather global)
687
688 # unittest_run_cmd
689 add_executable(unittest_run_cmd
690 run_cmd.cc
691 )
692 add_ceph_unittest(unittest_run_cmd ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_run_cmd)
693 target_link_libraries(unittest_run_cmd global)
694
695 # signals
696 add_executable(unittest_signals
697 signals.cc
698 $<TARGET_OBJECTS:unit-main>
699 )
700 add_ceph_unittest(unittest_signals ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_signals)
701 target_link_libraries(unittest_signals global)
702
703 # unittest_simple_spin
704 add_executable(unittest_simple_spin
705 simple_spin.cc
706 )
707 add_ceph_unittest(unittest_simple_spin ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_simple_spin)
708 target_link_libraries(unittest_simple_spin global)
709
710 # unittest_bufferlist
711 add_executable(unittest_bufferlist
712 bufferlist.cc
713 )
714 add_ceph_unittest(unittest_bufferlist ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_bufferlist)
715 target_link_libraries(unittest_bufferlist global)
716
717 # unittest_xlist
718 add_executable(unittest_xlist
719 test_xlist.cc
720 )
721 add_ceph_unittest(unittest_xlist ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_xlist)
722 target_link_libraries(unittest_xlist ceph-common ${XIO_LIBRARY})
723
724 # unittest_arch
725 add_executable(unittest_arch
726 test_arch.cc
727 $<TARGET_OBJECTS:unit-main>
728 )
729 add_ceph_unittest(unittest_arch ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_arch)
730 target_link_libraries(unittest_arch global)
731
732 # unittest_denc
733 add_executable(unittest_denc
734 test_denc.cc
735 )
736 add_ceph_unittest(unittest_denc ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_denc)
737 target_link_libraries(unittest_denc os global)
738
739 # unittest_mempool
740 add_executable(unittest_mempool
741 test_mempool.cc
742 )
743 add_ceph_unittest(unittest_mempool ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_mempool)
744 target_link_libraries(unittest_mempool global)
745
746 # unittest_features
747 add_executable(unittest_features
748 test_features.cc
749 )
750 add_ceph_unittest(unittest_features ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_features)
751 target_link_libraries(unittest_features global)
752
753 # unittest_crypto
754 add_executable(unittest_crypto
755 crypto.cc
756 $<TARGET_OBJECTS:unit-main>
757 )
758 add_ceph_unittest(unittest_crypto ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_crypto)
759 target_link_libraries(unittest_crypto global)
760
761 # unittest_crypto_init
762 add_executable(unittest_crypto_init
763 crypto_init.cc
764 )
765 add_ceph_unittest(unittest_crypto_init ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_crypto_init)
766 target_link_libraries(unittest_crypto_init global)
767
768 # unittest_perf_counters
769 add_executable(unittest_perf_counters
770 perf_counters.cc
771 )
772 add_ceph_unittest(unittest_perf_counters ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_perf_counters)
773 target_link_libraries(unittest_perf_counters global)
774
775 # unittest_ceph_crypto
776 add_executable(unittest_ceph_crypto
777 ceph_crypto.cc
778 )
779 add_ceph_unittest(unittest_ceph_crypto ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_crypto)
780 target_link_libraries(unittest_ceph_crypto global)
781
782 # unittest_utf8
783 add_executable(unittest_utf8
784 utf8.cc
785 )
786 add_ceph_unittest(unittest_utf8 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_utf8)
787 target_link_libraries(unittest_utf8 global)
788
789 # unittest_mime
790 add_executable(unittest_mime
791 mime.cc
792 )
793 add_ceph_unittest(unittest_mime ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_mime)
794 target_link_libraries(unittest_mime global)
795
796 # unittest_escape
797 add_executable(unittest_escape
798 escape.cc
799 )
800 add_ceph_unittest(unittest_escape ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_escape)
801 target_link_libraries(unittest_escape global)
802
803 # unittest_strtol
804 add_executable(unittest_strtol
805 strtol.cc
806 )
807 add_ceph_unittest(unittest_strtol ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_strtol)
808 target_link_libraries(unittest_strtol global)
809
810 # unittest_confutils
811 add_executable(unittest_confutils
812 confutils.cc
813 )
814 add_ceph_unittest(unittest_confutils ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_confutils)
815 target_link_libraries(unittest_confutils global)
816
817 # unittest_heartbeatmap
818 add_executable(unittest_heartbeatmap
819 heartbeat_map.cc
820 $<TARGET_OBJECTS:unit-main>
821 )
822 add_ceph_unittest(unittest_heartbeatmap ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_heartbeatmap)
823 target_link_libraries(unittest_heartbeatmap global ceph-common)
824
825 if(${WITH_RADOSGW})
826 # unittest_formatter
827 add_executable(unittest_formatter
828 formatter.cc
829 $<TARGET_OBJECTS:unit-main>
830 )
831 add_ceph_unittest(unittest_formatter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_formatter)
832 target_link_libraries(unittest_formatter global)
833 endif(${WITH_RADOSGW})
834
835 # unittest_daemon_config
836 add_executable(unittest_daemon_config
837 daemon_config.cc
838 $<TARGET_OBJECTS:unit-main>
839 )
840 add_ceph_unittest(unittest_daemon_config ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_daemon_config)
841 target_link_libraries(unittest_daemon_config
842 ceph-common
843 global
844 ${BLKID_LIBRARIES}
845 ${EXTRALIBS}
846 )
847
848 if(WITH_LIBCEPHFS)
849 # unittest_libcephfs_config
850 add_executable(unittest_libcephfs_config
851 libcephfs_config.cc
852 )
853 add_ceph_unittest(unittest_libcephfs_config ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_libcephfs_config)
854 target_link_libraries(unittest_libcephfs_config cephfs)
855 endif(WITH_LIBCEPHFS)
856
857 if(WITH_RBD)
858 # unittest_rbd_replay
859 add_executable(unittest_rbd_replay
860 test_rbd_replay.cc)
861 add_ceph_unittest(unittest_rbd_replay ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_rbd_replay)
862 target_link_libraries(unittest_rbd_replay
863 librbd
864 librados
865 global
866 rbd_replay
867 rbd_replay_ios
868 ${BLKID_LIBRARIES}
869 )
870 endif(WITH_RBD)
871
872 # unittest_ipaddr
873 add_executable(unittest_ipaddr
874 test_ipaddr.cc)
875 add_ceph_unittest(unittest_ipaddr ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ipaddr)
876 target_link_libraries(unittest_ipaddr mon global)
877
878 # unittest_texttable
879 add_executable(unittest_texttable
880 test_texttable.cc
881 $<TARGET_OBJECTS:common_texttable_obj>
882 )
883 add_ceph_unittest(unittest_texttable ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_texttable)
884 target_link_libraries(unittest_texttable mon global)
885
886 # unittest_on_exit
887 add_executable(unittest_on_exit
888 on_exit.cc
889 )
890 add_ceph_unittest(unittest_on_exit ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_on_exit)
891 target_link_libraries(unittest_on_exit global)
892
893 # unittest_subprocess
894 add_executable(unittest_subprocess
895 test_subprocess.cc
896 )
897 add_ceph_unittest(unittest_subprocess ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_subprocess)
898 target_link_libraries(unittest_subprocess global)
899
900 # unittest_pageset
901 add_executable(unittest_pageset test_pageset.cc)
902 add_ceph_unittest(unittest_pageset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_pageset)
903 target_link_libraries(unittest_pageset global)
904
905 #make check ends here
906