summaryrefslogtreecommitdiffstats
path: root/src/test/objectstore/CMakeLists.txt
blob: 3294616b9b26fa7f191b1b4e3ab76a5f61cdd046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
add_executable(ceph_perf_objectstore 
  ObjectStoreTransactionBenchmark.cc)
target_link_libraries(ceph_perf_objectstore os osdc global ${UNITTEST_LIBS})
install(TARGETS ceph_perf_objectstore
  DESTINATION bin)

add_library(store_test_fixture OBJECT store_test_fixture.cc)
target_include_directories(store_test_fixture PRIVATE
  $<TARGET_PROPERTY:GTest::GTest,INTERFACE_INCLUDE_DIRECTORIES>)

add_executable(ceph_test_objectstore
  store_test.cc
  $<TARGET_OBJECTS:store_test_fixture>)
target_link_libraries(ceph_test_objectstore
  os
  ceph-common
  ${UNITTEST_LIBS}
  global
  ${EXTRALIBS}
  ${BLKID_LIBRARIES}
  ${CMAKE_DL_LIBS}
  )
install(TARGETS ceph_test_objectstore
  DESTINATION ${CMAKE_INSTALL_BINDIR})

add_executable(ceph_test_keyvaluedb
  test_kv.cc)
target_link_libraries(ceph_test_keyvaluedb
  os
  ceph-common
  ${UNITTEST_LIBS}
  global
  ${EXTRALIBS}
  ${BLKID_LIBRARIES}
  ${CMAKE_DL_LIBS}
  )
install(TARGETS ceph_test_keyvaluedb
  DESTINATION ${CMAKE_INSTALL_BINDIR})

# ceph_test_filestore_idempotent
add_executable(ceph_test_filestore_idempotent
  test_idempotent.cc
  FileStoreTracker.cc
  ${CMAKE_SOURCE_DIR}/src/test/common/ObjectContents.cc
  )
target_link_libraries(ceph_test_filestore_idempotent
  os
  global
  ${EXTRALIBS}
  ${BLKID_LIBRARIES}
  ${CMAKE_DL_LIBS}
  )

# ceph_test_filestore_idempotent_sequence
add_executable(ceph_test_filestore_idempotent_sequence
  test_idempotent_sequence.cc
  DeterministicOpSequence.cc
  TestObjectStoreState.cc
  FileStoreDiff.cc
  )
target_link_libraries(ceph_test_filestore_idempotent_sequence
  os
  global
  ${EXTRALIBS}
  ${BLKID_LIBRARIES}
  ${CMAKE_DL_LIBS}
  )
install(TARGETS ceph_test_filestore_idempotent_sequence
  DESTINATION ${CMAKE_INSTALL_BINDIR})

# unittest_chain_xattr
add_executable(unittest_chain_xattr
  chain_xattr.cc
  )
add_ceph_unittest(unittest_chain_xattr)
target_link_libraries(unittest_chain_xattr os global)

# unittest_rocksdb_option
add_executable(unittest_rocksdb_option
  TestRocksdbOptionParse.cc
  $<TARGET_OBJECTS:unit-main>
  )
add_ceph_unittest(unittest_rocksdb_option)
target_link_libraries(unittest_rocksdb_option global os ${BLKID_LIBRARIES})

if(WITH_EVENTTRACE)
  add_dependencies(os eventtrace_tp)
endif()

if(WITH_BLUESTORE)

  add_executable(unittest_alloc
    Allocator_test.cc
    $<TARGET_OBJECTS:unit-main>
    )
  add_ceph_unittest(unittest_alloc)
  target_link_libraries(unittest_alloc os global)

  add_executable(unittest_alloc_bench
    Allocator_bench.cc
    $<TARGET_OBJECTS:unit-main>
    )
  target_link_libraries(unittest_alloc_bench ${UNITTEST_LIBS} os global)

  add_executable(unittest_fastbmap_allocator
    fastbmap_allocator_test.cc
    $<TARGET_OBJECTS:unit-main>
    )
  add_ceph_unittest(unittest_fastbmap_allocator)
  target_link_libraries(unittest_fastbmap_allocator os global)

  set_target_properties(unittest_fastbmap_allocator PROPERTIES COMPILE_FLAGS
  "${UNITTEST_CXX_FLAGS}")

  add_executable(unittest_hybrid_allocator
    hybrid_allocator_test.cc
    $<TARGET_OBJECTS:unit-main>
    )
  add_ceph_unittest(unittest_hybrid_allocator)
  target_link_libraries(unittest_hybrid_allocator os global)

  set_target_properties(unittest_hybrid_allocator PROPERTIES COMPILE_FLAGS
  "${UNITTEST_CXX_FLAGS}")

  add_executable(unittest_alloc_aging EXCLUDE_FROM_ALL
    Allocator_aging_fragmentation.cc)
  target_link_libraries(unittest_alloc_aging os global GTest::Main)

  # unittest_bluefs
  add_executable(unittest_bluefs
    test_bluefs.cc
    )
  add_ceph_unittest(unittest_bluefs)
  target_link_libraries(unittest_bluefs os global)

  # unittest_bluestore_types
  add_executable(unittest_bluestore_types
    test_bluestore_types.cc
    )
  add_ceph_unittest(unittest_bluestore_types)
  target_link_libraries(unittest_bluestore_types os global)

  # unittest_bdev
  add_executable(unittest_bdev
    test_bdev.cc
    )
  add_ceph_unittest(unittest_bdev)
  target_link_libraries(unittest_bdev os global)

  # unittest_deferred
  add_executable(unittest_deferred
    test_deferred.cc
    )
  add_ceph_unittest(unittest_deferred)
  target_link_libraries(unittest_deferred os global)

endif(WITH_BLUESTORE)

# unittest_transaction
add_executable(unittest_transaction
  test_transaction.cc)
add_ceph_unittest(unittest_transaction)
target_link_libraries(unittest_transaction os ceph-common)

# unittest_memstore_clone
add_executable(unittest_memstore_clone
  test_memstore_clone.cc
  $<TARGET_OBJECTS:store_test_fixture>)
add_ceph_unittest(unittest_memstore_clone)
target_link_libraries(unittest_memstore_clone os global)

if(WITH_BLUESTORE)
  add_executable(ceph_test_alloc_replay
    allocator_replay_test.cc)
  target_link_libraries(ceph_test_alloc_replay os global ${UNITTEST_LIBS})
  install(TARGETS ceph_test_alloc_replay
    DESTINATION bin)
endif()