]>
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) | |
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 | 78 | endif(NOT WIN32) |
f67539c2 | 79 | |
11fdf7f2 TL |
80 | if(WITH_RADOSGW) |
81 | set(rgw_libs rgw_a) | |
82 | if(WITH_RADOSGW_AMQP_ENDPOINT) | |
83 | list(APPEND rgw_libs amqp_mock) | |
84 | endif() | |
9f95a23c TL |
85 | if(WITH_RADOSGW_KAFKA_ENDPOINT) |
86 | list(APPEND rgw_libs kafka_stub) | |
87 | endif() | |
7c673cae | 88 | add_subdirectory(rgw) |
11fdf7f2 | 89 | endif(WITH_RADOSGW) |
f67539c2 TL |
90 | if(WITH_RBD AND NOT WIN32) |
91 | add_subdirectory(rbd_mirror) | |
92 | endif(WITH_RBD AND NOT WIN32) | |
11fdf7f2 TL |
93 | if(WITH_SEASTAR) |
94 | add_subdirectory(crimson) | |
95 | endif() | |
7c673cae | 96 | add_subdirectory(system) |
f67539c2 | 97 | if(WITH_FIO) |
7c673cae FG |
98 | add_subdirectory(fio) |
99 | endif() | |
494da23a | 100 | add_subdirectory(lazy-omap-stats) |
7c673cae FG |
101 | |
102 | # test_timers | |
103 | add_executable(ceph_test_timers | |
104 | TestTimers.cc | |
105 | ) | |
106 | target_link_libraries(ceph_test_timers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
107 | ||
108 | # test_signal_handlers | |
109 | add_executable(ceph_test_signal_handlers | |
110 | TestSignalHandlers.cc | |
111 | ) | |
112 | target_link_libraries(ceph_test_signal_handlers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
113 | ||
114 | # test_rewrite_latency | |
115 | add_executable(ceph_test_rewrite_latency | |
116 | test_rewrite_latency.cc | |
117 | ) | |
9f95a23c | 118 | target_link_libraries(ceph_test_rewrite_latency ceph-common) |
7c673cae FG |
119 | |
120 | # test_crypt | |
121 | add_executable(test_crypto | |
9f95a23c | 122 | testcrypto.cc) |
7c673cae | 123 | target_link_libraries(test_crypto |
9f95a23c | 124 | ceph-common) |
7c673cae FG |
125 | |
126 | add_executable(test_build_libcommon buildtest_skeleton.cc) | |
127 | target_link_libraries(test_build_libcommon ceph-common pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
128 | ||
129 | if(WITH_RADOSGW) | |
130 | add_executable(test_build_librgw buildtest_skeleton.cc) | |
131 | target_link_libraries(test_build_librgw rgw_a pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
132 | endif(WITH_RADOSGW) | |
133 | ||
134 | if(WITH_LIBCEPHFS) | |
135 | # From src/test/Makefile-client.am: I dont get this one... testing the osdc build but link in libcephfs? | |
136 | add_executable(test_build_libcephfs buildtest_skeleton.cc) | |
137 | target_link_libraries(test_build_libcephfs cephfs pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
138 | endif(WITH_LIBCEPHFS) | |
139 | ||
140 | add_executable(test_build_librados buildtest_skeleton.cc) | |
f67539c2 TL |
141 | target_link_libraries(test_build_librados librados pthread ${CRYPTO_LIBS} ${EXTRALIBS} ceph-common ${BLKID_LIBRARIES}) |
142 | if(NOT WIN32) | |
143 | target_link_libraries(test_build_librados os osdc osd cls_lock_client) | |
144 | endif() | |
7c673cae FG |
145 | |
146 | # bench_log | |
147 | set(bench_log_srcs | |
148 | bench_log.cc | |
149 | ) | |
150 | add_executable(ceph_bench_log | |
151 | ${bench_log_srcs} | |
152 | ) | |
f67539c2 TL |
153 | target_link_libraries(ceph_bench_log global pthread ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) |
154 | if(NOT WIN32) | |
155 | target_link_libraries(ceph_bench_log rt) | |
156 | endif() | |
7c673cae | 157 | |
20effc67 TL |
158 | if(WITH_SYSTEMD) |
159 | add_executable(ceph_bench_journald_logger | |
160 | bench_journald_logger.cc) | |
161 | target_link_libraries(ceph_bench_journald_logger ceph-common) | |
162 | endif() | |
163 | ||
7c673cae FG |
164 | # ceph_test_mutate |
165 | add_executable(ceph_test_mutate | |
166 | test_mutate.cc | |
167 | ) | |
20effc67 | 168 | target_link_libraries(ceph_test_mutate global librados ${BLKID_LIBRARIES} |
7c673cae FG |
169 | ${CMAKE_DL_LIBS}) |
170 | ||
f67539c2 | 171 | if(NOT WIN32) |
7c673cae FG |
172 | # test_trans |
173 | add_executable(test_trans | |
174 | test_trans.cc | |
175 | ) | |
176 | target_link_libraries(test_trans os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
f67539c2 | 177 | endif() |
7c673cae FG |
178 | |
179 | ## Benchmarks | |
180 | ||
181 | ||
182 | # ceph_omapbench | |
183 | set(omapbench_srcs | |
184 | omap_bench.cc | |
185 | ) | |
186 | add_executable(ceph_omapbench | |
187 | ${omapbench_srcs} | |
188 | ) | |
189 | target_link_libraries(ceph_omapbench | |
190 | librados | |
9f95a23c TL |
191 | ceph-common |
192 | Boost::program_options) | |
7c673cae FG |
193 | |
194 | if(WITH_KVS) | |
195 | # ceph_kvstorebench | |
196 | set(kvstorebench_srcs | |
197 | kv_store_bench.cc | |
198 | ${CMAKE_SOURCE_DIR}/src/key_value_store/kv_flat_btree_async.cc | |
199 | ) | |
200 | add_executable(ceph_kvstorebench ${kvstorebench_srcs}) | |
201 | target_link_libraries(ceph_kvstorebench librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
202 | install(TARGETS ceph_kvstorebench DESTINATION bin) | |
203 | endif(WITH_KVS) | |
204 | ||
f67539c2 TL |
205 | if(NOT WIN32) |
206 | # ceph_objectstore_bench | |
207 | add_executable(ceph_objectstore_bench objectstore_bench.cc) | |
208 | target_link_libraries(ceph_objectstore_bench os global ${BLKID_LIBRARIES}) | |
209 | endif() | |
7c673cae FG |
210 | |
211 | if(${WITH_RADOSGW}) | |
212 | # test_cors | |
213 | set(test_cors_srcs test_cors.cc) | |
214 | add_executable(test_cors | |
215 | ${test_cors_srcs} | |
216 | ) | |
217 | target_link_libraries(test_cors | |
218 | librados | |
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) | |
277 | add_executable(ceph_test_librgw_file | |
278 | librgw_file.cc | |
279 | ) | |
7c673cae FG |
280 | target_link_libraries(ceph_test_librgw_file |
281 | rgw | |
282 | librados | |
283 | ceph-common | |
284 | ${UNITTEST_LIBS} | |
285 | ${EXTRALIBS} | |
286 | ) | |
f67539c2 | 287 | install(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) | |
290 | add_executable(ceph_test_librgw_file_cd | |
291 | librgw_file_cd.cc | |
292 | ) | |
7c673cae FG |
293 | target_link_libraries(ceph_test_librgw_file_cd |
294 | rgw | |
295 | librados | |
296 | ceph-common | |
297 | ${UNITTEST_LIBS} | |
298 | ${EXTRALIBS} | |
299 | ) | |
f67539c2 | 300 | install(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) | |
303 | add_executable(ceph_test_librgw_file_gp | |
304 | librgw_file_gp.cc | |
305 | ) | |
7c673cae FG |
306 | target_link_libraries(ceph_test_librgw_file_gp |
307 | rgw | |
308 | librados | |
309 | ceph-common | |
310 | ${UNITTEST_LIBS} | |
311 | ${EXTRALIBS} | |
312 | ) | |
f67539c2 | 313 | install(TARGETS ceph_test_librgw_file_gp DESTINATION ${CMAKE_INSTALL_BINDIR}) |
7c673cae FG |
314 | |
315 | # ceph_test_librgw_file_nfsns (nfs namespace tests) | |
316 | add_executable(ceph_test_librgw_file_nfsns | |
317 | librgw_file_nfsns.cc | |
318 | ) | |
f91f0fd5 | 319 | target_include_directories(ceph_test_librgw_file_nfsns SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw") |
7c673cae FG |
320 | target_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 | 328 | install(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) | |
331 | add_executable(ceph_test_librgw_file_aw | |
332 | librgw_file_aw.cc | |
333 | ) | |
7c673cae FG |
334 | target_link_libraries(ceph_test_librgw_file_aw |
335 | rgw | |
336 | librados | |
337 | ceph-common | |
338 | ${UNITTEST_LIBS} | |
339 | ${EXTRALIBS} | |
340 | ) | |
f67539c2 | 341 | install(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) |
344 | add_executable(ceph_test_librgw_file_marker | |
345 | librgw_file_marker.cc | |
346 | ) | |
f91f0fd5 | 347 | target_include_directories(ceph_test_librgw_file_marker SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw") |
3efd9988 FG |
348 | target_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 |
356 | install(TARGETS ceph_test_librgw_file_marker DESTINATION ${CMAKE_INSTALL_BINDIR}) |
357 | ||
358 | # ceph_test_librgw_file_xattr (attribute ops) | |
359 | add_executable(ceph_test_librgw_file_xattr | |
360 | librgw_file_xattr.cc | |
361 | ) | |
362 | target_include_directories(ceph_test_librgw_file_xattr SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw") | |
363 | target_link_libraries(ceph_test_librgw_file_xattr | |
364 | rgw | |
365 | librados | |
366 | ceph-common | |
367 | ${UNITTEST_LIBS} | |
368 | ${EXTRALIBS} | |
369 | ) | |
370 | target_link_libraries(ceph_test_librgw_file_xattr spawn) | |
3efd9988 | 371 | |
7c673cae FG |
372 | # ceph_test_rgw_token |
373 | add_executable(ceph_test_rgw_token | |
374 | test_rgw_token.cc | |
375 | ) | |
7c673cae FG |
376 | target_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) | |
384 | add_executable(test_rgw_ldap | |
385 | ${CMAKE_SOURCE_DIR}/src/rgw/rgw_ldap.cc | |
386 | test_rgw_ldap.cc | |
387 | ) | |
7c673cae FG |
388 | target_link_libraries(test_rgw_ldap |
389 | librados | |
390 | ceph-common | |
20effc67 TL |
391 | ${UNITTEST_LIBS}) |
392 | if(WITH_OPENLDAP) | |
393 | target_link_libraries(test_rgw_ldap | |
394 | OpenLDAP::OpenLDAP) | |
395 | endif() | |
7c673cae FG |
396 | endif(${WITH_RADOSGW}) |
397 | ||
398 | # ceph_multi_stress_watch | |
399 | add_executable(ceph_multi_stress_watch | |
400 | multi_stress_watch.cc | |
401 | ) | |
9f95a23c | 402 | target_link_libraries(ceph_multi_stress_watch librados global radostest-cxx) |
7c673cae | 403 | |
f67539c2 TL |
404 | install(TARGETS |
405 | ceph_bench_log | |
406 | ceph_multi_stress_watch | |
407 | ceph_omapbench | |
408 | DESTINATION bin) | |
409 | ||
410 | if(NOT WIN32) | |
7c673cae | 411 | #ceph_perf_local |
11fdf7f2 | 412 | add_executable(ceph_perf_local |
7c673cae FG |
413 | perf_local.cc |
414 | perf_helper.cc) | |
415 | if(HAVE_SSE) | |
416 | set(PERF_LOCAL_FLAGS ${SSE3_FLAGS}) | |
417 | endif(HAVE_SSE) | |
418 | if(HAVE_NEON) | |
419 | set(PERF_LOCAL_FLAGS ${ARM_NEON_FLAGS}) | |
420 | endif(HAVE_NEON) | |
421 | if(PERF_LOCAL_FLAGS) | |
422 | set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS | |
423 | ${PERF_LOCAL_FLAGS}) | |
424 | endif() | |
9f95a23c | 425 | target_link_libraries(ceph_perf_local global ${UNITTEST_LIBS}) |
7c673cae | 426 | |
7c673cae | 427 | install(TARGETS |
7c673cae | 428 | ceph_objectstore_bench |
7c673cae | 429 | ceph_perf_local |
7c673cae FG |
430 | DESTINATION bin) |
431 | ||
432 | # ceph_test_filejournal | |
433 | add_executable(ceph_test_filejournal | |
434 | test_filejournal.cc | |
435 | ) | |
7c673cae FG |
436 | target_link_libraries(ceph_test_filejournal |
437 | os | |
438 | ceph-common | |
439 | ${UNITTEST_LIBS} | |
440 | global | |
441 | ${EXTRALIBS} | |
442 | ${BLKID_LIBRARIES} | |
443 | ${CMAKE_DL_LIBS} | |
444 | ${EXTRALIBS} | |
445 | ) | |
446 | install(TARGETS | |
447 | ceph_test_filejournal | |
448 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
449 | ||
450 | # ceph_test_keys | |
451 | add_executable(ceph_test_keys | |
452 | testkeys.cc | |
453 | ) | |
454 | target_link_libraries(ceph_test_keys mon global ${CMAKE_DL_LIBS}) | |
455 | ||
456 | # ceph_test_snap_mapper | |
457 | add_executable(ceph_test_snap_mapper | |
458 | test_snap_mapper.cc | |
459 | $<TARGET_OBJECTS:unit-main> | |
460 | ) | |
461 | target_link_libraries(ceph_test_snap_mapper osd global ${BLKID_LIBRARIES} ${UNITTEST_LIBS}) | |
f67539c2 | 462 | endif(NOT WIN32) |
7c673cae FG |
463 | |
464 | add_executable(ceph_test_stress_watch | |
465 | test_stress_watch.cc | |
466 | ) | |
7c673cae FG |
467 | target_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 | ) | |
475 | install(TARGETS | |
476 | ceph_test_stress_watch | |
477 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
478 | ||
20effc67 TL |
479 | add_executable(ceph_test_c2c |
480 | test_c2c.cc | |
481 | ) | |
482 | target_link_libraries(ceph_test_c2c | |
483 | global | |
484 | ceph-common | |
485 | pthread | |
486 | ${EXTRALIBS} | |
487 | ${CMAKE_DL_LIBS} | |
488 | ) | |
489 | install(TARGETS | |
490 | ceph_test_c2c | |
491 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
492 | ||
7c673cae FG |
493 | if(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 |
500 | endif(WITH_FUSE) |
501 | ||
502 | if(${WITH_CEPHFS}) | |
503 | add_executable(test_c_headers | |
504 | test_c_headers.c | |
505 | ) | |
506 | target_link_libraries(test_c_headers | |
507 | librados | |
508 | cephfs) | |
509 | endif(${WITH_CEPHFS}) | |
510 | ||
11fdf7f2 TL |
511 | if(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 | 522 | endif(HAVE_BLKID OR FREEBSD) |
7c673cae | 523 | |
31f18b77 FG |
524 | # ceph_test_admin_socket_output |
525 | ||
11fdf7f2 TL |
526 | if(StdFilesystem_FOUND) |
527 | add_executable(ceph_test_admin_socket_output | |
528 | test_admin_socket_output.cc | |
529 | admin_socket_output.cc | |
530 | admin_socket_output_tests.cc) | |
531 | target_link_libraries(ceph_test_admin_socket_output | |
532 | ceph-common StdFilesystem::filesystem) | |
533 | install(TARGETS | |
534 | ceph_test_admin_socket_output | |
535 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
536 | endif() | |
31f18b77 | 537 | |
7c673cae FG |
538 | #make check starts here |
539 | ||
540 | #following dependencies are run inside make check unit tests | |
541 | add_dependencies(tests | |
7c673cae | 542 | ceph-authtool |
7c673cae FG |
543 | ceph-conf |
544 | rados | |
f67539c2 TL |
545 | ceph_snappy) |
546 | if(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 |
567 | if (WITH_CEPHFS) |
568 | add_dependencies(tests ceph-mds) | |
569 | endif() | |
570 | if(WITH_MGR) | |
571 | add_dependencies(tests ceph-mgr) | |
572 | endif() | |
7c673cae FG |
573 | if(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 |
578 | endif(WITH_RBD) |
579 | if(WITH_RADOSGW) | |
9f95a23c TL |
580 | add_dependencies(tests radosgwd radosgw-admin) |
581 | endif() | |
11fdf7f2 | 582 | #add dependency from fio just to ensure the plugin build isn't failing |
f67539c2 | 583 | if(WITH_FIO) |
11fdf7f2 TL |
584 | add_dependencies(tests fio_ceph_objectstore) |
585 | endif() | |
7c673cae | 586 | |
7c673cae | 587 | if(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 | 599 | endif(WITH_RBD) |
f67539c2 TL |
600 | |
601 | endif(NOT WIN32) | |
602 | ||
7c673cae | 603 | add_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 | 611 | add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh) |
7c673cae | 612 | |
11fdf7f2 TL |
613 | set_property( |
614 | TEST ${tox_tests} | |
615 | PROPERTY ENVIRONMENT ${env_vars_for_tox_tests}) | |
7c673cae FG |
616 | |
617 | # unittest_admin_socket | |
618 | add_executable(unittest_admin_socket | |
619 | admin_socket.cc | |
620 | $<TARGET_OBJECTS:unit-main> | |
621 | ) | |
11fdf7f2 TL |
622 | add_ceph_unittest(unittest_admin_socket) |
623 | target_link_libraries(unittest_admin_socket global) | |
7c673cae FG |
624 | |
625 | # unittest_encoding | |
626 | add_executable(unittest_encoding | |
627 | encoding.cc | |
628 | ) | |
11fdf7f2 TL |
629 | add_ceph_unittest(unittest_encoding) |
630 | target_link_libraries(unittest_encoding ceph-common) | |
7c673cae FG |
631 | |
632 | # unittest_addrs | |
633 | add_executable(unittest_addrs | |
634 | test_addrs.cc | |
635 | ) | |
11fdf7f2 TL |
636 | add_ceph_unittest(unittest_addrs) |
637 | target_link_libraries(unittest_addrs ceph-common) | |
638 | ||
639 | # unittest_auth | |
640 | add_executable(unittest_auth | |
641 | test_auth.cc | |
642 | $<TARGET_OBJECTS:unit-main> | |
643 | ) | |
644 | add_ceph_unittest(unittest_auth) | |
645 | target_link_libraries(unittest_auth global) | |
7c673cae FG |
646 | |
647 | # unittest_workqueue | |
648 | add_executable(unittest_workqueue | |
649 | test_workqueue.cc | |
650 | $<TARGET_OBJECTS:unit-main> | |
651 | ) | |
11fdf7f2 TL |
652 | add_ceph_unittest(unittest_workqueue) |
653 | target_link_libraries(unittest_workqueue global) | |
7c673cae FG |
654 | |
655 | # unittest_striper | |
11fdf7f2 TL |
656 | if(WITH_LIBRADOSSTRIPER) |
657 | add_executable(unittest_striper | |
658 | test_striper.cc | |
659 | $<TARGET_OBJECTS:unit-main> | |
660 | ) | |
661 | add_ceph_unittest(unittest_striper) | |
662 | target_link_libraries(unittest_striper global ${BLKID_LIBRARIES}) | |
663 | endif() | |
7c673cae FG |
664 | |
665 | # unittest_str_list | |
666 | add_executable(unittest_str_list | |
667 | test_str_list.cc | |
668 | ) | |
11fdf7f2 TL |
669 | add_ceph_unittest(unittest_str_list) |
670 | target_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. | |
674 | if(NOT MINGW) | |
7c673cae FG |
675 | # unittest_log |
676 | add_executable(unittest_log | |
677 | ${CMAKE_SOURCE_DIR}/src/log/test.cc | |
678 | ) | |
11fdf7f2 | 679 | add_ceph_unittest(unittest_log) |
7c673cae | 680 | target_link_libraries(unittest_log global) |
f67539c2 | 681 | endif(NOT MINGW) |
7c673cae FG |
682 | |
683 | # unittest_base64 | |
684 | add_executable(unittest_base64 | |
685 | base64.cc | |
686 | ) | |
11fdf7f2 TL |
687 | add_ceph_unittest(unittest_base64) |
688 | target_link_libraries(unittest_base64 global) | |
7c673cae FG |
689 | |
690 | # unittest_ceph_argparse | |
691 | add_executable(unittest_ceph_argparse | |
692 | ceph_argparse.cc | |
693 | ) | |
11fdf7f2 | 694 | add_ceph_unittest(unittest_ceph_argparse) |
7c673cae FG |
695 | target_link_libraries(unittest_ceph_argparse global) |
696 | ||
697 | # unittest_ceph_compatset | |
698 | add_executable(unittest_ceph_compatset | |
699 | ceph_compatset.cc | |
700 | ) | |
11fdf7f2 | 701 | add_ceph_unittest(unittest_ceph_compatset) |
7c673cae FG |
702 | target_link_libraries(unittest_ceph_compatset global) |
703 | ||
704 | # unittest_gather | |
705 | add_executable(unittest_gather | |
706 | gather.cc | |
707 | $<TARGET_OBJECTS:unit-main> | |
708 | ) | |
11fdf7f2 | 709 | add_ceph_unittest(unittest_gather) |
7c673cae FG |
710 | target_link_libraries(unittest_gather global) |
711 | ||
712 | # unittest_run_cmd | |
713 | add_executable(unittest_run_cmd | |
714 | run_cmd.cc | |
715 | ) | |
11fdf7f2 | 716 | add_ceph_unittest(unittest_run_cmd) |
7c673cae FG |
717 | target_link_libraries(unittest_run_cmd global) |
718 | ||
f67539c2 | 719 | if(NOT WIN32) |
7c673cae FG |
720 | # signals |
721 | add_executable(unittest_signals | |
722 | signals.cc | |
723 | $<TARGET_OBJECTS:unit-main> | |
724 | ) | |
11fdf7f2 | 725 | add_ceph_unittest(unittest_signals) |
7c673cae | 726 | target_link_libraries(unittest_signals global) |
f67539c2 | 727 | endif() |
7c673cae FG |
728 | |
729 | # unittest_simple_spin | |
730 | add_executable(unittest_simple_spin | |
731 | simple_spin.cc | |
732 | ) | |
11fdf7f2 | 733 | add_ceph_unittest(unittest_simple_spin) |
7c673cae FG |
734 | target_link_libraries(unittest_simple_spin global) |
735 | ||
736 | # unittest_bufferlist | |
737 | add_executable(unittest_bufferlist | |
738 | bufferlist.cc | |
11fdf7f2 | 739 | $<TARGET_OBJECTS:unit-main> |
7c673cae | 740 | ) |
11fdf7f2 | 741 | add_ceph_unittest(unittest_bufferlist) |
7c673cae FG |
742 | target_link_libraries(unittest_bufferlist global) |
743 | ||
9f95a23c TL |
744 | # compiletest_cxx11_client |
745 | add_executable(compiletest_cxx11_client | |
746 | cxx11_client.cc | |
747 | ) | |
748 | if(CMAKE_VERSION VERSION_LESS "3.8") | |
749 | # this is ugly as we'll end with -std=c++11 overriding the previous -std=c++17 | |
750 | # I would love to have a better way for old Cmakes | |
751 | set_target_properties(compiletest_cxx11_client | |
752 | PROPERTIES COMPILE_FLAGS "-std=c++11 -Werror -pedantic" | |
753 | ) | |
754 | else() | |
755 | set_target_properties(compiletest_cxx11_client | |
756 | PROPERTIES COMPILE_FLAGS "-Werror -pedantic" | |
757 | CMAKE_CXX_STANDARD 11 | |
758 | CXX_STANDARD_REQUIRED ON | |
759 | ) | |
760 | endif() | |
761 | add_ceph_test(compiletest_cxx11_client | |
762 | "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/compiletest_cxx11_client" | |
763 | ) | |
764 | target_link_libraries(compiletest_cxx11_client global) | |
765 | ||
7c673cae FG |
766 | # unittest_xlist |
767 | add_executable(unittest_xlist | |
768 | test_xlist.cc | |
769 | ) | |
11fdf7f2 TL |
770 | add_ceph_unittest(unittest_xlist) |
771 | target_link_libraries(unittest_xlist ceph-common) | |
7c673cae FG |
772 | |
773 | # unittest_arch | |
774 | add_executable(unittest_arch | |
775 | test_arch.cc | |
776 | $<TARGET_OBJECTS:unit-main> | |
777 | ) | |
11fdf7f2 | 778 | add_ceph_unittest(unittest_arch) |
7c673cae FG |
779 | target_link_libraries(unittest_arch global) |
780 | ||
781 | # unittest_denc | |
782 | add_executable(unittest_denc | |
783 | test_denc.cc | |
784 | ) | |
11fdf7f2 TL |
785 | add_ceph_unittest(unittest_denc) |
786 | target_link_libraries(unittest_denc global) | |
7c673cae FG |
787 | |
788 | # unittest_mempool | |
789 | add_executable(unittest_mempool | |
790 | test_mempool.cc | |
791 | ) | |
11fdf7f2 | 792 | add_ceph_unittest(unittest_mempool) |
7c673cae FG |
793 | target_link_libraries(unittest_mempool global) |
794 | ||
31f18b77 FG |
795 | # unittest_features |
796 | add_executable(unittest_features | |
797 | test_features.cc | |
798 | ) | |
11fdf7f2 | 799 | add_ceph_unittest(unittest_features) |
31f18b77 FG |
800 | target_link_libraries(unittest_features global) |
801 | ||
7c673cae FG |
802 | # unittest_crypto |
803 | add_executable(unittest_crypto | |
804 | crypto.cc | |
805 | $<TARGET_OBJECTS:unit-main> | |
806 | ) | |
11fdf7f2 | 807 | add_ceph_unittest(unittest_crypto) |
7c673cae FG |
808 | target_link_libraries(unittest_crypto global) |
809 | ||
810 | # unittest_crypto_init | |
811 | add_executable(unittest_crypto_init | |
812 | crypto_init.cc | |
813 | ) | |
11fdf7f2 | 814 | add_ceph_unittest(unittest_crypto_init) |
7c673cae FG |
815 | target_link_libraries(unittest_crypto_init global) |
816 | ||
817 | # unittest_perf_counters | |
818 | add_executable(unittest_perf_counters | |
819 | perf_counters.cc | |
820 | ) | |
11fdf7f2 | 821 | add_ceph_unittest(unittest_perf_counters) |
7c673cae FG |
822 | target_link_libraries(unittest_perf_counters global) |
823 | ||
824 | # unittest_ceph_crypto | |
825 | add_executable(unittest_ceph_crypto | |
9f95a23c | 826 | ceph_crypto.cc) |
11fdf7f2 | 827 | add_ceph_unittest(unittest_ceph_crypto) |
7c673cae FG |
828 | target_link_libraries(unittest_ceph_crypto global) |
829 | ||
830 | # unittest_utf8 | |
831 | add_executable(unittest_utf8 | |
9f95a23c | 832 | utf8.cc) |
11fdf7f2 | 833 | add_ceph_unittest(unittest_utf8) |
7c673cae FG |
834 | target_link_libraries(unittest_utf8 global) |
835 | ||
836 | # unittest_mime | |
837 | add_executable(unittest_mime | |
9f95a23c | 838 | mime.cc) |
11fdf7f2 | 839 | add_ceph_unittest(unittest_mime) |
9f95a23c | 840 | target_link_libraries(unittest_mime ceph-common) |
7c673cae FG |
841 | |
842 | # unittest_escape | |
843 | add_executable(unittest_escape | |
9f95a23c | 844 | escape.cc) |
11fdf7f2 | 845 | add_ceph_unittest(unittest_escape) |
9f95a23c | 846 | target_link_libraries(unittest_escape ceph-common) |
7c673cae FG |
847 | |
848 | # unittest_strtol | |
849 | add_executable(unittest_strtol | |
9f95a23c | 850 | strtol.cc) |
11fdf7f2 | 851 | add_ceph_unittest(unittest_strtol) |
9f95a23c | 852 | target_link_libraries(unittest_strtol ceph-common) |
7c673cae FG |
853 | |
854 | # unittest_confutils | |
855 | add_executable(unittest_confutils | |
9f95a23c | 856 | confutils.cc) |
11fdf7f2 | 857 | add_ceph_unittest(unittest_confutils) |
9f95a23c | 858 | target_link_libraries(unittest_confutils ceph-common) |
7c673cae FG |
859 | |
860 | # unittest_heartbeatmap | |
861 | add_executable(unittest_heartbeatmap | |
862 | heartbeat_map.cc | |
863 | $<TARGET_OBJECTS:unit-main> | |
864 | ) | |
11fdf7f2 | 865 | add_ceph_unittest(unittest_heartbeatmap) |
7c673cae FG |
866 | target_link_libraries(unittest_heartbeatmap global ceph-common) |
867 | ||
868 | if(${WITH_RADOSGW}) | |
869 | # unittest_formatter | |
870 | add_executable(unittest_formatter | |
871 | formatter.cc | |
872 | $<TARGET_OBJECTS:unit-main> | |
873 | ) | |
11fdf7f2 | 874 | add_ceph_unittest(unittest_formatter) |
7c673cae FG |
875 | target_link_libraries(unittest_formatter global) |
876 | endif(${WITH_RADOSGW}) | |
877 | ||
878 | # unittest_daemon_config | |
879 | add_executable(unittest_daemon_config | |
880 | daemon_config.cc | |
881 | $<TARGET_OBJECTS:unit-main> | |
882 | ) | |
11fdf7f2 | 883 | add_ceph_unittest(unittest_daemon_config) |
7c673cae FG |
884 | target_link_libraries(unittest_daemon_config |
885 | ceph-common | |
886 | global | |
887 | ${BLKID_LIBRARIES} | |
888 | ${EXTRALIBS} | |
889 | ) | |
890 | ||
891 | if(WITH_LIBCEPHFS) | |
892 | # unittest_libcephfs_config | |
893 | add_executable(unittest_libcephfs_config | |
894 | libcephfs_config.cc | |
895 | ) | |
11fdf7f2 | 896 | add_ceph_unittest(unittest_libcephfs_config) |
7c673cae FG |
897 | target_link_libraries(unittest_libcephfs_config cephfs) |
898 | endif(WITH_LIBCEPHFS) | |
899 | ||
900 | if(WITH_RBD) | |
901 | # unittest_rbd_replay | |
902 | add_executable(unittest_rbd_replay | |
903 | test_rbd_replay.cc) | |
11fdf7f2 | 904 | add_ceph_unittest(unittest_rbd_replay) |
7c673cae FG |
905 | target_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 | ) | |
914 | endif(WITH_RBD) | |
915 | ||
916 | # unittest_ipaddr | |
917 | add_executable(unittest_ipaddr | |
11fdf7f2 TL |
918 | test_ipaddr.cc) |
919 | add_ceph_unittest(unittest_ipaddr) | |
f67539c2 | 920 | target_link_libraries(unittest_ipaddr global GTest::Main) |
9f95a23c TL |
921 | |
922 | # unittest_utime | |
923 | add_executable(unittest_utime | |
924 | test_utime.cc) | |
925 | add_ceph_unittest(unittest_utime) | |
926 | target_link_libraries(unittest_utime ceph-common) | |
7c673cae FG |
927 | |
928 | # unittest_texttable | |
929 | add_executable(unittest_texttable | |
930 | test_texttable.cc | |
9f95a23c | 931 | $<TARGET_OBJECTS:common_texttable_obj>) |
11fdf7f2 | 932 | add_ceph_unittest(unittest_texttable) |
9f95a23c | 933 | target_link_libraries(unittest_texttable ceph-common) |
7c673cae | 934 | |
f67539c2 | 935 | if(NOT WIN32) |
7c673cae FG |
936 | # unittest_on_exit |
937 | add_executable(unittest_on_exit | |
9f95a23c | 938 | on_exit.cc) |
11fdf7f2 | 939 | add_ceph_unittest(unittest_on_exit) |
9f95a23c | 940 | target_link_libraries(unittest_on_exit ceph-common) |
f67539c2 | 941 | endif() |
7c673cae FG |
942 | |
943 | # unittest_subprocess | |
944 | add_executable(unittest_subprocess | |
9f95a23c | 945 | test_subprocess.cc) |
11fdf7f2 | 946 | add_ceph_unittest(unittest_subprocess) |
9f95a23c | 947 | target_link_libraries(unittest_subprocess ceph-common) |
7c673cae FG |
948 | |
949 | # unittest_pageset | |
950 | add_executable(unittest_pageset test_pageset.cc) | |
11fdf7f2 | 951 | add_ceph_unittest(unittest_pageset) |
9f95a23c TL |
952 | target_link_libraries(unittest_pageset ceph-common) |
953 | ||
954 | add_executable(unittest_random_string test_random_string.cc $<TARGET_OBJECTS:unit-main>) | |
955 | add_ceph_unittest(unittest_random_string) | |
956 | target_link_libraries(unittest_random_string global) | |
7c673cae | 957 | |
11fdf7f2 TL |
958 | # unittest_any_ |
959 | add_executable(unittest_any test_any.cc) | |
960 | add_ceph_unittest(unittest_any) | |
9f95a23c TL |
961 | |
962 | # unittest_weighted_shuffle | |
963 | add_executable(unittest_weighted_shuffle test_weighted_shuffle.cc) | |
964 | add_ceph_unittest(unittest_weighted_shuffle) | |
7c673cae | 965 | |
20effc67 TL |
966 | add_executable(unittest_intarith test_intarith.cc) |
967 | add_ceph_unittest(unittest_intarith) | |
11fdf7f2 | 968 | #make check ends here |