forked from lei.chen/myxce
- Add `persist_t persist` field to cluster_t (cluster_def.h includes persist.h) - Add `workdir` and `name` fields to myconf_t; main.c passes them through - cluster_init: call persist_set_workdir, persist_init, persist_recover after apiserver_init - cluster_start: call persist_start (launches fsync thread + registers WAL hooks) - cluster_fini: call persist_stop + persist_fini before delaymgr/vtaskmgr teardown - persist_init: store cluster back-pointer (replaces (void)c stub) - persist_start: register persist_job/queue/worker_hook_fun via xce_add_hook when cluster != NULL - Add test_cluster_persist.c: compile-time struct check + config defaults + workdir path derivation - Register test in controller_test.c and meson.build All controller tests pass (1/1 OK, 50s).
101 lines
2.3 KiB
Meson
101 lines
2.3 KiB
Meson
controller_src = [
|
|
'cluster.c',
|
|
'dataex.c',
|
|
'job.c',
|
|
'join.c',
|
|
'main.c',
|
|
'misc.c',
|
|
'myapp.c',
|
|
'opget.c',
|
|
'opupd.c',
|
|
'queue.c',
|
|
'reply.c',
|
|
'resources.c',
|
|
'sched.c',
|
|
'task.c',
|
|
'worker.c',
|
|
'apiserver.c',
|
|
'myconf.c',
|
|
'persist.c',
|
|
]
|
|
|
|
incdir = include_directories('.', '../include', '../lib',
|
|
'include')
|
|
|
|
# cc = meson.get_compiler('c')
|
|
# math_dep = cc.find_library('m', required : false)
|
|
|
|
zlib_dep = dependency('zlib')
|
|
|
|
controller_deps = [
|
|
libxce_dep,
|
|
librtti_dep,
|
|
c_capnproto_dep,
|
|
math_dep,
|
|
tinylog_dep,
|
|
thread_dep,
|
|
zlib_dep,
|
|
]
|
|
|
|
controller = executable('xce_controller',
|
|
controller_src,
|
|
include_directories: incdir,
|
|
dependencies: controller_deps,
|
|
link_args: wrap_link_args,
|
|
install: true)
|
|
|
|
xce_test_src = [ 'testsuite/test.c']
|
|
|
|
readline_dep = dependency('readline')
|
|
ncurses_dep = dependency('ncurses')
|
|
history_dep = dependency('history')
|
|
|
|
xce_test_deps = [
|
|
libxce_dep,
|
|
librtti_dep,
|
|
struct2json_dep,
|
|
readline_dep,
|
|
history_dep,
|
|
ncurses_dep,
|
|
tinylog_dep,
|
|
]
|
|
xce_test = executable('xce_test',
|
|
xce_test_src,
|
|
include_directories: [incdir],
|
|
dependencies: xce_test_deps,
|
|
install: true)
|
|
|
|
# Controller Unity test suite (persist types and future controller unit tests)
|
|
controller_unit_test_src = [
|
|
'testsuite/controller_test.c',
|
|
'testsuite/test_persist_types.c',
|
|
'testsuite/test_persist_wal.c',
|
|
'testsuite/test_persist_schema.c',
|
|
'testsuite/test_persist_checkpoint.c',
|
|
'testsuite/test_persist_recovery.c',
|
|
'testsuite/test_hooks.c',
|
|
'testsuite/test_persist_hooks.c',
|
|
'testsuite/test_gc_retention.c',
|
|
'testsuite/test_cluster_persist.c',
|
|
'persist.c',
|
|
]
|
|
|
|
controller_unit_test_deps = [
|
|
libxce_dep,
|
|
unity_dep,
|
|
tinylog_dep,
|
|
thread_dep,
|
|
zlib_dep,
|
|
c_capnproto_dep,
|
|
]
|
|
|
|
controller_unit_test = executable('controller_unit_test',
|
|
controller_unit_test_src,
|
|
include_directories: [incdir],
|
|
dependencies: controller_unit_test_deps,
|
|
install: false)
|
|
|
|
test('controller test', controller_unit_test,
|
|
suite: 'controller',
|
|
timeout: 120)
|
|
|