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