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
()
| 9 | // note: tempdir removes directory when being dropped, so we need to return it to the caller, |
| 10 | // so the paths are valid |
| 11 | pub 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 | |
| 19 | macro_rules! load_config { |
| 20 | ($config_path:ident, $content_fmt:expr, $cache_dir:ident) => {{ |
no test coverage detected