MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / test_prolog

Function test_prolog

crates/cache/src/config/tests.rs:11–17  ·  view source on GitHub ↗

note: config loading during validation creates cache directory to canonicalize its path, that's why these function and macro always use custom cache directory note: tempdir removes directory when being dropped, so we need to return it to the caller, so the paths are valid

()

Source from the content-addressed store, hash-verified

9// note: tempdir removes directory when being dropped, so we need to return it to the caller,
10// so the paths are valid
11pub fn test_prolog() -> (TempDir, PathBuf, PathBuf) {
12 let _ = env_logger::try_init();
13 let temp_dir = tempfile::tempdir().expect("Can't create temporary directory");
14 let cache_dir = temp_dir.path().join("cache-dir");
15 let config_path = temp_dir.path().join("cache-config.toml");
16 (temp_dir, cache_dir, config_path)
17}
18
19macro_rules! load_config {
20 ($config_path:ident, $content_fmt:expr, $cache_dir:ident) => {{

Calls 3

expectMethod · 0.45
joinMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected