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

Function openhands_fixture_open

tests/test_cli.c:5515–5541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5513} openhands_fixture_t;
5514
5515static bool openhands_fixture_open(openhands_fixture_t *fx, bool with_profiles) {
5516 snprintf(fx->home, sizeof(fx->home), "/tmp/cli-openhands-XXXXXX");
5517 if (!cbm_mkdtemp(fx->home)) {
5518 return false;
5519 }
5520 snprintf(fx->settings, sizeof(fx->settings), "%s/.openhands/settings.json", fx->home);
5521#ifdef _WIN32
5522 snprintf(fx->binary, sizeof(fx->binary), "%s/.local/bin/codebase-memory-mcp.exe", fx->home);
5523#else
5524 snprintf(fx->binary, sizeof(fx->binary), "%s/.local/bin/codebase-memory-mcp", fx->home);
5525#endif
5526 snprintf(fx->mcp, sizeof(fx->mcp), "%s/.openhands/mcp.json", fx->home);
5527 snprintf(fx->profiles_dir, sizeof(fx->profiles_dir), "%s/.openhands/agent-profiles", fx->home);
5528 snprintf(fx->default_profile, sizeof(fx->default_profile), "%s/default.json", fx->profiles_dir);
5529 snprintf(fx->custom_profile, sizeof(fx->custom_profile), "%s/custom.json", fx->profiles_dir);
5530 snprintf(fx->note, sizeof(fx->note), "%s/README.txt", fx->profiles_dir);
5531 char openhands_dir[512];
5532 snprintf(openhands_dir, sizeof(openhands_dir), "%s/.openhands", fx->home);
5533 test_mkdirp(with_profiles ? fx->profiles_dir : openhands_dir);
5534 fx->saved_home = save_test_env("HOME");
5535 fx->saved_path = save_test_env("PATH");
5536 fx->saved_cache = save_test_env("CBM_CACHE_DIR");
5537 cbm_setenv("HOME", fx->home, 1);
5538 cbm_setenv("PATH", fx->home, 1);
5539 cbm_unsetenv("CBM_CACHE_DIR");
5540 return true;
5541}
5542
5543static void openhands_fixture_close(openhands_fixture_t *fx) {
5544 restore_test_env("HOME", fx->saved_home);

Callers 1

test_cli.cFile · 0.85

Calls 5

cbm_mkdtempFunction · 0.85
test_mkdirpFunction · 0.85
save_test_envFunction · 0.85
cbm_setenvFunction · 0.85
cbm_unsetenvFunction · 0.85

Tested by

no test coverage detected