MB-23591: Re-instate isBucketDeletion check for flusher
[ep-engine.git] / CMakeLists.txt
1 PROJECT(EventuallyPersistentEngine)
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
3
4 IF (${CMAKE_MAJOR_VERSION} GREATER 2)
5     CMAKE_POLICY(SET CMP0042 NEW)
6 ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2)
7
8 INCLUDE(CheckFunctionExists)
9 INCLUDE(CheckIncludeFileCXX)
10 INCLUDE(CheckIncludeFiles)
11 INCLUDE(CheckLibraryExists)
12 INCLUDE(CheckSymbolExists)
13 INCLUDE(CheckTypeSize)
14 INCLUDE(CTest)
15
16 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_INSTALL_PREFIX}/include
17                            ${CMAKE_CURRENT_SOURCE_DIR}
18                            ${CMAKE_CURRENT_SOURCE_DIR}/src
19                            ${CMAKE_CURRENT_BINARY_DIR}/src
20                            ${SNAPPY_INCLUDE_DIR}
21                            ${Platform_SOURCE_DIR}/include
22                            ${Platform_SOURCE_DIR}/external
23                            ${Memcached_SOURCE_DIR}
24                            ${Memcached_SOURCE_DIR}/include
25                            ${Couchstore_SOURCE_DIR}/include
26                            ${ForestDB_SOURCE_DIR}/include
27                            ${CMAKE_CURRENT_BINARY_DIR})
28
29 INCLUDE_DIRECTORIES(AFTER
30                     ${gmock_SOURCE_DIR}/include
31                     ${gtest_SOURCE_DIR}/include)
32
33 CHECK_INCLUDE_FILES("alloca.h" HAVE_ALLOCA_H)
34 CHECK_INCLUDE_FILES("arpa/inet.h" HAVE_ARPA_INET_H)
35 CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
36 CHECK_INCLUDE_FILES("netdb.h" HAVE_NETDB_H)
37 CHECK_INCLUDE_FILES("mach/mach_time.h" HAVE_MACH_MACH_TIME_H)
38 CHECK_INCLUDE_FILES("poll.h" HAVE_POLL_H)
39 CHECK_INCLUDE_FILES("sysexits.h" HAVE_SYSEXITS_H)
40 CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
41 CHECK_INCLUDE_FILES("sched.h" HAVE_SCHED_H)
42 CHECK_INCLUDE_FILES("sys/socket.h" HAVE_SYS_SOCKET_H)
43 CHECK_INCLUDE_FILES("sys/time.h" HAVE_SYS_TIME_H)
44 CHECK_INCLUDE_FILES("netinet/in.h" HAVE_NETINET_IN_H)
45 CHECK_INCLUDE_FILES("netinet/tcp.h" HAVE_NETINET_TCP_H)
46 CHECK_INCLUDE_FILE_CXX("unordered_map" HAVE_UNORDERED_MAP)
47 CHECK_INCLUDE_FILE_CXX("atomic" HAVE_ATOMIC)
48 CHECK_INCLUDE_FILE_CXX("thread" HAVE_THREAD)
49
50 CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME)
51 CHECK_FUNCTION_EXISTS(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME)
52 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
53 CHECK_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG)
54
55 # ---- uncomment the lines below ONLY for dev/debugging ---
56 #if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
57 #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
58 #elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
59 #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
60 #endif()
61
62 IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
63    EXECUTE_PROCESS(COMMAND git rev-parse HEAD
64                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
65                    OUTPUT_VARIABLE EP_ENGINE_VERSION
66                    OUTPUT_STRIP_TRAILING_WHITESPACE)
67    IF (EP_ENGINE_VERSION STREQUAL "" OR EP_ENGINE_VERSION STREQUAL "HEAD")
68      MESSAGE (FATAL_ERROR "Failed to determine commit SHA!")
69    ENDIF (EP_ENGINE_VERSION STREQUAL "" OR EP_ENGINE_VERSION STREQUAL "HEAD")
70 ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
71    SET(EP_ENGINE_VERSION "unknown")
72 ENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
73
74 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/src/config.cmake.h
75                 ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
76
77 # Generate the python wrappers
78 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
79                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbepctl)
80 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
81                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbstats)
82 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
83                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbcompact)
84 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
85                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvdiff)
86 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
87                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvbucketctl)
88
89 IF (WIN32)
90    INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/platform/include/win32)
91 ENDIF (WIN32)
92
93 ADD_EXECUTABLE(gencode tools/gencode.cc)
94 TARGET_LINK_LIBRARIES(gencode cJSON platform)
95
96 ADD_EXECUTABLE(genconfig tools/genconfig.cc)
97 TARGET_LINK_LIBRARIES(genconfig cJSON platform)
98
99 ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
100                           ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.h
101                   COMMAND
102                      gencode -j ${CMAKE_CURRENT_SOURCE_DIR}/docs/stats.json -h ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.h -c ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c -f get_stats_info
103                   DEPENDS
104                         docs/stats.json
105                         gencode
106                   COMMENT "Generating code for stats info")
107
108 ADD_CUSTOM_COMMAND(OUTPUT
109                      ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.cc
110                      ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.h
111                   COMMAND
112                      genconfig ${CMAKE_CURRENT_SOURCE_DIR}/configuration.json
113                   DEPENDS
114                         configuration.json
115                         genconfig
116                   COMMENT "Generating code for configuration class")
117
118 SET(KVSTORE_SOURCE src/crc32.c src/kvstore.cc)
119 SET(COUCH_KVSTORE_SOURCE src/couch-kvstore/couch-kvstore.cc
120             src/couch-kvstore/couch-fs-stats.cc)
121 SET(FOREST_KVSTORE_SOURCE src/forest-kvstore/forest-kvstore.cc)
122 SET(OBJECTREGISTRY_SOURCE src/objectregistry.cc)
123 SET(CONFIG_SOURCE src/configuration.cc
124   ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.cc)
125
126 ADD_LIBRARY(ep SHARED
127             src/access_scanner.cc
128             src/atomic.cc
129             src/backfill.cc
130             src/bgfetcher.cc
131             src/bloomfilter.cc
132             src/checkpoint.cc
133             src/checkpoint_remover.cc
134             src/compress.cc
135             src/conflict_resolution.cc
136             src/connmap.cc
137             src/dcp/backfill-manager.cc
138             src/dcp/backfill.cc
139             src/dcp/consumer.cc
140             src/dcp/flow-control.cc
141             src/dcp/flow-control-manager.cc
142             src/dcp/producer.cc
143             src/dcp/response.cc
144             src/dcp/stream.cc
145             src/defragmenter.cc
146             src/defragmenter_visitor.cc
147             src/ep.cc
148             src/ep_engine.cc
149             src/ep_time.cc
150             src/executorpool.cc
151             src/executorthread.cc
152             src/ext_meta_parser.cc
153             src/failover-table.cc
154             src/flusher.cc
155             src/htresizer.cc
156             src/item.cc
157             src/item_pager.cc
158             src/logger.cc
159             src/kvshard.cc
160             src/memory_tracker.cc
161             src/murmurhash3.cc
162             src/mutation_log.cc
163             src/replicationthrottle.cc
164             src/sizes.cc
165             ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
166             src/string_utils.cc
167             src/stored-value.cc
168             src/tapconnection.cc
169             src/tasks.cc
170             src/taskqueue.cc
171             src/vbucket.cc
172             src/vbucketmap.cc
173             src/warmup.cc
174             ${KVSTORE_SOURCE} ${COUCH_KVSTORE_SOURCE}
175             ${FOREST_KVSTORE_SOURCE} ${OBJECTREGISTRY_SOURCE}
176             ${CONFIG_SOURCE})
177
178 SET_TARGET_PROPERTIES(ep PROPERTIES PREFIX "")
179 TARGET_LINK_LIBRARIES(ep cJSON JSON_checker couchstore forestdb
180   dirutils platform ${LIBEVENT_LIBRARIES})
181
182 # Single executable containing all class-level unit tests involving
183 # EventuallyPersistentEngine driven by GoogleTest.
184 # (We end up compiling most of the src/ files of ep-engine for these unit tests,
185 # so simpler / quicker just to link them into a single executable).
186 ADD_EXECUTABLE(ep-engine_ep_unit_tests
187   tests/mock/mock_dcp.cc
188   tests/module_tests/checkpoint_test.cc
189   tests/module_tests/defragmenter_test.cc
190   tests/module_tests/ep_unit_tests_main.cc
191   tests/module_tests/dcp_test.cc
192   tests/module_tests/evp_engine_test.cc
193   tests/module_tests/evp_store_rollback_test.cc
194   tests/module_tests/evp_store_test.cc
195   tests/module_tests/evp_store_single_threaded_test.cc
196   tests/module_tests/mutation_log_test.cc
197   src/access_scanner.cc
198   src/atomic.cc
199   src/backfill.cc
200   src/bgfetcher.cc
201   src/bloomfilter.cc
202   src/checkpoint.cc
203   src/checkpoint_remover.cc
204   src/conflict_resolution.cc
205   src/compress.cc
206   src/connmap.cc
207   src/dcp/backfill.cc
208   src/dcp/backfill-manager.cc
209   src/dcp/consumer.cc
210   src/dcp/flow-control.cc
211   src/dcp/flow-control-manager.cc
212   src/dcp/producer.cc
213   src/dcp/response.cc
214   src/dcp/stream.cc
215   src/defragmenter.cc
216   src/defragmenter_visitor.cc
217   src/ep.cc
218   src/ep_engine.cc
219   src/ep_time.cc
220   src/executorpool.cc
221   src/executorthread.cc
222   src/ext_meta_parser.cc
223   src/failover-table.cc
224   src/flusher.cc
225   src/htresizer.cc
226   src/item.cc
227   src/item_pager.cc
228   src/kvshard.cc
229   src/logger.cc
230   src/memory_tracker.cc
231   src/murmurhash3.cc
232   src/mutation_log.cc
233   src/objectregistry.cc
234   src/tapconnection.cc
235   src/replicationthrottle.cc
236   src/stored-value.cc
237   src/string_utils.cc
238   src/tasks.cc
239   src/taskqueue.cc
240   src/vbucket.cc
241   src/vbucketmap.cc
242   src/warmup.cc
243   ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
244   ${CONFIG_SOURCE}
245   ${KVSTORE_SOURCE}
246   ${COUCH_KVSTORE_SOURCE}
247   ${FOREST_KVSTORE_SOURCE}
248   $<TARGET_OBJECTS:memory_tracking>
249   ${Memcached_SOURCE_DIR}/programs/engine_testapp/mock_server.cc)
250 TARGET_LINK_LIBRARIES(ep-engine_ep_unit_tests couchstore cJSON dirutils forestdb gmock gtest JSON_checker mcd_util platform
251                       ${MALLOC_LIBRARIES})
252
253 ADD_EXECUTABLE(ep-engine_atomic_ptr_test
254   tests/module_tests/atomic_ptr_test.cc
255   src/atomic.cc
256   src/testlogger.cc)
257 TARGET_LINK_LIBRARIES(ep-engine_atomic_ptr_test platform)
258
259 ADD_EXECUTABLE(ep-engine_atomic_test
260   tests/module_tests/atomic_test.cc
261   src/testlogger.cc)
262 TARGET_LINK_LIBRARIES(ep-engine_atomic_test platform)
263
264 ADD_EXECUTABLE(ep-engine_chunk_creation_test
265   tests/module_tests/chunk_creation_test.cc)
266 TARGET_LINK_LIBRARIES(ep-engine_chunk_creation_test platform)
267
268 ADD_EXECUTABLE(ep-engine_compress_test
269   tests/module_tests/compress_test.cc
270   src/compress.cc)
271 TARGET_LINK_LIBRARIES(ep-engine_compress_test ${SNAPPY_LIBRARIES} platform)
272
273 ADD_EXECUTABLE(ep-engine_configuration_test
274         tests/module_tests/configuration_test.cc
275         src/configuration.cc
276         src/generated_configuration.h
277         src/objectregistry.cc
278         src/testlogger.cc)
279 TARGET_LINK_LIBRARIES(ep-engine_configuration_test gtest gtest_main platform)
280
281 ADD_EXECUTABLE(ep-engine_hash_table_test
282   tests/module_tests/hash_table_test.cc
283   src/atomic.cc
284   src/compress.cc
285   src/item.cc
286   src/stored-value.cc
287   src/testlogger.cc
288   ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
289 TARGET_LINK_LIBRARIES(ep-engine_hash_table_test gtest ${SNAPPY_LIBRARIES} platform)
290
291 ADD_EXECUTABLE(ep-engine_hrtime_test tests/module_tests/hrtime_test.cc)
292 TARGET_LINK_LIBRARIES(ep-engine_hrtime_test platform)
293
294 ADD_EXECUTABLE(ep-engine_memory_tracker_test
295   tests/module_tests/memory_tracker_test.cc
296   tests/module_tests/mock_hooks_api.cc
297   src/memory_tracker.cc
298   src/testlogger.cc
299   ${OBJECTREGISTRY_SOURCE}
300   ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.h)
301 TARGET_LINK_LIBRARIES(ep-engine_memory_tracker_test gtest gtest_main platform)
302
303 ADD_EXECUTABLE(ep-engine_misc_test tests/module_tests/misc_test.cc)
304 TARGET_LINK_LIBRARIES(ep-engine_misc_test platform)
305 ADD_EXECUTABLE(ep-engine_mutex_test
306                tests/module_tests/mutex_test.cc
307                src/testlogger.cc)
308 TARGET_LINK_LIBRARIES(ep-engine_mutex_test gtest gtest_main platform)
309
310 ADD_EXECUTABLE(ep-engine_ringbuffer_test tests/module_tests/ringbuffer_test.cc)
311 TARGET_LINK_LIBRARIES(ep-engine_ringbuffer_test platform)
312
313 ADD_EXECUTABLE(ep-engine_string_utils_test
314                tests/module_tests/string_utils_test.cc
315                src/string_utils.cc)
316 TARGET_LINK_LIBRARIES(ep-engine_string_utils_test gtest gtest_main platform)
317
318 ADD_EXECUTABLE(ep-engine_failover_table_test tests/module_tests/failover_table_test.cc
319                         src/failover-table.cc src/testlogger.cc
320                         ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
321 TARGET_LINK_LIBRARIES(ep-engine_failover_table_test cJSON platform)
322
323 ADD_EXECUTABLE(ep-engine_kvstore_test
324   tests/module_tests/kvstore_test.cc
325   src/compress.cc
326   src/testlogger.cc
327   ${OBJECTREGISTRY_SOURCE} ${KVSTORE_SOURCE} ${COUCH_KVSTORE_SOURCE}
328   ${FOREST_KVSTORE_SOURCE} ${CONFIG_SOURCE})
329 TARGET_LINK_LIBRARIES(ep-engine_kvstore_test
330                       cJSON JSON_checker couchstore dirutils forestdb
331                       gmock gtest platform)
332
333 ADD_TEST(ep-engine_atomic_ptr_test ep-engine_atomic_ptr_test)
334 ADD_TEST(ep-engine_atomic_test ep-engine_atomic_test)
335 ADD_TEST(ep-engine_chunk_creation_test ep-engine_chunk_creation_test)
336 ADD_TEST(ep-engine_compress_test ep-engine_compress_test)
337 ADD_TEST(ep-engine_configuration_test ep-engine_configuration_test)
338 ADD_TEST(ep-engine_ep_unit_tests ep-engine_ep_unit_tests)
339 ADD_TEST(ep-engine_failover_table_test ep-engine_failover_table_test)
340 ADD_TEST(ep-engine_hash_table_test ep-engine_hash_table_test)
341 ADD_TEST(ep-engine_hrtime_test ep-engine_hrtime_test)
342 ADD_TEST(ep-engine_misc_test ep-engine_misc_test)
343 ADD_TEST(ep-engine_mutex_test ep-engine_mutex_test)
344 ADD_TEST(ep-engine_ringbuffer_test ep-engine_ringbuffer_test)
345 ADD_TEST(ep-engine_kvstore_test ep-engine_kvstore_test)
346 ADD_TEST(ep-engine_memory_tracker_test ep-engine_memory_tracker_test)
347
348 ADD_LIBRARY(timing_tests SHARED tests/module_tests/timing_tests.cc)
349 SET_TARGET_PROPERTIES(timing_tests PROPERTIES PREFIX "")
350 TARGET_LINK_LIBRARIES(timing_tests platform)
351
352 ADD_EXECUTABLE(ep-engine_sizes src/sizes.cc src/mutex.h src/testlogger.cc
353               ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
354 TARGET_LINK_LIBRARIES(ep-engine_sizes platform)
355
356 ADD_LIBRARY(ep_testsuite SHARED
357    tests/ep_testsuite.cc
358    src/atomic.cc
359    src/compress.cc
360    src/ep_time.cc
361    src/ext_meta_parser.cc
362    src/item.cc
363    src/testlogger.cc
364    tests/ep_testsuite_common.cc
365    tests/ep_test_apis.cc
366    tests/mock/mock_dcp.cc
367    ${OBJECTREGISTRY_SOURCE}
368    ${CONFIG_SOURCE})
369 SET_TARGET_PROPERTIES(ep_testsuite PROPERTIES PREFIX "")
370 TARGET_LINK_LIBRARIES(ep_testsuite couchstore dirutils JSON_checker platform
371                       ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
372
373 ADD_LIBRARY(ep_testsuite_basic SHARED
374    tests/ep_testsuite_basic.cc
375    src/compress.cc
376    src/ext_meta_parser.cc
377    tests/ep_testsuite_common.cc
378    tests/ep_test_apis.cc
379    tests/mock/mock_dcp.cc
380 )
381 SET_TARGET_PROPERTIES(ep_testsuite_basic PROPERTIES PREFIX "")
382 TARGET_LINK_LIBRARIES(ep_testsuite_basic JSON_checker dirutils platform ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
383
384 ADD_LIBRARY(ep_testsuite_dcp SHARED
385 tests/ep_testsuite_dcp.cc
386 src/compress.cc
387 src/ext_meta_parser.cc
388 tests/ep_testsuite_common.cc
389 tests/ep_test_apis.cc
390 tests/mock/mock_dcp.cc
391 )
392 SET_TARGET_PROPERTIES(ep_testsuite_dcp PROPERTIES PREFIX "")
393 TARGET_LINK_LIBRARIES(ep_testsuite_dcp JSON_checker dirutils platform ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
394
395 ADD_LIBRARY(ep_testsuite_tap SHARED
396    tests/ep_testsuite_common.cc
397    tests/ep_testsuite_tap.cc
398    tests/ep_test_apis.cc
399    src/ext_meta_parser.cc)
400 SET_TARGET_PROPERTIES(ep_testsuite_tap PROPERTIES PREFIX "")
401 TARGET_LINK_LIBRARIES(ep_testsuite_tap JSON_checker dirutils platform ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
402
403 ADD_LIBRARY(ep_testsuite_checkpoint SHARED
404    tests/ep_testsuite_common.cc
405    tests/ep_testsuite_checkpoint.cc
406    tests/ep_test_apis.cc
407    src/ext_meta_parser.cc)
408 SET_TARGET_PROPERTIES(ep_testsuite_checkpoint PROPERTIES PREFIX "")
409 TARGET_LINK_LIBRARIES(ep_testsuite_checkpoint JSON_checker dirutils platform ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
410
411 ADD_LIBRARY(ep_testsuite_xdcr SHARED
412    tests/ep_testsuite_common.cc
413    tests/ep_testsuite_xdcr.cc
414    tests/ep_test_apis.cc
415    src/ext_meta_parser.cc)
416 SET_TARGET_PROPERTIES(ep_testsuite_xdcr PROPERTIES PREFIX "")
417 TARGET_LINK_LIBRARIES(ep_testsuite_xdcr JSON_checker dirutils platform ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
418
419 ADD_LIBRARY(ep_perfsuite SHARED
420    tests/ep_perfsuite.cc
421    src/ext_meta_parser.cc
422    tests/ep_testsuite_common.cc
423    tests/ep_test_apis.cc
424    tests/mock/mock_dcp.cc)
425 SET_TARGET_PROPERTIES(ep_perfsuite PROPERTIES PREFIX "")
426 TARGET_LINK_LIBRARIES(ep_perfsuite dirutils platform)
427
428 #ADD_CUSTOM_COMMAND(OUTPUT
429 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_0.c
430 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_1.c
431 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_2.c
432 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_3.c
433 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_4.c
434 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_5.c
435 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_6.c
436 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_7.c
437 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_8.c
438 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_9.c
439 #                  COMMAND
440 #                     ${PYTHON_EXECUTABLE} tests/module_tests/gen_engine_test.py
441 #                  DEPENDS
442 #                        tests/module_tests/gen_engine_test.py
443 #                        tests/module_tests/breakdancer.py
444 #                  COMMENT "Generating testsuite")
445 #
446 #ADD_LIBRARY(generated_testsuite SHARED
447 #            tests/suite_stubs.c
448 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_0.c
449 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_1.c
450 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_2.c
451 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_3.c
452 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_4.c
453 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_5.c
454 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_6.c
455 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_7.c
456 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_8.c
457 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_9.c)
458
459 #SET_TARGET_PROPERTIES(generated_testsuite PROPERTIES PREFIX "")
460
461 INSTALL(PROGRAMS
462         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbepctl
463         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbstats
464         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbcompact
465         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvdiff
466         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvbucketctl
467         management/cbanalyze-core
468         DESTINATION bin)
469
470 INSTALL(PROGRAMS
471         management/cbepctl
472         management/cbstats
473         management/cbcompact
474         management/cbvdiff
475         management/cbvbucketctl
476         DESTINATION lib/python)
477
478 INSTALL(FILES
479         management/clitool.py
480         management/mc_bin_client.py
481         management/mc_bin_server.py
482         management/memcacheConstants.py
483         management/tap.py
484         management/tap_example.py
485         DESTINATION lib/python)
486
487 INSTALL(FILES
488         docs/stats.org
489         DESTINATION share/doc/ep-engine)
490
491 INSTALL(TARGETS ep
492         RUNTIME DESTINATION bin
493         LIBRARY DESTINATION lib
494         ARCHIVE DESTINATION lib)
495
496
497 # Defines a testsuite which runs in full and value eviction variants.
498 FUNCTION(ADD_TESTSUITE value_evict_name full_evict_name testsuite_so timeout)
499   SET(_cmdline
500       ${CMAKE_BINARY_DIR}/memcached/engine_testapp -E ${CMAKE_CURRENT_BINARY_DIR}/ep.so -T ${testsuite_so})
501   ADD_TEST(NAME ${value_evict_name}
502          COMMAND ${_cmdline} -v -e "dbname=./${value_evict_name}")
503   ADD_TEST(NAME ${full_evict_name}
504          COMMAND ${_cmdline} -v -e "item_eviction_policy=full_eviction$<SEMICOLON>dbname=./${full_evict_name}")
505   SET_TESTS_PROPERTIES(${value_evict_name} PROPERTIES TIMEOUT ${timeout})
506   SET_TESTS_PROPERTIES(${full_evict_name} PROPERTIES TIMEOUT ${timeout})
507 ENDFUNCTION()
508
509 ADD_TESTSUITE(ep-engine_engine_tests ep-engine_full_eviction_tests
510               ${CMAKE_CURRENT_BINARY_DIR}/ep_testsuite.so
511               1800)
512
513 ADD_TESTSUITE(ep-engine_basic_tests ep-engine_full_eviction_basic
514               ${CMAKE_CURRENT_BINARY_DIR}/ep_testsuite_basic.so
515               600)
516
517 ADD_TESTSUITE(ep-engine_dcp_tests ep-engine_full_eviction_dcp
518               ${CMAKE_CURRENT_BINARY_DIR}/ep_testsuite_dcp.so
519               1200)
520
521 ADD_TESTSUITE(ep-engine_value_eviction_tap ep-engine_full_eviction_tap
522               ${CMAKE_CURRENT_BINARY_DIR}/ep_testsuite_tap.so
523               180)
524
525 ADD_TESTSUITE(ep-engine_value_eviction_checkpoint ep-engine_full_eviction_checkpoint
526               ${CMAKE_CURRENT_BINARY_DIR}/ep_testsuite_checkpoint.so
527               120)
528
529 ADD_TESTSUITE(ep-engine_value_eviction_xdcr ep-engine_full_eviction_xdcr
530               ${CMAKE_CURRENT_BINARY_DIR}/ep_testsuite_xdcr.so
531               120)
532
533 # ================================ PERF_TESTS ================================ #
534 SET(_ep_perfsuite_cmdline ${CMAKE_BINARY_DIR}/memcached/engine_testapp -E ${CMAKE_CURRENT_BINARY_DIR}/ep.so -T ${CMAKE_CURRENT_BINARY_DIR}/ep_perfsuite.so -v)
535
536 # Micro perf tests: value-only eviction mode. Note that it makes no sense to run
537 # these tests in full-eviction mode as we disable persistence - see MB-19504.
538 ADD_CUSTOM_TARGET(test-perfsuite
539                   COMMAND ${_ep_perfsuite_cmdline}
540                   DEPENDS ${CMAKE_BINARY_DIR}/memcached/engine_testapp
541                           ep
542                           ep_perfsuite
543                   VERBATIM)
544 ADD_TEST(NAME ep-engine_perfsuite
545          COMMAND ${_ep_perfsuite_cmdline} -e "dbname=./value_eviction_perf")
546
547 # ============================================================================ #
548
549 ENABLE_CODE_COVERAGE_REPORT()