]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | include(AddCephTest) |
2 | ||
20effc67 TL |
3 | set(UNITTEST_LIBS GMock::Main GMock::GMock GTest::GTest ${CMAKE_THREAD_LIBS_INIT} |
4 | ${GSSAPI_LIBRARIES} ${CMAKE_DL_LIBS}) | |
7c673cae | 5 | |
f67539c2 TL |
6 | if(WIN32) |
7 | # Needed by Boost. | |
8 | list(APPEND UNITTEST_LIBS ws2_32) | |
9 | endif() | |
10 | ||
7c673cae | 11 | add_library(unit-main OBJECT unit.cc) |
11fdf7f2 TL |
12 | target_include_directories(unit-main PRIVATE |
13 | $<TARGET_PROPERTY:GTest::GTest,INTERFACE_INCLUDE_DIRECTORIES>) | |
7c673cae | 14 | |
7c673cae FG |
15 | add_subdirectory(common) |
16 | add_subdirectory(compressor) | |
17 | add_subdirectory(crush) | |
18 | add_subdirectory(direct_messenger) | |
19 | add_subdirectory(encoding) | |
7c673cae FG |
20 | add_subdirectory(librados) |
21 | add_subdirectory(librados_test_stub) | |
11fdf7f2 TL |
22 | if(WITH_LIBRADOSSTRIPER) |
23 | add_subdirectory(libradosstriper) | |
24 | endif() | |
f67539c2 TL |
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. | |
7c673cae | 28 | add_subdirectory(librbd) |
f67539c2 | 29 | endif(WITH_RBD AND NOT WIN32) |
11fdf7f2 TL |
30 | if (WITH_CEPHFS) |
31 | add_subdirectory(mds) | |
32 | endif() | |
7c673cae | 33 | add_subdirectory(pybind) |
f67539c2 TL |
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) | |
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 | 77 | endif(NOT WIN32) |
f67539c2 | 78 | |
11fdf7f2 TL |
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() | |
9f95a23c TL |
84 | if(WITH_RADOSGW_KAFKA_ENDPOINT) |
85 | list(APPEND rgw_libs kafka_stub) | |
86 | endif() | |
7c673cae | 87 | add_subdirectory(rgw) |
11fdf7f2 | 88 | endif(WITH_RADOSGW) |
f67539c2 TL |
89 | if(WITH_RBD AND NOT WIN32) |
90 | add_subdirectory(rbd_mirror) | |
91 | endif(WITH_RBD AND NOT WIN32) | |
11fdf7f2 TL |
92 | if(WITH_SEASTAR) |
93 | add_subdirectory(crimson) | |
94 | endif() | |
7c673cae | 95 | add_subdirectory(system) |
f67539c2 | 96 | if(WITH_FIO) |
7c673cae FG |
97 | add_subdirectory(fio) |
98 | endif() | |
494da23a | 99 | add_subdirectory(lazy-omap-stats) |
7c673cae FG |
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 | ) | |
9f95a23c | 117 | target_link_libraries(ceph_test_rewrite_latency ceph-common) |
7c673cae FG |
118 | |
119 | # test_crypt | |
120 | add_executable(test_crypto | |
9f95a23c | 121 | testcrypto.cc) |
7c673cae | 122 | target_link_libraries(test_crypto |
9f95a23c | 123 | ceph-common) |
7c673cae FG |
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 ${CRYPTO_LIBS} ${EXTRALIBS}) | |
137 | endif(WITH_LIBCEPHFS) | |
138 | ||
139 | add_executable(test_build_librados buildtest_skeleton.cc) | |
f67539c2 TL |
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() | |
7c673cae FG |
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 | ) | |
f67539c2 TL |
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() | |
7c673cae | 156 | |
20effc67 TL |
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 | ||
7c673cae FG |
163 | # ceph_test_mutate |
164 | add_executable(ceph_test_mutate | |
165 | test_mutate.cc | |
166 | ) | |
20effc67 | 167 | target_link_libraries(ceph_test_mutate global librados ${BLKID_LIBRARIES} |
7c673cae FG |
168 | ${CMAKE_DL_LIBS}) |
169 | ||
f67539c2 | 170 | if(NOT WIN32) |
7c673cae FG |
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}) | |
f67539c2 | 176 | endif() |
7c673cae FG |
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 | |
9f95a23c TL |
190 | ceph-common |
191 | Boost::program_options) | |
7c673cae FG |
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 | ||
f67539c2 TL |
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() | |
7c673cae FG |
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 | |
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) | |
276 | add_executable(ceph_test_librgw_file | |
277 | librgw_file.cc | |
278 | ) | |
7c673cae FG |
279 | target_link_libraries(ceph_test_librgw_file |
280 | rgw | |
281 | librados | |
282 | ceph-common | |
283 | ${UNITTEST_LIBS} | |
284 | ${EXTRALIBS} | |
285 | ) | |
f67539c2 | 286 | install(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) | |
289 | add_executable(ceph_test_librgw_file_cd | |
290 | librgw_file_cd.cc | |
291 | ) | |
7c673cae FG |
292 | target_link_libraries(ceph_test_librgw_file_cd |
293 | rgw | |
294 | librados | |
295 | ceph-common | |
296 | ${UNITTEST_LIBS} | |
297 | ${EXTRALIBS} | |
298 | ) | |
f67539c2 | 299 | install(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) | |
302 | add_executable(ceph_test_librgw_file_gp | |
303 | librgw_file_gp.cc | |
304 | ) | |
7c673cae FG |
305 | target_link_libraries(ceph_test_librgw_file_gp |
306 | rgw | |
307 | librados | |
308 | ceph-common | |
309 | ${UNITTEST_LIBS} | |
310 | ${EXTRALIBS} | |
311 | ) | |
f67539c2 | 312 | install(TARGETS ceph_test_librgw_file_gp DESTINATION ${CMAKE_INSTALL_BINDIR}) |
7c673cae FG |
313 | |
314 | # ceph_test_librgw_file_nfsns (nfs namespace tests) | |
315 | add_executable(ceph_test_librgw_file_nfsns | |
316 | librgw_file_nfsns.cc | |
317 | ) | |
f91f0fd5 | 318 | target_include_directories(ceph_test_librgw_file_nfsns SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw") |
7c673cae FG |
319 | target_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 | 327 | install(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) | |
330 | add_executable(ceph_test_librgw_file_aw | |
331 | librgw_file_aw.cc | |
332 | ) | |
7c673cae FG |
333 | target_link_libraries(ceph_test_librgw_file_aw |
334 | rgw | |
335 | librados | |
336 | ceph-common | |
337 | ${UNITTEST_LIBS} | |
338 | ${EXTRALIBS} | |
339 | ) | |
f67539c2 | 340 | install(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) |
343 | add_executable(ceph_test_librgw_file_marker | |
344 | librgw_file_marker.cc | |
345 | ) | |
f91f0fd5 | 346 | target_include_directories(ceph_test_librgw_file_marker SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw") |
3efd9988 FG |
347 | target_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 |
355 | install(TARGETS ceph_test_librgw_file_marker DESTINATION ${CMAKE_INSTALL_BINDIR}) |
356 | ||
357 | # ceph_test_librgw_file_xattr (attribute ops) | |
358 | add_executable(ceph_test_librgw_file_xattr | |
359 | librgw_file_xattr.cc | |
360 | ) | |
361 | target_include_directories(ceph_test_librgw_file_xattr SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw") | |
362 | target_link_libraries(ceph_test_librgw_file_xattr | |
363 | rgw | |
364 | librados | |
365 | ceph-common | |
366 | ${UNITTEST_LIBS} | |
367 | ${EXTRALIBS} | |
368 | ) | |
369 | target_link_libraries(ceph_test_librgw_file_xattr spawn) | |
3efd9988 | 370 | |
7c673cae FG |
371 | # ceph_test_rgw_token |
372 | add_executable(ceph_test_rgw_token | |
373 | test_rgw_token.cc | |
374 | ) | |
7c673cae FG |
375 | target_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) | |
383 | add_executable(test_rgw_ldap | |
384 | ${CMAKE_SOURCE_DIR}/src/rgw/rgw_ldap.cc | |
385 | test_rgw_ldap.cc | |
386 | ) | |
7c673cae FG |
387 | target_link_libraries(test_rgw_ldap |
388 | librados | |
389 | ceph-common | |
20effc67 TL |
390 | ${UNITTEST_LIBS}) |
391 | if(WITH_OPENLDAP) | |
392 | target_link_libraries(test_rgw_ldap | |
393 | OpenLDAP::OpenLDAP) | |
394 | endif() | |
7c673cae FG |
395 | endif(${WITH_RADOSGW}) |
396 | ||
397 | # ceph_multi_stress_watch | |
398 | add_executable(ceph_multi_stress_watch | |
399 | multi_stress_watch.cc | |
400 | ) | |
9f95a23c | 401 | target_link_libraries(ceph_multi_stress_watch librados global radostest-cxx) |
7c673cae | 402 | |
f67539c2 TL |
403 | install(TARGETS |
404 | ceph_bench_log | |
405 | ceph_multi_stress_watch | |
406 | ceph_omapbench | |
407 | DESTINATION bin) | |
408 | ||
409 | if(NOT WIN32) | |
7c673cae | 410 | #ceph_perf_local |
11fdf7f2 | 411 | add_executable(ceph_perf_local |
7c673cae FG |
412 | perf_local.cc |
413 | perf_helper.cc) | |
414 | if(HAVE_SSE) | |
415 | set(PERF_LOCAL_FLAGS ${SSE3_FLAGS}) | |
416 | endif(HAVE_SSE) | |
417 | if(HAVE_NEON) | |
418 | set(PERF_LOCAL_FLAGS ${ARM_NEON_FLAGS}) | |
419 | endif(HAVE_NEON) | |
420 | if(PERF_LOCAL_FLAGS) | |
421 | set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS | |
422 | ${PERF_LOCAL_FLAGS}) | |
423 | endif() | |
9f95a23c | 424 | target_link_libraries(ceph_perf_local global ${UNITTEST_LIBS}) |
7c673cae | 425 | |
7c673cae | 426 | install(TARGETS |
7c673cae | 427 | ceph_objectstore_bench |
7c673cae | 428 | ceph_perf_local |
7c673cae FG |
429 | DESTINATION bin) |
430 | ||
431 | # ceph_test_filejournal | |
432 | add_executable(ceph_test_filejournal | |
433 | test_filejournal.cc | |
434 | ) | |
7c673cae FG |
435 | target_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 | ) | |
445 | install(TARGETS | |
446 | ceph_test_filejournal | |
447 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
448 | ||
449 | # ceph_test_keys | |
450 | add_executable(ceph_test_keys | |
451 | testkeys.cc | |
452 | ) | |
453 | target_link_libraries(ceph_test_keys mon global ${CMAKE_DL_LIBS}) | |
454 | ||
455 | # ceph_test_snap_mapper | |
456 | add_executable(ceph_test_snap_mapper | |
457 | test_snap_mapper.cc | |
458 | $<TARGET_OBJECTS:unit-main> | |
459 | ) | |
460 | target_link_libraries(ceph_test_snap_mapper osd global ${BLKID_LIBRARIES} ${UNITTEST_LIBS}) | |
f67539c2 | 461 | endif(NOT WIN32) |
7c673cae FG |
462 | |
463 | add_executable(ceph_test_stress_watch | |
464 | test_stress_watch.cc | |
465 | ) | |
7c673cae FG |
466 | target_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 | ) | |
474 | install(TARGETS | |
475 | ceph_test_stress_watch | |
476 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
477 | ||
20effc67 TL |
478 | add_executable(ceph_test_c2c |
479 | test_c2c.cc | |
480 | ) | |
481 | target_link_libraries(ceph_test_c2c | |
482 | global | |
483 | ceph-common | |
484 | pthread | |
485 | ${EXTRALIBS} | |
486 | ${CMAKE_DL_LIBS} | |
487 | ) | |
488 | install(TARGETS | |
489 | ceph_test_c2c | |
490 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
491 | ||
7c673cae FG |
492 | if(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 |
499 | endif(WITH_FUSE) |
500 | ||
501 | if(${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) | |
508 | endif(${WITH_CEPHFS}) | |
509 | ||
11fdf7f2 TL |
510 | if(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 | 521 | endif(HAVE_BLKID OR FREEBSD) |
7c673cae | 522 | |
31f18b77 FG |
523 | # ceph_test_admin_socket_output |
524 | ||
11fdf7f2 TL |
525 | if(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}) | |
535 | endif() | |
31f18b77 | 536 | |
7c673cae FG |
537 | #make check starts here |
538 | ||
539 | #following dependencies are run inside make check unit tests | |
540 | add_dependencies(tests | |
7c673cae | 541 | ceph-authtool |
7c673cae FG |
542 | ceph-conf |
543 | rados | |
f67539c2 TL |
544 | ceph_snappy) |
545 | if(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 |
566 | if (WITH_CEPHFS) |
567 | add_dependencies(tests ceph-mds) | |
568 | endif() | |
569 | if(WITH_MGR) | |
570 | add_dependencies(tests ceph-mgr) | |
571 | endif() | |
7c673cae FG |
572 | if(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 |
577 | endif(WITH_RBD) |
578 | if(WITH_RADOSGW) | |
9f95a23c TL |
579 | add_dependencies(tests radosgwd radosgw-admin) |
580 | endif() | |
11fdf7f2 | 581 | #add dependency from fio just to ensure the plugin build isn't failing |
f67539c2 | 582 | if(WITH_FIO) |
11fdf7f2 TL |
583 | add_dependencies(tests fio_ceph_objectstore) |
584 | endif() | |
7c673cae | 585 | |
7c673cae | 586 | if(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 | 598 | endif(WITH_RBD) |
f67539c2 TL |
599 | |
600 | endif(NOT WIN32) | |
601 | ||
7c673cae | 602 | add_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 | 610 | add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh) |
7c673cae | 611 | |
11fdf7f2 TL |
612 | set_property( |
613 | TEST ${tox_tests} | |
614 | PROPERTY ENVIRONMENT ${env_vars_for_tox_tests}) | |
7c673cae FG |
615 | |
616 | # unittest_admin_socket | |
617 | add_executable(unittest_admin_socket | |
618 | admin_socket.cc | |
619 | $<TARGET_OBJECTS:unit-main> | |
620 | ) | |
11fdf7f2 TL |
621 | add_ceph_unittest(unittest_admin_socket) |
622 | target_link_libraries(unittest_admin_socket global) | |
7c673cae FG |
623 | |
624 | # unittest_encoding | |
625 | add_executable(unittest_encoding | |
626 | encoding.cc | |
627 | ) | |
11fdf7f2 TL |
628 | add_ceph_unittest(unittest_encoding) |
629 | target_link_libraries(unittest_encoding ceph-common) | |
7c673cae FG |
630 | |
631 | # unittest_addrs | |
632 | add_executable(unittest_addrs | |
633 | test_addrs.cc | |
634 | ) | |
11fdf7f2 TL |
635 | add_ceph_unittest(unittest_addrs) |
636 | target_link_libraries(unittest_addrs ceph-common) | |
637 | ||
638 | # unittest_auth | |
639 | add_executable(unittest_auth | |
640 | test_auth.cc | |
641 | $<TARGET_OBJECTS:unit-main> | |
642 | ) | |
643 | add_ceph_unittest(unittest_auth) | |
644 | target_link_libraries(unittest_auth global) | |
7c673cae FG |
645 | |
646 | # unittest_workqueue | |
647 | add_executable(unittest_workqueue | |
648 | test_workqueue.cc | |
649 | $<TARGET_OBJECTS:unit-main> | |
650 | ) | |
11fdf7f2 TL |
651 | add_ceph_unittest(unittest_workqueue) |
652 | target_link_libraries(unittest_workqueue global) | |
7c673cae FG |
653 | |
654 | # unittest_striper | |
11fdf7f2 TL |
655 | if(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}) | |
662 | endif() | |
7c673cae FG |
663 | |
664 | # unittest_str_list | |
665 | add_executable(unittest_str_list | |
666 | test_str_list.cc | |
667 | ) | |
11fdf7f2 TL |
668 | add_ceph_unittest(unittest_str_list) |
669 | target_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. | |
673 | if(NOT MINGW) | |
7c673cae FG |
674 | # unittest_log |
675 | add_executable(unittest_log | |
676 | ${CMAKE_SOURCE_DIR}/src/log/test.cc | |
677 | ) | |
11fdf7f2 | 678 | add_ceph_unittest(unittest_log) |
7c673cae | 679 | target_link_libraries(unittest_log global) |
f67539c2 | 680 | endif(NOT MINGW) |
7c673cae FG |
681 | |
682 | # unittest_base64 | |
683 | add_executable(unittest_base64 | |
684 | base64.cc | |
685 | ) | |
11fdf7f2 TL |
686 | add_ceph_unittest(unittest_base64) |
687 | target_link_libraries(unittest_base64 global) | |
7c673cae FG |
688 | |
689 | # unittest_ceph_argparse | |
690 | add_executable(unittest_ceph_argparse | |
691 | ceph_argparse.cc | |
692 | ) | |
11fdf7f2 | 693 | add_ceph_unittest(unittest_ceph_argparse) |
7c673cae FG |
694 | target_link_libraries(unittest_ceph_argparse global) |
695 | ||
696 | # unittest_ceph_compatset | |
697 | add_executable(unittest_ceph_compatset | |
698 | ceph_compatset.cc | |
699 | ) | |
11fdf7f2 | 700 | add_ceph_unittest(unittest_ceph_compatset) |
7c673cae FG |
701 | target_link_libraries(unittest_ceph_compatset global) |
702 | ||
703 | # unittest_gather | |
704 | add_executable(unittest_gather | |
705 | gather.cc | |
706 | $<TARGET_OBJECTS:unit-main> | |
707 | ) | |
11fdf7f2 | 708 | add_ceph_unittest(unittest_gather) |
7c673cae FG |
709 | target_link_libraries(unittest_gather global) |
710 | ||
711 | # unittest_run_cmd | |
712 | add_executable(unittest_run_cmd | |
713 | run_cmd.cc | |
714 | ) | |
11fdf7f2 | 715 | add_ceph_unittest(unittest_run_cmd) |
7c673cae FG |
716 | target_link_libraries(unittest_run_cmd global) |
717 | ||
f67539c2 | 718 | if(NOT WIN32) |
7c673cae FG |
719 | # signals |
720 | add_executable(unittest_signals | |
721 | signals.cc | |
722 | $<TARGET_OBJECTS:unit-main> | |
723 | ) | |
11fdf7f2 | 724 | add_ceph_unittest(unittest_signals) |
7c673cae | 725 | target_link_libraries(unittest_signals global) |
f67539c2 | 726 | endif() |
7c673cae FG |
727 | |
728 | # unittest_simple_spin | |
729 | add_executable(unittest_simple_spin | |
730 | simple_spin.cc | |
731 | ) | |
11fdf7f2 | 732 | add_ceph_unittest(unittest_simple_spin) |
7c673cae FG |
733 | target_link_libraries(unittest_simple_spin global) |
734 | ||
735 | # unittest_bufferlist | |
736 | add_executable(unittest_bufferlist | |
737 | bufferlist.cc | |
11fdf7f2 | 738 | $<TARGET_OBJECTS:unit-main> |
7c673cae | 739 | ) |
11fdf7f2 | 740 | add_ceph_unittest(unittest_bufferlist) |
7c673cae FG |
741 | target_link_libraries(unittest_bufferlist global) |
742 | ||
9f95a23c TL |
743 | # compiletest_cxx11_client |
744 | add_executable(compiletest_cxx11_client | |
745 | cxx11_client.cc | |
746 | ) | |
747 | if(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 | ) | |
753 | else() | |
754 | set_target_properties(compiletest_cxx11_client | |
755 | PROPERTIES COMPILE_FLAGS "-Werror -pedantic" | |
756 | CMAKE_CXX_STANDARD 11 | |
757 | CXX_STANDARD_REQUIRED ON | |
758 | ) | |
759 | endif() | |
760 | add_ceph_test(compiletest_cxx11_client | |
761 | "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/compiletest_cxx11_client" | |
762 | ) | |
763 | target_link_libraries(compiletest_cxx11_client global) | |
764 | ||
7c673cae FG |
765 | # unittest_xlist |
766 | add_executable(unittest_xlist | |
767 | test_xlist.cc | |
768 | ) | |
11fdf7f2 TL |
769 | add_ceph_unittest(unittest_xlist) |
770 | target_link_libraries(unittest_xlist ceph-common) | |
7c673cae FG |
771 | |
772 | # unittest_arch | |
773 | add_executable(unittest_arch | |
774 | test_arch.cc | |
775 | $<TARGET_OBJECTS:unit-main> | |
776 | ) | |
11fdf7f2 | 777 | add_ceph_unittest(unittest_arch) |
7c673cae FG |
778 | target_link_libraries(unittest_arch global) |
779 | ||
780 | # unittest_denc | |
781 | add_executable(unittest_denc | |
782 | test_denc.cc | |
783 | ) | |
11fdf7f2 TL |
784 | add_ceph_unittest(unittest_denc) |
785 | target_link_libraries(unittest_denc global) | |
7c673cae FG |
786 | |
787 | # unittest_mempool | |
788 | add_executable(unittest_mempool | |
789 | test_mempool.cc | |
790 | ) | |
11fdf7f2 | 791 | add_ceph_unittest(unittest_mempool) |
7c673cae FG |
792 | target_link_libraries(unittest_mempool global) |
793 | ||
31f18b77 FG |
794 | # unittest_features |
795 | add_executable(unittest_features | |
796 | test_features.cc | |
797 | ) | |
11fdf7f2 | 798 | add_ceph_unittest(unittest_features) |
31f18b77 FG |
799 | target_link_libraries(unittest_features global) |
800 | ||
7c673cae FG |
801 | # unittest_crypto |
802 | add_executable(unittest_crypto | |
803 | crypto.cc | |
804 | $<TARGET_OBJECTS:unit-main> | |
805 | ) | |
11fdf7f2 | 806 | add_ceph_unittest(unittest_crypto) |
7c673cae FG |
807 | target_link_libraries(unittest_crypto global) |
808 | ||
809 | # unittest_crypto_init | |
810 | add_executable(unittest_crypto_init | |
811 | crypto_init.cc | |
812 | ) | |
11fdf7f2 | 813 | add_ceph_unittest(unittest_crypto_init) |
7c673cae FG |
814 | target_link_libraries(unittest_crypto_init global) |
815 | ||
816 | # unittest_perf_counters | |
817 | add_executable(unittest_perf_counters | |
818 | perf_counters.cc | |
819 | ) | |
11fdf7f2 | 820 | add_ceph_unittest(unittest_perf_counters) |
7c673cae FG |
821 | target_link_libraries(unittest_perf_counters global) |
822 | ||
823 | # unittest_ceph_crypto | |
824 | add_executable(unittest_ceph_crypto | |
9f95a23c | 825 | ceph_crypto.cc) |
11fdf7f2 | 826 | add_ceph_unittest(unittest_ceph_crypto) |
7c673cae FG |
827 | target_link_libraries(unittest_ceph_crypto global) |
828 | ||
829 | # unittest_utf8 | |
830 | add_executable(unittest_utf8 | |
9f95a23c | 831 | utf8.cc) |
11fdf7f2 | 832 | add_ceph_unittest(unittest_utf8) |
7c673cae FG |
833 | target_link_libraries(unittest_utf8 global) |
834 | ||
835 | # unittest_mime | |
836 | add_executable(unittest_mime | |
9f95a23c | 837 | mime.cc) |
11fdf7f2 | 838 | add_ceph_unittest(unittest_mime) |
9f95a23c | 839 | target_link_libraries(unittest_mime ceph-common) |
7c673cae FG |
840 | |
841 | # unittest_escape | |
842 | add_executable(unittest_escape | |
9f95a23c | 843 | escape.cc) |
11fdf7f2 | 844 | add_ceph_unittest(unittest_escape) |
9f95a23c | 845 | target_link_libraries(unittest_escape ceph-common) |
7c673cae FG |
846 | |
847 | # unittest_strtol | |
848 | add_executable(unittest_strtol | |
9f95a23c | 849 | strtol.cc) |
11fdf7f2 | 850 | add_ceph_unittest(unittest_strtol) |
9f95a23c | 851 | target_link_libraries(unittest_strtol ceph-common) |
7c673cae FG |
852 | |
853 | # unittest_confutils | |
854 | add_executable(unittest_confutils | |
9f95a23c | 855 | confutils.cc) |
11fdf7f2 | 856 | add_ceph_unittest(unittest_confutils) |
9f95a23c | 857 | target_link_libraries(unittest_confutils ceph-common) |
7c673cae FG |
858 | |
859 | # unittest_heartbeatmap | |
860 | add_executable(unittest_heartbeatmap | |
861 | heartbeat_map.cc | |
862 | $<TARGET_OBJECTS:unit-main> | |
863 | ) | |
11fdf7f2 | 864 | add_ceph_unittest(unittest_heartbeatmap) |
7c673cae FG |
865 | target_link_libraries(unittest_heartbeatmap global ceph-common) |
866 | ||
867 | if(${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) |
875 | endif(${WITH_RADOSGW}) | |
876 | ||
877 | # unittest_daemon_config | |
878 | add_executable(unittest_daemon_config | |
879 | daemon_config.cc | |
880 | $<TARGET_OBJECTS:unit-main> | |
881 | ) | |
11fdf7f2 | 882 | add_ceph_unittest(unittest_daemon_config) |
7c673cae FG |
883 | target_link_libraries(unittest_daemon_config |
884 | ceph-common | |
885 | global | |
886 | ${BLKID_LIBRARIES} | |
887 | ${EXTRALIBS} | |
888 | ) | |
889 | ||
890 | if(WITH_LIBCEPHFS) | |
891 | # unittest_libcephfs_config | |
892 | add_executable(unittest_libcephfs_config | |
893 | libcephfs_config.cc | |
894 | ) | |
11fdf7f2 | 895 | add_ceph_unittest(unittest_libcephfs_config) |
7c673cae FG |
896 | target_link_libraries(unittest_libcephfs_config cephfs) |
897 | endif(WITH_LIBCEPHFS) | |
898 | ||
899 | if(WITH_RBD) | |
900 | # unittest_rbd_replay | |
901 | add_executable(unittest_rbd_replay | |
902 | test_rbd_replay.cc) | |
11fdf7f2 | 903 | add_ceph_unittest(unittest_rbd_replay) |
7c673cae FG |
904 | target_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 | ) | |
913 | endif(WITH_RBD) | |
914 | ||
915 | # unittest_ipaddr | |
916 | add_executable(unittest_ipaddr | |
11fdf7f2 TL |
917 | test_ipaddr.cc) |
918 | add_ceph_unittest(unittest_ipaddr) | |
f67539c2 | 919 | target_link_libraries(unittest_ipaddr global GTest::Main) |
9f95a23c TL |
920 | |
921 | # unittest_utime | |
922 | add_executable(unittest_utime | |
923 | test_utime.cc) | |
924 | add_ceph_unittest(unittest_utime) | |
925 | target_link_libraries(unittest_utime ceph-common) | |
7c673cae FG |
926 | |
927 | # unittest_texttable | |
928 | add_executable(unittest_texttable | |
929 | test_texttable.cc | |
9f95a23c | 930 | $<TARGET_OBJECTS:common_texttable_obj>) |
11fdf7f2 | 931 | add_ceph_unittest(unittest_texttable) |
9f95a23c | 932 | target_link_libraries(unittest_texttable ceph-common) |
7c673cae | 933 | |
f67539c2 | 934 | if(NOT WIN32) |
7c673cae FG |
935 | # unittest_on_exit |
936 | add_executable(unittest_on_exit | |
9f95a23c | 937 | on_exit.cc) |
11fdf7f2 | 938 | add_ceph_unittest(unittest_on_exit) |
9f95a23c | 939 | target_link_libraries(unittest_on_exit ceph-common) |
f67539c2 | 940 | endif() |
7c673cae FG |
941 | |
942 | # unittest_subprocess | |
943 | add_executable(unittest_subprocess | |
9f95a23c | 944 | test_subprocess.cc) |
11fdf7f2 | 945 | add_ceph_unittest(unittest_subprocess) |
9f95a23c | 946 | target_link_libraries(unittest_subprocess ceph-common) |
7c673cae FG |
947 | |
948 | # unittest_pageset | |
949 | add_executable(unittest_pageset test_pageset.cc) | |
11fdf7f2 | 950 | add_ceph_unittest(unittest_pageset) |
9f95a23c TL |
951 | target_link_libraries(unittest_pageset ceph-common) |
952 | ||
953 | add_executable(unittest_random_string test_random_string.cc $<TARGET_OBJECTS:unit-main>) | |
954 | add_ceph_unittest(unittest_random_string) | |
955 | target_link_libraries(unittest_random_string global) | |
7c673cae | 956 | |
11fdf7f2 TL |
957 | # unittest_any_ |
958 | add_executable(unittest_any test_any.cc) | |
959 | add_ceph_unittest(unittest_any) | |
9f95a23c TL |
960 | |
961 | # unittest_weighted_shuffle | |
962 | add_executable(unittest_weighted_shuffle test_weighted_shuffle.cc) | |
963 | add_ceph_unittest(unittest_weighted_shuffle) | |
7c673cae | 964 | |
20effc67 TL |
965 | add_executable(unittest_intarith test_intarith.cc) |
966 | add_ceph_unittest(unittest_intarith) | |
11fdf7f2 | 967 | #make check ends here |