File tree 2 files changed +15
-0
lines changed
src/tools/compiletest/src
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,7 @@ impl TestProps {
321
321
pub fn from_file ( testfile : & Path , revision : Option < & str > , config : & Config ) -> Self {
322
322
let mut props = TestProps :: new ( ) ;
323
323
props. load_from ( testfile, revision, config) ;
324
+ props. exec_env . push ( ( "RUSTC" . to_string ( ) , config. rustc_path . display ( ) . to_string ( ) ) ) ;
324
325
325
326
match ( props. pass_mode , props. fail_mode ) {
326
327
( 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
+ use std:: process:: Command ;
3
+
4
+ fn main ( ) {
5
+ let signalled_version = "Ceci n'est pas une rustc" ;
6
+ let version = Command :: new ( std:: env:: var_os ( "RUSTC" ) . unwrap ( ) )
7
+ . env ( "RUSTC_FORCE_RUSTC_VERSION" , signalled_version)
8
+ . arg ( "--version" )
9
+ . output ( )
10
+ . unwrap ( )
11
+ . stdout ;
12
+ let version = std:: str:: from_utf8 ( & version) . unwrap ( ) . strip_prefix ( "rustc " ) . unwrap ( ) . trim_end ( ) ;
13
+ assert_ne ! ( version, signalled_version) ;
14
+ }
You can’t perform that action at this time.
0 commit comments