Files
OpenShell/crates/openshell-cli/src/test_utils.rs
T
Drew Newberry eeba0e7954 refactor(runtime): confine and reduce unsafe code (#4130)
* refactor(runtime): confine and reduce unsafe code

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(ci): make signal probe portable and gate Linux initialization

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(cli): handle platform-specific SSH cancellation lints

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

---------

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
2026-10-10 01:12:03 +00:00

20 lines
622 B
Rust

// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
use std::path::{Path, PathBuf};
#[path = "../../../tests/support/environment.rs"]
mod environment;
pub use environment::Environment;
pub fn with_tmp_xdg(tmp: &Path, f: impl FnOnce(&Path)) {
with_tmp_xdg_env(tmp, Environment::new(), f);
}
pub fn with_tmp_xdg_env(tmp: &Path, env: Environment, f: impl FnOnce(&Path)) {
env.set("XDG_CONFIG_HOME", tmp).run(|| {
let root = PathBuf::from(std::env::var_os("XDG_CONFIG_HOME").unwrap());
f(&root);
});
}