From bd4493da73a1a8527be73f3c98eb6fca8cfc4353 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 18 Dec 2021 14:35:06 -0800 Subject: [PATCH] nix: Move eval.nix tests into /hive --- src/nix/hive/mod.rs | 3 +++ src/nix/{ => hive}/tests/mod.rs | 2 +- src/nix/{ => hive}/tests/simple-flake/flake.lock | 0 src/nix/{ => hive}/tests/simple-flake/flake.nix | 0 src/nix/mod.rs | 3 --- 5 files changed, 4 insertions(+), 4 deletions(-) rename src/nix/{ => hive}/tests/mod.rs (99%) rename src/nix/{ => hive}/tests/simple-flake/flake.lock (100%) rename src/nix/{ => hive}/tests/simple-flake/flake.nix (100%) diff --git a/src/nix/hive/mod.rs b/src/nix/hive/mod.rs index 7b8af23..9144c2d 100644 --- a/src/nix/hive/mod.rs +++ b/src/nix/hive/mod.rs @@ -23,6 +23,9 @@ use super::NixCommand; use crate::util::CommandExecution; use crate::job::JobHandle; +#[cfg(test)] +mod tests; + const HIVE_EVAL: &[u8] = include_bytes!("eval.nix"); #[derive(Debug)] diff --git a/src/nix/tests/mod.rs b/src/nix/hive/tests/mod.rs similarity index 99% rename from src/nix/tests/mod.rs rename to src/nix/hive/tests/mod.rs index 258a315..e4c7d62 100644 --- a/src/nix/tests/mod.rs +++ b/src/nix/hive/tests/mod.rs @@ -154,7 +154,7 @@ fn test_parse_simple() { #[test] fn test_parse_flake() { - let flake_dir = PathBuf::from("./src/nix/tests/simple-flake"); + let flake_dir = PathBuf::from("./src/nix/hive/tests/simple-flake"); let flake = block_on(Flake::from_dir(flake_dir)).unwrap(); let hive_path = HivePath::Flake(flake); diff --git a/src/nix/tests/simple-flake/flake.lock b/src/nix/hive/tests/simple-flake/flake.lock similarity index 100% rename from src/nix/tests/simple-flake/flake.lock rename to src/nix/hive/tests/simple-flake/flake.lock diff --git a/src/nix/tests/simple-flake/flake.nix b/src/nix/hive/tests/simple-flake/flake.nix similarity index 100% rename from src/nix/tests/simple-flake/flake.nix rename to src/nix/hive/tests/simple-flake/flake.nix diff --git a/src/nix/mod.rs b/src/nix/mod.rs index 6bb7fc7..0f68db6 100644 --- a/src/nix/mod.rs +++ b/src/nix/mod.rs @@ -44,9 +44,6 @@ pub use flake::Flake; pub mod node_filter; pub use node_filter::NodeFilter; -#[cfg(test)] -mod tests; - pub const SYSTEM_PROFILE: &str = "/nix/var/nix/profiles/system"; pub type NixResult = Result;