• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Compiletest meta test checking that rustc-env and unset-rustc-env directives
2 // can be used to configure environment for rustc.
3 //
4 // run-pass
5 // aux-build:env.rs
6 // rustc-env:COMPILETEST_FOO=foo
7 //
8 // An environment variable that is likely to be set, but should be safe to unset.
9 // unset-rustc-env:PWD
10 
11 extern crate env;
12 
main()13 fn main() {
14     assert_eq!(env!("COMPILETEST_FOO"), "foo");
15     assert_eq!(option_env!("COMPILETEST_BAR"), None);
16     assert_eq!(option_env!("PWD"), None);
17     env::test();
18 }
19