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