diff --git a/tests/tests.rs b/tests/tests.rs index ea1b30a..b41973f 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -35,6 +35,15 @@ fn rustc_flags(dependency_path: &str, dependencies: &[&str]) -> String { flags } +fn dependency_path() -> String { + std::env::var("LD_LIBRARY_PATH") + .expect("LD_LIBRARY_PATH not defined") + .split(':') + .find(|path| path.ends_with("/deps")) + .expect("could not find dependency path") + .to_owned() +} + #[test] fn compile_tests() { use compiletest::common::Mode; @@ -48,7 +57,7 @@ fn compile_tests() { let dependencies = ["archery", "static_assertions"]; - config.target_rustcflags = Some(rustc_flags("target/debug/deps/", &dependencies)); + config.target_rustcflags = Some(rustc_flags(&dependency_path(), &dependencies)); compiletest::run_tests(&config); }