diff --git a/tests/rustflags.rs b/tests/rustflags.rs new file mode 100644 index 0000000..a3ac786 --- /dev/null +++ b/tests/rustflags.rs @@ -0,0 +1,11 @@ +extern crate autocfg; + +/// Tests that autocfg uses the RUSTFLAGS environment variable when running +/// rustc. +#[test] +fn test_with_sysroot() { + std::env::set_var("RUSTFLAGS", "-L target/debug/deps"); + std::env::set_var("OUT_DIR", "target"); + let ac = autocfg::AutoCfg::new().unwrap(); + assert!(ac.probe_sysroot_crate("autocfg")); +} \ No newline at end of file