]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | include(AddCephTest) |
2 | ||
3 | set(UNITTEST_LIBS gmock_main gmock gtest ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) | |
4 | set(UNITTEST_CXX_FLAGS "-I${CMAKE_SOURCE_DIR}/src/googletest/googlemock/include -I${CMAKE_BINARY_DIR}/src/googletest/googlemock/include -I${CMAKE_SOURCE_DIR}/src/googletest/googletest/include -I${CMAKE_BINARY_DIR}/src/googletest/googletest/include -fno-strict-aliasing") | |
5 | ||
6 | add_library(unit-main OBJECT unit.cc) | |
7 | set_source_files_properties(unit.cc PROPERTIES | |
8 | COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) | |
9 | ||
10 | add_subdirectory(bench) | |
11 | add_subdirectory(cls_hello) | |
12 | add_subdirectory(cls_lock) | |
13 | add_subdirectory(cls_log) | |
14 | add_subdirectory(cls_numops) | |
15 | add_subdirectory(cls_sdk) | |
16 | if(WITH_RBD) | |
17 | add_subdirectory(cls_rbd) | |
18 | endif(WITH_RBD) | |
19 | add_subdirectory(cls_refcount) | |
20 | add_subdirectory(cls_replica_log) | |
21 | add_subdirectory(cls_rgw) | |
22 | add_subdirectory(cls_statelog) | |
23 | add_subdirectory(cls_version) | |
24 | add_subdirectory(cls_lua) | |
25 | add_subdirectory(common) | |
26 | add_subdirectory(compressor) | |
27 | add_subdirectory(crush) | |
28 | add_subdirectory(direct_messenger) | |
29 | add_subdirectory(encoding) | |
30 | add_subdirectory(erasure-code) | |
31 | add_subdirectory(filestore) | |
32 | add_subdirectory(fs) | |
33 | add_subdirectory(journal) | |
34 | if(WITH_EMBEDDED) | |
35 | add_subdirectory(libcephd) | |
36 | endif(WITH_EMBEDDED) | |
37 | add_subdirectory(libcephfs) | |
38 | add_subdirectory(librados) | |
39 | add_subdirectory(librados_test_stub) | |
40 | add_subdirectory(libradosstriper) | |
41 | if(WITH_RBD) | |
42 | add_subdirectory(librbd) | |
43 | endif(WITH_RBD) | |
44 | add_subdirectory(messenger) | |
45 | add_subdirectory(mds) | |
46 | add_subdirectory(mon) | |
31f18b77 | 47 | add_subdirectory(mgr) |
7c673cae FG |
48 | add_subdirectory(msgr) |
49 | add_subdirectory(ObjectMap) | |
50 | add_subdirectory(objectstore) | |
51 | add_subdirectory(os) | |
52 | add_subdirectory(osd) | |
53 | add_subdirectory(osdc) | |
54 | add_subdirectory(pybind) | |
55 | if(${WITH_RADOSGW}) | |
56 | add_subdirectory(rgw) | |
57 | endif(${WITH_RADOSGW}) | |
58 | if(WITH_RBD) | |
59 | add_subdirectory(rbd_mirror) | |
60 | endif(WITH_RBD) | |
61 | add_subdirectory(system) | |
62 | if(WITH_FIO) | |
63 | add_subdirectory(fio) | |
64 | endif() | |
65 | ||
66 | # test_timers | |
67 | add_executable(ceph_test_timers | |
68 | TestTimers.cc | |
69 | ) | |
70 | target_link_libraries(ceph_test_timers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
71 | ||
72 | # test_signal_handlers | |
73 | add_executable(ceph_test_signal_handlers | |
74 | TestSignalHandlers.cc | |
75 | ) | |
76 | target_link_libraries(ceph_test_signal_handlers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
77 | ||
78 | # test_rewrite_latency | |
79 | add_executable(ceph_test_rewrite_latency | |
80 | test_rewrite_latency.cc | |
81 | ) | |
82 | target_link_libraries(ceph_test_rewrite_latency ceph-common | |
83 | ${CMAKE_DL_LIBS} | |
84 | ${CMAKE_THREAD_LIBS_INIT} ${CRYPTO_LIBS} m ${EXTRALIBS}) | |
85 | ||
86 | # test_crypt | |
87 | add_executable(test_crypto | |
88 | testcrypto.cc | |
89 | ) | |
90 | target_link_libraries(test_crypto | |
91 | global | |
92 | ${CRYPTO_LIBS} | |
93 | m | |
94 | ${EXTRALIBS} | |
95 | ${BLKID_LIBRARIES} | |
96 | ${CMAKE_DL_LIBS} | |
97 | ) | |
98 | ||
99 | add_executable(test_build_libcommon buildtest_skeleton.cc) | |
100 | target_link_libraries(test_build_libcommon ceph-common pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
101 | ||
102 | if(WITH_RADOSGW) | |
103 | add_executable(test_build_librgw buildtest_skeleton.cc) | |
104 | target_link_libraries(test_build_librgw rgw_a pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
105 | endif(WITH_RADOSGW) | |
106 | ||
107 | if(WITH_LIBCEPHFS) | |
108 | # From src/test/Makefile-client.am: I dont get this one... testing the osdc build but link in libcephfs? | |
109 | add_executable(test_build_libcephfs buildtest_skeleton.cc) | |
110 | target_link_libraries(test_build_libcephfs cephfs pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
111 | endif(WITH_LIBCEPHFS) | |
112 | ||
113 | add_executable(test_build_librados buildtest_skeleton.cc) | |
114 | target_link_libraries(test_build_librados librados pthread ${CRYPTO_LIBS} ${EXTRALIBS} osdc osd os ceph-common cls_lock_client ${BLKID_LIBRARIES}) | |
115 | ||
116 | # bench_log | |
117 | set(bench_log_srcs | |
118 | bench_log.cc | |
119 | ) | |
120 | add_executable(ceph_bench_log | |
121 | ${bench_log_srcs} | |
122 | ) | |
123 | target_link_libraries(ceph_bench_log global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
124 | ||
125 | # ceph_test_mutate | |
126 | add_executable(ceph_test_mutate | |
127 | test_mutate.cc | |
128 | ) | |
129 | target_link_libraries(ceph_test_mutate global librados ${BLKID_LIBRARIES} | |
130 | ${CMAKE_DL_LIBS}) | |
131 | ||
132 | # test_trans | |
133 | add_executable(test_trans | |
134 | test_trans.cc | |
135 | ) | |
136 | target_link_libraries(test_trans os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
137 | ||
138 | ## Benchmarks | |
139 | ||
140 | ||
141 | # ceph_omapbench | |
142 | set(omapbench_srcs | |
143 | omap_bench.cc | |
144 | ) | |
145 | add_executable(ceph_omapbench | |
146 | ${omapbench_srcs} | |
147 | ) | |
148 | target_link_libraries(ceph_omapbench | |
149 | librados | |
31f18b77 | 150 | Boost::program_options |
7c673cae FG |
151 | global |
152 | ${BLKID_LIBRARIES} | |
153 | ${CMAKE_DL_LIBS} | |
154 | ) | |
155 | ||
156 | if(WITH_KVS) | |
157 | # ceph_kvstorebench | |
158 | set(kvstorebench_srcs | |
159 | kv_store_bench.cc | |
160 | ${CMAKE_SOURCE_DIR}/src/key_value_store/kv_flat_btree_async.cc | |
161 | ) | |
162 | add_executable(ceph_kvstorebench ${kvstorebench_srcs}) | |
163 | target_link_libraries(ceph_kvstorebench librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
164 | install(TARGETS ceph_kvstorebench DESTINATION bin) | |
165 | endif(WITH_KVS) | |
166 | ||
167 | # ceph_objectstore_bench | |
168 | add_executable(ceph_objectstore_bench objectstore_bench.cc) | |
169 | target_link_libraries(ceph_objectstore_bench os global ${BLKID_LIBRARIES}) | |
170 | ||
171 | if(${WITH_RADOSGW}) | |
172 | # test_cors | |
173 | set(test_cors_srcs test_cors.cc) | |
174 | add_executable(test_cors | |
175 | ${test_cors_srcs} | |
176 | ) | |
177 | target_link_libraries(test_cors | |
178 | librados | |
179 | rgw_a | |
180 | global | |
181 | ${BLKID_LIBRARIES} | |
182 | ${CURL_LIBRARIES} | |
183 | ${EXPAT_LIBRARIES} | |
184 | ${CMAKE_DL_LIBS} ${UNITTEST_LIBS}) | |
185 | set_target_properties(test_cors PROPERTIES COMPILE_FLAGS | |
186 | ${UNITTEST_CXX_FLAGS}) | |
187 | ||
188 | # ceph_test_cls_rgw_meta | |
189 | set(test_cls_rgw_meta_srcs test_rgw_admin_meta.cc) | |
190 | add_executable(ceph_test_cls_rgw_meta | |
191 | ${test_cls_rgw_meta_srcs} | |
192 | ) | |
193 | target_link_libraries(ceph_test_cls_rgw_meta | |
194 | librados | |
195 | rgw_a | |
196 | global | |
197 | cls_version_client | |
198 | cls_log_client | |
199 | cls_statelog_client | |
200 | cls_refcount_client | |
201 | cls_rgw_client | |
202 | cls_user_client | |
203 | cls_lock_client | |
31f18b77 | 204 | Boost::regex |
7c673cae FG |
205 | ${BLKID_LIBRARIES} |
206 | ${CURL_LIBRARIES} | |
207 | ${EXPAT_LIBRARIES} | |
208 | ${CMAKE_DL_LIBS} ${UNITTEST_LIBS} ${CRYPTO_LIBS}) | |
209 | set_target_properties(ceph_test_cls_rgw_meta PROPERTIES | |
210 | COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) | |
211 | ||
212 | install(TARGETS | |
213 | ceph_test_cls_rgw_meta | |
214 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
215 | ||
216 | # ceph_test_cls_rgw_log | |
217 | set(ceph_test_cls_rgw_log_srcs | |
218 | test_rgw_admin_log.cc | |
219 | ) | |
220 | add_executable(ceph_test_cls_rgw_log | |
221 | ${ceph_test_cls_rgw_log_srcs} | |
222 | ) | |
223 | target_link_libraries(ceph_test_cls_rgw_log | |
224 | librados | |
225 | rgw_a | |
226 | global | |
227 | cls_version_client | |
228 | cls_log_client | |
229 | cls_statelog_client | |
230 | cls_refcount_client | |
231 | cls_rgw_client | |
232 | cls_user_client | |
233 | cls_lock_client | |
31f18b77 | 234 | Boost::regex |
7c673cae FG |
235 | ${BLKID_LIBRARIES} |
236 | ${CURL_LIBRARIES} | |
237 | ${EXPAT_LIBRARIES} | |
238 | ${CMAKE_DL_LIBS} | |
239 | ${UNITTEST_LIBS} | |
240 | ${EXTRALIBS} | |
241 | ${CRYPTO_LIBS} | |
242 | ) | |
243 | set_target_properties(ceph_test_cls_rgw_log PROPERTIES COMPILE_FLAGS | |
244 | ${UNITTEST_CXX_FLAGS}) | |
245 | ||
246 | # ceph_test_cls_rgw_opstate | |
247 | set(ceph_test_cls_rgw_opstate_srcs test_rgw_admin_opstate.cc) | |
248 | add_executable(ceph_test_cls_rgw_opstate | |
249 | ${ceph_test_cls_rgw_opstate_srcs} | |
250 | ) | |
251 | target_link_libraries(ceph_test_cls_rgw_opstate | |
252 | rgw_a | |
253 | librados | |
254 | cls_version_client | |
255 | cls_log_client | |
256 | cls_statelog_client | |
257 | cls_timeindex_client | |
258 | cls_refcount_client | |
259 | cls_rgw_client | |
260 | cls_user_client | |
261 | cls_lock_client | |
262 | global | |
263 | ${BLKID_LIBRARIES} | |
264 | ${CURL_LIBRARIES} | |
265 | ${EXPAT_LIBRARIES} | |
266 | ${CMAKE_DL_LIBS} | |
267 | ${UNITTEST_LIBS} | |
268 | ${CRYPTO_LIBS} | |
269 | ${EXTRALIBS} | |
270 | ) | |
271 | set_target_properties(ceph_test_cls_rgw_opstate PROPERTIES | |
272 | COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) | |
273 | ||
274 | # ceph_test_librgw_file (nfs-like RGW interface) | |
275 | add_executable(ceph_test_librgw_file | |
276 | librgw_file.cc | |
277 | ) | |
278 | set_target_properties(ceph_test_librgw_file PROPERTIES COMPILE_FLAGS | |
279 | ${UNITTEST_CXX_FLAGS}) | |
31f18b77 | 280 | if(WITH_RADOSGW_FCGI_FRONTEND) |
7c673cae | 281 | target_include_directories(ceph_test_librgw_file PRIVATE ${FCGI_INCLUDE_DIR}) |
31f18b77 | 282 | endif(WITH_RADOSGW_FCGI_FRONTEND) |
7c673cae FG |
283 | target_link_libraries(ceph_test_librgw_file |
284 | rgw | |
285 | librados | |
286 | ceph-common | |
287 | ${UNITTEST_LIBS} | |
288 | ${EXTRALIBS} | |
289 | ) | |
290 | ||
291 | # ceph_test_librgw_file_cd (just the rgw_file create-delete bucket ops) | |
292 | add_executable(ceph_test_librgw_file_cd | |
293 | librgw_file_cd.cc | |
294 | ) | |
295 | set_target_properties(ceph_test_librgw_file_cd PROPERTIES COMPILE_FLAGS | |
296 | ${UNITTEST_CXX_FLAGS}) | |
297 | target_link_libraries(ceph_test_librgw_file_cd | |
298 | rgw | |
299 | librados | |
300 | ceph-common | |
301 | ${UNITTEST_LIBS} | |
302 | ${EXTRALIBS} | |
303 | ) | |
304 | ||
305 | # ceph_test_librgw_file_gp (just the rgw_file get-put bucket ops) | |
306 | add_executable(ceph_test_librgw_file_gp | |
307 | librgw_file_gp.cc | |
308 | ) | |
309 | set_target_properties(ceph_test_librgw_file_gp PROPERTIES COMPILE_FLAGS | |
310 | ${UNITTEST_CXX_FLAGS}) | |
311 | target_link_libraries(ceph_test_librgw_file_gp | |
312 | rgw | |
313 | librados | |
314 | ceph-common | |
315 | ${UNITTEST_LIBS} | |
316 | ${EXTRALIBS} | |
317 | ) | |
318 | ||
319 | # ceph_test_librgw_file_nfsns (nfs namespace tests) | |
320 | add_executable(ceph_test_librgw_file_nfsns | |
321 | librgw_file_nfsns.cc | |
322 | ) | |
323 | set_target_properties(ceph_test_librgw_file_nfsns PROPERTIES COMPILE_FLAGS | |
324 | ${UNITTEST_CXX_FLAGS}) | |
31f18b77 | 325 | if(WITH_RADOSGW_FCGI_FRONTEND) |
7c673cae | 326 | target_include_directories(ceph_test_librgw_file_nfsns PRIVATE ${FCGI_INCLUDE_DIR}) |
31f18b77 | 327 | endif(WITH_RADOSGW_FCGI_FRONTEND) |
7c673cae FG |
328 | target_link_libraries(ceph_test_librgw_file_nfsns |
329 | rgw | |
330 | librados | |
331 | ceph-common | |
332 | ${UNITTEST_LIBS} | |
333 | ${EXTRALIBS} | |
334 | ) | |
335 | ||
336 | # ceph_test_librgw_file_aw (nfs write transaction [atomic write] tests) | |
337 | add_executable(ceph_test_librgw_file_aw | |
338 | librgw_file_aw.cc | |
339 | ) | |
340 | set_target_properties(ceph_test_librgw_file_aw PROPERTIES COMPILE_FLAGS | |
341 | ${UNITTEST_CXX_FLAGS}) | |
342 | target_link_libraries(ceph_test_librgw_file_aw | |
343 | rgw | |
344 | librados | |
345 | ceph-common | |
346 | ${UNITTEST_LIBS} | |
347 | ${EXTRALIBS} | |
348 | ) | |
349 | ||
350 | # ceph_test_rgw_token | |
351 | add_executable(ceph_test_rgw_token | |
352 | test_rgw_token.cc | |
353 | ) | |
354 | set_target_properties(ceph_test_rgw_token PROPERTIES COMPILE_FLAGS | |
355 | ${UNITTEST_CXX_FLAGS}) | |
356 | target_link_libraries(ceph_test_rgw_token | |
357 | rgw | |
358 | os | |
359 | global | |
360 | ${UNITTEST_LIBS} | |
361 | ${EXTRALIBS} | |
362 | ) | |
363 | ||
364 | # librgw_file_gp (just the rgw_file get-put bucket ops) | |
365 | add_executable(test_rgw_ldap | |
366 | ${CMAKE_SOURCE_DIR}/src/rgw/rgw_ldap.cc | |
367 | test_rgw_ldap.cc | |
368 | ) | |
369 | set_target_properties(test_rgw_ldap PROPERTIES COMPILE_FLAGS | |
370 | ${UNITTEST_CXX_FLAGS}) | |
371 | target_link_libraries(test_rgw_ldap | |
372 | librados | |
373 | ceph-common | |
374 | ${OPENLDAP_LIBRARIES} | |
375 | ${UNITTEST_LIBS} | |
376 | ) | |
377 | ||
378 | endif(${WITH_RADOSGW}) | |
379 | ||
380 | # ceph_multi_stress_watch | |
381 | add_executable(ceph_multi_stress_watch | |
382 | multi_stress_watch.cc | |
383 | ) | |
384 | target_link_libraries(ceph_multi_stress_watch librados global radostest | |
385 | ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
386 | ||
387 | #ceph_perf_local | |
388 | add_executable(ceph_perf_local | |
389 | perf_local.cc | |
390 | perf_helper.cc) | |
391 | if(HAVE_SSE) | |
392 | set(PERF_LOCAL_FLAGS ${SSE3_FLAGS}) | |
393 | endif(HAVE_SSE) | |
394 | if(HAVE_NEON) | |
395 | set(PERF_LOCAL_FLAGS ${ARM_NEON_FLAGS}) | |
396 | endif(HAVE_NEON) | |
397 | if(PERF_LOCAL_FLAGS) | |
398 | set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS | |
399 | ${PERF_LOCAL_FLAGS}) | |
400 | endif() | |
401 | target_link_libraries(ceph_perf_local os global ${UNITTEST_LIBS}) | |
402 | ||
403 | # ceph_xattr_bench | |
404 | add_executable(ceph_xattr_bench | |
405 | xattr_bench.cc | |
406 | ) | |
407 | set_target_properties(ceph_xattr_bench PROPERTIES COMPILE_FLAGS | |
408 | ${UNITTEST_CXX_FLAGS}) | |
409 | target_link_libraries(ceph_xattr_bench | |
410 | os | |
411 | ceph-common | |
412 | ${UNITTEST_LIBS} | |
413 | global | |
414 | ${EXTRALIBS} | |
415 | ${BLKID_LIBRARIES} | |
416 | ${CMAKE_DL_LIBS} | |
417 | ) | |
418 | ||
419 | install(TARGETS | |
420 | ceph_bench_log | |
421 | ceph_multi_stress_watch | |
422 | ceph_objectstore_bench | |
423 | ceph_omapbench | |
424 | ceph_perf_local | |
425 | ceph_xattr_bench | |
426 | DESTINATION bin) | |
427 | ||
428 | # ceph_test_filejournal | |
429 | add_executable(ceph_test_filejournal | |
430 | test_filejournal.cc | |
431 | ) | |
432 | set_target_properties(ceph_test_filejournal PROPERTIES COMPILE_FLAGS | |
433 | ${UNITTEST_CXX_FLAGS}) | |
434 | target_link_libraries(ceph_test_filejournal | |
435 | os | |
436 | ceph-common | |
437 | ${UNITTEST_LIBS} | |
438 | global | |
439 | ${EXTRALIBS} | |
440 | ${BLKID_LIBRARIES} | |
441 | ${CMAKE_DL_LIBS} | |
442 | ${EXTRALIBS} | |
443 | ) | |
444 | install(TARGETS | |
445 | ceph_test_filejournal | |
446 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
447 | ||
448 | # ceph_test_keys | |
449 | add_executable(ceph_test_keys | |
450 | testkeys.cc | |
451 | ) | |
452 | target_link_libraries(ceph_test_keys mon global ${CMAKE_DL_LIBS}) | |
453 | ||
454 | # ceph_test_snap_mapper | |
455 | add_executable(ceph_test_snap_mapper | |
456 | test_snap_mapper.cc | |
457 | $<TARGET_OBJECTS:unit-main> | |
458 | ) | |
459 | target_link_libraries(ceph_test_snap_mapper osd global ${BLKID_LIBRARIES} ${UNITTEST_LIBS}) | |
460 | set_target_properties(ceph_test_snap_mapper PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) | |
461 | ||
462 | add_executable(ceph_test_stress_watch | |
463 | test_stress_watch.cc | |
464 | ) | |
465 | set_target_properties(ceph_test_stress_watch PROPERTIES COMPILE_FLAGS | |
466 | ${UNITTEST_CXX_FLAGS}) | |
467 | target_link_libraries(ceph_test_stress_watch | |
468 | librados | |
469 | ${UNITTEST_LIBS} | |
470 | radostest | |
471 | ${EXTRALIBS} | |
472 | ${BLKID_LIBRARIES} | |
473 | ${CMAKE_DL_LIBS} | |
474 | ) | |
475 | install(TARGETS | |
476 | ceph_test_stress_watch | |
477 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
478 | ||
479 | if(WITH_FUSE) | |
480 | add_executable(ceph_test_cfuse_cache_invalidate | |
481 | test_cfuse_cache_invalidate.cc | |
482 | ) | |
483 | endif(WITH_FUSE) | |
484 | ||
485 | if(${WITH_CEPHFS}) | |
486 | add_executable(test_c_headers | |
487 | test_c_headers.c | |
488 | ) | |
489 | target_link_libraries(test_c_headers | |
490 | librados | |
491 | cephfs) | |
492 | endif(${WITH_CEPHFS}) | |
493 | ||
494 | if(HAVE_BLKID) | |
495 | add_executable(ceph_test_get_blkdev_size | |
496 | test_get_blkdev_size.cc | |
497 | ) | |
498 | target_link_libraries(ceph_test_get_blkdev_size | |
499 | ceph-common | |
500 | pthread | |
501 | ${EXTRALIBS} | |
502 | ${BLKID_LIBRARIES} | |
503 | ${CMAKE_DL_LIBS} | |
504 | ) | |
505 | endif(HAVE_BLKID) | |
506 | ||
31f18b77 FG |
507 | # ceph_test_admin_socket_output |
508 | ||
509 | add_executable(ceph_test_admin_socket_output | |
510 | test_admin_socket_output.cc | |
511 | admin_socket_output.cc | |
512 | admin_socket_output_tests.cc | |
513 | ) | |
514 | target_link_libraries(ceph_test_admin_socket_output | |
515 | ceph-common | |
516 | ${Boost_FILESYSTEM_LIBRARY} | |
517 | ) | |
518 | install(TARGETS | |
519 | ceph_test_admin_socket_output | |
520 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
521 | ||
7c673cae FG |
522 | #make check starts here |
523 | ||
524 | #following dependencies are run inside make check unit tests | |
525 | add_dependencies(tests | |
526 | ceph-mon | |
527 | ceph-mgr | |
528 | ceph | |
529 | ceph-authtool | |
530 | get_command_descriptions | |
531 | crushtool | |
532 | ceph-conf | |
533 | rados | |
534 | ceph-mds | |
535 | monmaptool | |
536 | ceph-osd | |
537 | ceph-dencoder | |
538 | ceph-objectstore-tool | |
539 | ceph-monstore-tool | |
540 | osdmaptool | |
541 | ceph_example | |
542 | ceph_snappy | |
543 | cls_lock | |
544 | ceph_test_objectstore | |
545 | ceph_erasure_code_non_regression | |
546 | ceph_erasure_code | |
547 | ceph-disk | |
548 | cython_modules) | |
549 | if(WITH_RBD) | |
550 | add_dependencies(tests unittest_librbd rbd) | |
551 | endif(WITH_RBD) | |
552 | if(WITH_RADOSGW) | |
553 | add_dependencies(tests radosgw-admin) | |
554 | endif(WITH_RADOSGW) | |
555 | if(NOT FREEBSD) | |
556 | add_dependencies(tests ceph-detect-init) | |
557 | endif(NOT FREEBSD) | |
558 | ||
7c673cae FG |
559 | if(WITH_RBD) |
560 | add_ceph_test(run-rbd-unit-tests.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh) | |
561 | endif(WITH_RBD) | |
562 | add_ceph_test(run-cli-tests ${CMAKE_CURRENT_SOURCE_DIR}/run-cli-tests) | |
563 | add_ceph_test(test_objectstore_memstore.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_objectstore_memstore.sh) | |
564 | add_ceph_test(test_pidfile.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_pidfile.sh) | |
565 | add_ceph_test(test_subman.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_subman.sh) | |
c07f9fc5 | 566 | add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh) |
7c673cae FG |
567 | add_ceph_test(unittest_bufferlist.sh ${CMAKE_SOURCE_DIR}/src/unittest_bufferlist.sh) |
568 | ||
569 | add_test(NAME run-tox-ceph-disk COMMAND bash ${CMAKE_SOURCE_DIR}/src/ceph-disk/run-tox.sh) | |
570 | add_test(NAME run-tox-ceph-detect-init COMMAND bash ${CMAKE_SOURCE_DIR}/src/ceph-detect-init/run-tox.sh) | |
571 | ||
572 | set(CEPH_DISK_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-disk-virtualenv) | |
573 | set(CEPH_DETECT_INIT_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-detect-init-virtualenv) | |
574 | ||
575 | set_property(TEST | |
576 | run-tox-ceph-disk | |
577 | run-tox-ceph-detect-init | |
578 | PROPERTY ENVIRONMENT | |
579 | CEPH_BUILD_DIR=${CMAKE_BINARY_DIR} | |
580 | CEPH_ROOT=${CMAKE_SOURCE_DIR} | |
581 | CEPH_BIN=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} | |
582 | CEPH_LIB=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | |
583 | CEPH_BUILD_VIRTUALENV=${CEPH_BUILD_VIRTUALENV} | |
584 | CEPH_DISK_VIRTUALENV=${CEPH_DISK_VIRTUALENV} | |
585 | CEPH_DETECT_INIT_VIRTUALENV=${CEPH_DETECT_INIT_VIRTUALENV} | |
586 | LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib | |
587 | PATH=$ENV{PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}:${CMAKE_SOURCE_DIR}/src | |
588 | PYTHONPATH=${CMAKE_SOURCE_DIR}/src/pybind | |
589 | ) | |
590 | ||
591 | # unittest_admin_socket | |
592 | add_executable(unittest_admin_socket | |
593 | admin_socket.cc | |
594 | $<TARGET_OBJECTS:unit-main> | |
595 | ) | |
596 | add_ceph_unittest(unittest_admin_socket ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_admin_socket) | |
597 | target_link_libraries(unittest_admin_socket global) | |
598 | ||
599 | # unittest_encoding | |
600 | add_executable(unittest_encoding | |
601 | encoding.cc | |
602 | ) | |
603 | add_ceph_unittest(unittest_encoding ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_encoding) | |
604 | target_link_libraries(unittest_encoding ceph-common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES}) | |
605 | ||
606 | # unittest_addrs | |
607 | add_executable(unittest_addrs | |
608 | test_addrs.cc | |
609 | ) | |
610 | add_ceph_unittest(unittest_addrs ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_addrs) | |
611 | target_link_libraries(unittest_addrs ceph-common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES}) | |
612 | ||
613 | # unittest_workqueue | |
614 | add_executable(unittest_workqueue | |
615 | test_workqueue.cc | |
616 | $<TARGET_OBJECTS:unit-main> | |
617 | ) | |
618 | add_ceph_unittest(unittest_workqueue ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_workqueue) | |
619 | target_link_libraries(unittest_workqueue global ${BLKID_LIBRARIES}) | |
620 | ||
621 | # unittest_striper | |
622 | add_executable(unittest_striper | |
623 | test_striper.cc | |
624 | $<TARGET_OBJECTS:unit-main> | |
625 | ) | |
626 | add_ceph_unittest(unittest_striper ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_striper) | |
627 | target_link_libraries(unittest_striper global ${BLKID_LIBRARIES}) | |
628 | ||
629 | # unittest_prebufferedstreambuf | |
630 | add_executable(unittest_prebufferedstreambuf | |
631 | test_prebufferedstreambuf.cc | |
632 | ) | |
633 | add_ceph_unittest(unittest_prebufferedstreambuf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_prebufferedstreambuf) | |
634 | target_link_libraries(unittest_prebufferedstreambuf global ${BLKID_LIBRARIES}) | |
635 | ||
636 | # unittest_str_list | |
637 | add_executable(unittest_str_list | |
638 | test_str_list.cc | |
639 | ) | |
640 | add_ceph_unittest(unittest_str_list ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_str_list) | |
641 | target_link_libraries(unittest_str_list global ${BLKID_LIBRARIES}) | |
642 | ||
643 | # unittest_log | |
644 | add_executable(unittest_log | |
645 | ${CMAKE_SOURCE_DIR}/src/log/test.cc | |
646 | ) | |
647 | add_ceph_unittest(unittest_log ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_log) | |
648 | target_link_libraries(unittest_log global) | |
649 | ||
650 | # unittest_base64 | |
651 | add_executable(unittest_base64 | |
652 | base64.cc | |
653 | ) | |
654 | add_ceph_unittest(unittest_base64 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_base64) | |
655 | target_link_libraries(unittest_base64 global) | |
656 | ||
657 | # unittest_ceph_argparse | |
658 | add_executable(unittest_ceph_argparse | |
659 | ceph_argparse.cc | |
660 | ) | |
661 | add_ceph_unittest(unittest_ceph_argparse ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_argparse) | |
662 | target_link_libraries(unittest_ceph_argparse global) | |
663 | ||
664 | # unittest_ceph_compatset | |
665 | add_executable(unittest_ceph_compatset | |
666 | ceph_compatset.cc | |
667 | ) | |
668 | add_ceph_unittest(unittest_ceph_compatset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_compatset) | |
669 | target_link_libraries(unittest_ceph_compatset global) | |
670 | ||
671 | # unittest_gather | |
672 | add_executable(unittest_gather | |
673 | gather.cc | |
674 | $<TARGET_OBJECTS:unit-main> | |
675 | ) | |
676 | add_ceph_unittest(unittest_gather ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_gather) | |
677 | target_link_libraries(unittest_gather global) | |
678 | ||
679 | # unittest_run_cmd | |
680 | add_executable(unittest_run_cmd | |
681 | run_cmd.cc | |
682 | ) | |
683 | add_ceph_unittest(unittest_run_cmd ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_run_cmd) | |
684 | target_link_libraries(unittest_run_cmd global) | |
685 | ||
686 | # signals | |
687 | add_executable(unittest_signals | |
688 | signals.cc | |
689 | $<TARGET_OBJECTS:unit-main> | |
690 | ) | |
691 | add_ceph_unittest(unittest_signals ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_signals) | |
692 | target_link_libraries(unittest_signals global) | |
693 | ||
694 | # unittest_simple_spin | |
695 | add_executable(unittest_simple_spin | |
696 | simple_spin.cc | |
697 | ) | |
698 | add_ceph_unittest(unittest_simple_spin ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_simple_spin) | |
699 | target_link_libraries(unittest_simple_spin global) | |
700 | ||
701 | # unittest_bufferlist | |
702 | add_executable(unittest_bufferlist | |
703 | bufferlist.cc | |
704 | ) | |
705 | add_ceph_unittest(unittest_bufferlist ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_bufferlist) | |
706 | target_link_libraries(unittest_bufferlist global) | |
707 | ||
708 | # unittest_xlist | |
709 | add_executable(unittest_xlist | |
710 | test_xlist.cc | |
711 | ) | |
712 | add_ceph_unittest(unittest_xlist ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_xlist) | |
713 | target_link_libraries(unittest_xlist ceph-common ${XIO_LIBRARY}) | |
714 | ||
715 | # unittest_arch | |
716 | add_executable(unittest_arch | |
717 | test_arch.cc | |
718 | $<TARGET_OBJECTS:unit-main> | |
719 | ) | |
720 | add_ceph_unittest(unittest_arch ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_arch) | |
721 | target_link_libraries(unittest_arch global) | |
722 | ||
723 | # unittest_denc | |
724 | add_executable(unittest_denc | |
725 | test_denc.cc | |
726 | ) | |
727 | add_ceph_unittest(unittest_denc ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_denc) | |
728 | target_link_libraries(unittest_denc os global) | |
729 | ||
730 | # unittest_mempool | |
731 | add_executable(unittest_mempool | |
732 | test_mempool.cc | |
733 | ) | |
734 | add_ceph_unittest(unittest_mempool ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_mempool) | |
735 | target_link_libraries(unittest_mempool global) | |
736 | ||
31f18b77 FG |
737 | # unittest_features |
738 | add_executable(unittest_features | |
739 | test_features.cc | |
740 | ) | |
741 | add_ceph_unittest(unittest_features ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_features) | |
742 | target_link_libraries(unittest_features global) | |
743 | ||
7c673cae FG |
744 | # unittest_crypto |
745 | add_executable(unittest_crypto | |
746 | crypto.cc | |
747 | $<TARGET_OBJECTS:unit-main> | |
748 | ) | |
749 | add_ceph_unittest(unittest_crypto ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_crypto) | |
750 | target_link_libraries(unittest_crypto global) | |
751 | ||
752 | # unittest_crypto_init | |
753 | add_executable(unittest_crypto_init | |
754 | crypto_init.cc | |
755 | ) | |
756 | add_ceph_unittest(unittest_crypto_init ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_crypto_init) | |
757 | target_link_libraries(unittest_crypto_init global) | |
758 | ||
759 | # unittest_perf_counters | |
760 | add_executable(unittest_perf_counters | |
761 | perf_counters.cc | |
762 | ) | |
763 | add_ceph_unittest(unittest_perf_counters ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_perf_counters) | |
764 | target_link_libraries(unittest_perf_counters global) | |
765 | ||
766 | # unittest_ceph_crypto | |
767 | add_executable(unittest_ceph_crypto | |
768 | ceph_crypto.cc | |
769 | ) | |
770 | add_ceph_unittest(unittest_ceph_crypto ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_crypto) | |
771 | target_link_libraries(unittest_ceph_crypto global) | |
772 | ||
773 | # unittest_utf8 | |
774 | add_executable(unittest_utf8 | |
775 | utf8.cc | |
776 | ) | |
777 | add_ceph_unittest(unittest_utf8 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_utf8) | |
778 | target_link_libraries(unittest_utf8 global) | |
779 | ||
780 | # unittest_mime | |
781 | add_executable(unittest_mime | |
782 | mime.cc | |
783 | ) | |
784 | add_ceph_unittest(unittest_mime ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_mime) | |
785 | target_link_libraries(unittest_mime global) | |
786 | ||
787 | # unittest_escape | |
788 | add_executable(unittest_escape | |
789 | escape.cc | |
790 | ) | |
791 | add_ceph_unittest(unittest_escape ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_escape) | |
792 | target_link_libraries(unittest_escape global) | |
793 | ||
794 | # unittest_strtol | |
795 | add_executable(unittest_strtol | |
796 | strtol.cc | |
797 | ) | |
798 | add_ceph_unittest(unittest_strtol ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_strtol) | |
799 | target_link_libraries(unittest_strtol global) | |
800 | ||
801 | # unittest_confutils | |
802 | add_executable(unittest_confutils | |
803 | confutils.cc | |
804 | ) | |
805 | add_ceph_unittest(unittest_confutils ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_confutils) | |
806 | target_link_libraries(unittest_confutils global) | |
807 | ||
808 | # unittest_heartbeatmap | |
809 | add_executable(unittest_heartbeatmap | |
810 | heartbeat_map.cc | |
811 | $<TARGET_OBJECTS:unit-main> | |
812 | ) | |
813 | add_ceph_unittest(unittest_heartbeatmap ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_heartbeatmap) | |
814 | target_link_libraries(unittest_heartbeatmap global ceph-common) | |
815 | ||
816 | if(${WITH_RADOSGW}) | |
817 | # unittest_formatter | |
818 | add_executable(unittest_formatter | |
819 | formatter.cc | |
820 | $<TARGET_OBJECTS:unit-main> | |
821 | ) | |
822 | add_ceph_unittest(unittest_formatter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_formatter) | |
823 | target_link_libraries(unittest_formatter global) | |
824 | endif(${WITH_RADOSGW}) | |
825 | ||
826 | # unittest_daemon_config | |
827 | add_executable(unittest_daemon_config | |
828 | daemon_config.cc | |
829 | $<TARGET_OBJECTS:unit-main> | |
830 | ) | |
831 | add_ceph_unittest(unittest_daemon_config ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_daemon_config) | |
832 | target_link_libraries(unittest_daemon_config | |
833 | ceph-common | |
834 | global | |
835 | ${BLKID_LIBRARIES} | |
836 | ${EXTRALIBS} | |
837 | ) | |
838 | ||
839 | if(WITH_LIBCEPHFS) | |
840 | # unittest_libcephfs_config | |
841 | add_executable(unittest_libcephfs_config | |
842 | libcephfs_config.cc | |
843 | ) | |
844 | add_ceph_unittest(unittest_libcephfs_config ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_libcephfs_config) | |
845 | target_link_libraries(unittest_libcephfs_config cephfs) | |
846 | endif(WITH_LIBCEPHFS) | |
847 | ||
848 | if(WITH_RBD) | |
849 | # unittest_rbd_replay | |
850 | add_executable(unittest_rbd_replay | |
851 | test_rbd_replay.cc) | |
852 | add_ceph_unittest(unittest_rbd_replay ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_rbd_replay) | |
853 | target_link_libraries(unittest_rbd_replay | |
854 | librbd | |
855 | librados | |
856 | global | |
857 | rbd_replay | |
858 | rbd_replay_ios | |
859 | ${BLKID_LIBRARIES} | |
860 | ) | |
861 | endif(WITH_RBD) | |
862 | ||
863 | # unittest_ipaddr | |
864 | add_executable(unittest_ipaddr | |
865 | test_ipaddr.cc) | |
866 | add_ceph_unittest(unittest_ipaddr ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ipaddr) | |
867 | target_link_libraries(unittest_ipaddr mon global) | |
868 | ||
869 | # unittest_texttable | |
870 | add_executable(unittest_texttable | |
871 | test_texttable.cc | |
872 | $<TARGET_OBJECTS:common_texttable_obj> | |
873 | ) | |
874 | add_ceph_unittest(unittest_texttable ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_texttable) | |
875 | target_link_libraries(unittest_texttable mon global) | |
876 | ||
877 | # unittest_on_exit | |
878 | add_executable(unittest_on_exit | |
879 | on_exit.cc | |
880 | ) | |
881 | add_ceph_unittest(unittest_on_exit ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_on_exit) | |
882 | target_link_libraries(unittest_on_exit global) | |
883 | ||
884 | # unittest_subprocess | |
885 | add_executable(unittest_subprocess | |
886 | test_subprocess.cc | |
887 | ) | |
888 | add_ceph_unittest(unittest_subprocess ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_subprocess) | |
889 | target_link_libraries(unittest_subprocess global) | |
890 | ||
891 | # unittest_pageset | |
892 | add_executable(unittest_pageset test_pageset.cc) | |
893 | add_ceph_unittest(unittest_pageset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_pageset) | |
894 | target_link_libraries(unittest_pageset global) | |
895 | ||
896 | #make check ends here | |
897 |