From 7e88281238ed3357d091dc6e9f4a317095fb313a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ci=C4=99=C5=BCarkiewicz?= Date: Fri, 13 Mar 2026 10:00:15 -0700 Subject: [PATCH] fix: locating binary path Fix https://github.com/dpc/fs-dir-cache/issues/4 --- Cargo.toml | 1 + src/main.rs | 3 --- src/test.rs => tests/sanity.rs | 9 ++++----- 3 files changed, 5 insertions(+), 8 deletions(-) rename src/test.rs => tests/sanity.rs (92%) diff --git a/Cargo.toml b/Cargo.toml index d85422f..29e76d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,5 +38,6 @@ tracing = "0.1.37" tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } [dev-dependencies] +anyhow = "1.0.75" assert_cmd = "2.0.16" tempfile = "3.13.0" diff --git a/src/main.rs b/src/main.rs index 9f2cb10..54316c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -317,6 +317,3 @@ fn init_logging() { tracing::subscriber::set_global_default(subscriber).expect("Failed to set tracing subscriber"); } - -#[cfg(test)] -mod test; diff --git a/src/test.rs b/tests/sanity.rs similarity index 92% rename from src/test.rs rename to tests/sanity.rs index 402ff36..65f63fd 100644 --- a/src/test.rs +++ b/tests/sanity.rs @@ -5,17 +5,16 @@ use std::str::FromStr; use std::time::Duration; use std::{ffi, fs, thread}; -use anyhow::Result; use assert_cmd::assert::OutputAssertExt as _; use assert_cmd::cargo; #[test] -fn sanity_check() -> Result<()> { +fn sanity_check() -> anyhow::Result<()> { let root_dir = tempfile::tempdir()?; - thread::scope(|s| -> Result<()> { + thread::scope(|s| -> anyhow::Result<()> { for _ in 0..10 { - s.spawn(|| -> Result<()> { + s.spawn(|| -> anyhow::Result<()> { let mut cmd = our_bin_cmd(); cmd.env("FS_DIR_CACHE_ROOT", root_dir.path()); @@ -56,7 +55,7 @@ fn sanity_check() -> Result<()> { Ok(()) }); - s.spawn(|| -> Result<()> { + s.spawn(|| -> anyhow::Result<()> { let mut cmd = our_bin_cmd(); cmd.stderr(Stdio::inherit());