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