File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Check that aux builds can also use rustc-env, but environment is configured
2
+ // separately from the main test case.
3
+ //
4
+ // rustc-env:COMPILETEST_BAR=bar
5
+
6
+ pub fn test ( ) {
7
+ assert_eq ! ( option_env!( "COMPILETEST_FOO" ) , None ) ;
8
+ assert_eq ! ( env!( "COMPILETEST_BAR" ) , "bar" ) ;
9
+ }
Original file line number Diff line number Diff line change
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
+
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
+ }
You can’t perform that action at this time.
0 commit comments