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