| 4631 | } openhands_fixture_t; |
| 4632 | |
| 4633 | static bool openhands_fixture_open(openhands_fixture_t *fx, bool with_profiles) { |
| 4634 | snprintf(fx->home, sizeof(fx->home), "/tmp/cli-openhands-XXXXXX"); |
| 4635 | if (!cbm_mkdtemp(fx->home)) { |
| 4636 | return false; |
| 4637 | } |
| 4638 | snprintf(fx->settings, sizeof(fx->settings), "%s/.openhands/settings.json", fx->home); |
| 4639 | #ifdef _WIN32 |
| 4640 | snprintf(fx->binary, sizeof(fx->binary), "%s/.local/bin/codebase-memory-mcp.exe", fx->home); |
| 4641 | #else |
| 4642 | snprintf(fx->binary, sizeof(fx->binary), "%s/.local/bin/codebase-memory-mcp", fx->home); |
| 4643 | #endif |
| 4644 | snprintf(fx->mcp, sizeof(fx->mcp), "%s/.openhands/mcp.json", fx->home); |
| 4645 | snprintf(fx->profiles_dir, sizeof(fx->profiles_dir), "%s/.openhands/agent-profiles", fx->home); |
| 4646 | snprintf(fx->default_profile, sizeof(fx->default_profile), "%s/default.json", fx->profiles_dir); |
| 4647 | snprintf(fx->custom_profile, sizeof(fx->custom_profile), "%s/custom.json", fx->profiles_dir); |
| 4648 | snprintf(fx->note, sizeof(fx->note), "%s/README.txt", fx->profiles_dir); |
| 4649 | char openhands_dir[512]; |
| 4650 | snprintf(openhands_dir, sizeof(openhands_dir), "%s/.openhands", fx->home); |
| 4651 | test_mkdirp(with_profiles ? fx->profiles_dir : openhands_dir); |
| 4652 | fx->saved_home = save_test_env("HOME"); |
| 4653 | fx->saved_path = save_test_env("PATH"); |
| 4654 | fx->saved_cache = save_test_env("CBM_CACHE_DIR"); |
| 4655 | cbm_setenv("HOME", fx->home, 1); |
| 4656 | cbm_setenv("PATH", fx->home, 1); |
| 4657 | cbm_unsetenv("CBM_CACHE_DIR"); |
| 4658 | return true; |
| 4659 | } |
| 4660 | |
| 4661 | static void openhands_fixture_close(openhands_fixture_t *fx) { |
| 4662 | restore_test_env("HOME", fx->saved_home); |
no test coverage detected