@@ -125,7 +125,7 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
125125 // We're going to be dumping a lot of info. Start on a new line.
126126 print ! ( "\n \n " ) ;
127127 }
128- debug ! ( "running {:?}" , testpaths. file. display( ) ) ;
128+ eprintln ! ( "running {:?}" , testpaths. file. display( ) ) ;
129129 let mut props = TestProps :: from_file ( & testpaths. file , revision, & config) ;
130130
131131 // For non-incremental (i.e. regular UI) tests, the incremental directory
@@ -3253,13 +3253,10 @@ impl<'test> TestCx<'test> {
32533253 }
32543254
32553255 fn run_rmake_test ( & self ) {
3256- let test_dir = & self . testpaths . file ;
3257- if test_dir. join ( "rmake.rs" ) . exists ( ) {
3258- self . run_rmake_v2_test ( ) ;
3259- } else if test_dir. join ( "Makefile" ) . exists ( ) {
3260- self . run_rmake_legacy_test ( ) ;
3261- } else {
3262- self . fatal ( "failed to find either `rmake.rs` or `Makefile`" )
3256+ match & self . testpaths . file . iter ( ) . last ( ) {
3257+ Some ( s) if * s == OsStr :: new ( "rmake.rs" ) => self . run_rmake_v2_test ( ) ,
3258+ Some ( s) if * s == OsStr :: new ( "Makefile" ) => self . run_rmake_legacy_test ( ) ,
3259+ _ => self . fatal ( "failed to find either `rmake.rs` or `Makefile`" ) ,
32633260 }
32643261 }
32653262
@@ -3287,7 +3284,7 @@ impl<'test> TestCx<'test> {
32873284 } ;
32883285
32893286 let mut cmd = Command :: new ( make) ;
3290- cmd. current_dir ( & self . testpaths . file )
3287+ cmd. current_dir ( & self . testpaths . file . parent ( ) . unwrap ( ) )
32913288 . stdout ( Stdio :: piped ( ) )
32923289 . stderr ( Stdio :: piped ( ) )
32933290 . env ( "TARGET" , & self . config . target )
@@ -3487,10 +3484,11 @@ impl<'test> TestCx<'test> {
34873484 // Copy all input files (apart from rmake.rs) to the temporary directory,
34883485 // so that the input directory structure from `tests/run-make/<test>` is mirrored
34893486 // to the `rmake_out` directory.
3490- for path in walkdir:: WalkDir :: new ( & self . testpaths . file ) . min_depth ( 1 ) {
3487+ let parent = self . testpaths . file . parent ( ) . unwrap ( ) ;
3488+ for path in walkdir:: WalkDir :: new ( & parent) . min_depth ( 1 ) {
34913489 let path = path. unwrap ( ) . path ( ) . to_path_buf ( ) ;
34923490 if path. file_name ( ) . is_some_and ( |s| s != "rmake.rs" ) {
3493- let target = rmake_out_dir. join ( path. strip_prefix ( & self . testpaths . file ) . unwrap ( ) ) ;
3491+ let target = rmake_out_dir. join ( path. strip_prefix ( & parent ) . unwrap ( ) ) ;
34943492 if path. is_dir ( ) {
34953493 copy_dir_all ( & path, target) . unwrap ( ) ;
34963494 } else {
@@ -3588,7 +3586,7 @@ impl<'test> TestCx<'test> {
35883586 . arg ( "--extern" )
35893587 . arg ( format ! ( "run_make_support={}" , & support_lib_path. to_string_lossy( ) ) )
35903588 . arg ( "--edition=2021" )
3591- . arg ( & self . testpaths . file . join ( "rmake.rs" ) )
3589+ . arg ( & self . testpaths . file )
35923590 // Provide necessary library search paths for rustc.
35933591 . env ( dylib_env_var ( ) , & env:: join_paths ( host_dylib_search_paths) . unwrap ( ) ) ;
35943592
0 commit comments