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