File tree 2 files changed +18
-0
lines changed
src/tools/compiletest/src
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,7 @@ impl TestProps {
330
330
pub fn from_file ( testfile : & Path , revision : Option < & str > , config : & Config ) -> Self {
331
331
let mut props = TestProps :: new ( ) ;
332
332
props. load_from ( testfile, revision, config) ;
333
+ props. exec_env . push ( ( "RUSTC" . to_string ( ) , config. rustc_path . display ( ) . to_string ( ) ) ) ;
333
334
334
335
match ( props. pass_mode , props. fail_mode ) {
335
336
( None , None ) if config. mode == Mode :: Ui => props. fail_mode = Some ( FailMode :: Check ) ,
Original file line number Diff line number Diff line change
1
+ //@ run-pass
2
+ //@ only-linux
3
+ //@ only-x86
4
+ // FIXME: this should be more like //@ needs-subprocesses
5
+ use std:: process:: Command ;
6
+
7
+ fn main ( ) {
8
+ let signalled_version = "Ceci n'est pas une rustc" ;
9
+ let version = Command :: new ( std:: env:: var_os ( "RUSTC" ) . unwrap ( ) )
10
+ . env ( "RUSTC_OVERRIDE_VERSION_STRING" , signalled_version)
11
+ . arg ( "--version" )
12
+ . output ( )
13
+ . unwrap ( )
14
+ . stdout ;
15
+ let version = std:: str:: from_utf8 ( & version) . unwrap ( ) . strip_prefix ( "rustc " ) . unwrap ( ) . trim_end ( ) ;
16
+ assert_ne ! ( version, signalled_version) ;
17
+ }
You can’t perform that action at this time.
0 commit comments