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