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

Function ensure_parity_setup

tests/test_parallel.c:441–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439static int g_parity_setup_done = 0;
440
441static int ensure_parity_setup(void) {
442 if (g_parity_setup_done)
443 return 0;
444
445 if (setup_parallel_repo() != 0)
446 return -1;
447
448 /* Discover files */
449 cbm_discover_opts_t opts = {.mode = CBM_MODE_FULL};
450 cbm_file_info_t *files = NULL;
451 int file_count = 0;
452 if (cbm_discover(g_par_tmpdir, &opts, &files, &file_count) != 0)
453 return -1;
454
455 const char *project = "par-test";
456
457 /* Build structure for both (need File/Folder nodes before definitions) */
458 /* For parity, we need the structure pass too. Let's just compare
459 * definition/call/usage/semantic edge counts. */
460
461 /* Run both modes */
462 g_seq_gbuf = run_sequential(project, g_par_tmpdir, files, file_count);
463 g_par_gbuf = run_parallel(project, g_par_tmpdir, files, file_count, 2);
464
465 cbm_discover_free(files, file_count);
466 g_parity_setup_done = 1;
467 return 0;
468}
469
470static void parity_teardown(void) {
471 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