| 375 | static int g_parity_setup_done = 0; |
| 376 | |
| 377 | static 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 | |
| 406 | static void parity_teardown(void) { |
| 407 | if (g_seq_gbuf) { |
no test coverage detected