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

Function ensure_parity_setup

tests/test_parallel.c:197–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195static int g_parity_setup_done = 0;
196
197static int ensure_parity_setup(void) {
198 if (g_parity_setup_done)
199 return 0;
200
201 if (setup_parallel_repo() != 0)
202 return -1;
203
204 /* Discover files */
205 cbm_discover_opts_t opts = {.mode = CBM_MODE_FULL};
206 cbm_file_info_t *files = NULL;
207 int file_count = 0;
208 if (cbm_discover(g_par_tmpdir, &opts, &files, &file_count) != 0)
209 return -1;
210
211 const char *project = "par-test";
212
213 /* Build structure for both (need File/Folder nodes before definitions) */
214 /* For parity, we need the structure pass too. Let's just compare
215 * definition/call/usage/semantic edge counts. */
216
217 /* Run both modes */
218 g_seq_gbuf = run_sequential(project, g_par_tmpdir, files, file_count);
219 g_par_gbuf = run_parallel(project, g_par_tmpdir, files, file_count, 2);
220
221 cbm_discover_free(files, file_count);
222 g_parity_setup_done = 1;
223 return 0;
224}
225
226static void parity_teardown(void) {
227 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