Run index_repository through the production MCP flow, capturing the log. */
| 66 | |
| 67 | /* Run index_repository through the production MCP flow, capturing the log. */ |
| 68 | static char *index_capture(RProj *lp) { |
| 69 | char args[700]; |
| 70 | snprintf(args, sizeof(args), "{\"repo_path\":\"%s\"}", lp->tmpdir); |
| 71 | char *prior = getenv("CBM_CACHE_DIR"); |
| 72 | char *saved = prior ? strdup(prior) : NULL; |
| 73 | cbm_setenv("CBM_CACHE_DIR", lp->cachedir, 1); |
| 74 | capture_reset(); |
| 75 | cbm_log_set_sink_ex(capture_sink, CBM_LOG_SINK_TEE); |
| 76 | char *resp = cbm_mcp_handle_tool(lp->srv, "index_repository", args); |
| 77 | cbm_log_set_sink(NULL); |
| 78 | if (saved) { |
| 79 | cbm_setenv("CBM_CACHE_DIR", saved, 1); |
| 80 | free(saved); |
| 81 | } else { |
| 82 | cbm_unsetenv("CBM_CACHE_DIR"); |
| 83 | } |
| 84 | return resp; |
| 85 | } |
| 86 | /* ── Test 1: one File node per file, and every file reaches search ──── */ |
| 87 | |
| 88 | TEST(index_format_siblings_distinct_and_searchable) { |
no test coverage detected