MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / ensure_parity_setup

Function ensure_parity_setup

tests/test_parallel.c:377–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375static int g_parity_setup_done = 0;
376
377static int ensure_parity_setup(void) {
378 if (g_parity_setup_done)
379 return 0;
380
381 if (setup_parallel_repo() != 0)
382 return -1;
383
384 /* Discover files */
385 cbm_discover_opts_t opts = {.mode = CBM_MODE_FULL};
386 cbm_file_info_t *files = NULL;
387 int file_count = 0;
388 if (cbm_discover(g_par_tmpdir, &opts, &files, &file_count) != 0)
389 return -1;
390
391 const char *project = "par-test";
392
393 /* Build structure for both (need File/Folder nodes before definitions) */
394 /* For parity, we need the structure pass too. Let's just compare
395 * definition/call/usage/semantic edge counts. */
396
397 /* Run both modes */
398 g_seq_gbuf = run_sequential(project, g_par_tmpdir, files, file_count);
399 g_par_gbuf = run_parallel(project, g_par_tmpdir, files, file_count, 2);
400
401 cbm_discover_free(files, file_count);
402 g_parity_setup_done = 1;
403 return 0;
404}
405
406static void parity_teardown(void) {
407 if (g_seq_gbuf) {

Callers 2

test_parallel.cFile · 0.85
assert_edge_type_parityFunction · 0.85

Calls 5

setup_parallel_repoFunction · 0.85
cbm_discoverFunction · 0.85
run_sequentialFunction · 0.85
run_parallelFunction · 0.85
cbm_discover_freeFunction · 0.85

Tested by

no test coverage detected