| 195 | static int g_parity_setup_done = 0; |
| 196 | |
| 197 | static 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 | |
| 226 | static void parity_teardown(void) { |
| 227 | if (g_seq_gbuf) { |
no test coverage detected