| 21 | char *cross; |
| 22 | } settings_fixture_t; |
| 23 | static bool fixture_open(settings_fixture_t *fixture) { |
| 24 | memset(fixture, 0, sizeof(*fixture)); |
| 25 | snprintf(fixture->path, sizeof(fixture->path), "%s/cbm-settings-XXXXXX", cbm_tmpdir()); |
| 26 | if (!cbm_mkdtemp(fixture->path)) |
| 27 | return false; |
| 28 | fixture->cache = getenv("CBM_CACHE_DIR") ? strdup(getenv("CBM_CACHE_DIR")) : NULL; |
| 29 | fixture->workers = getenv("CBM_WORKERS") ? strdup(getenv("CBM_WORKERS")) : NULL; |
| 30 | fixture->cross = |
| 31 | getenv("CBM_DISABLE_LSP_CROSS") ? strdup(getenv("CBM_DISABLE_LSP_CROSS")) : NULL; |
| 32 | return cbm_setenv("CBM_CACHE_DIR", fixture->path, 1) == 0; |
| 33 | } |
| 34 | static void restore_env(const char *key, char *value) { |
| 35 | if (value) |
| 36 | cbm_setenv(key, value, 1); |
no test coverage detected