@@ -125,7 +125,7 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
125
125
// We're going to be dumping a lot of info. Start on a new line.
126
126
print ! ( "\n \n " ) ;
127
127
}
128
- debug ! ( "running {:?}" , testpaths. file. display( ) ) ;
128
+ eprintln ! ( "running {:?}" , testpaths. file. display( ) ) ;
129
129
let mut props = TestProps :: from_file ( & testpaths. file , revision, & config) ;
130
130
131
131
// For non-incremental (i.e. regular UI) tests, the incremental directory
@@ -3253,13 +3253,10 @@ impl<'test> TestCx<'test> {
3253
3253
}
3254
3254
3255
3255
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`" ) ,
3263
3260
}
3264
3261
}
3265
3262
@@ -3287,7 +3284,7 @@ impl<'test> TestCx<'test> {
3287
3284
} ;
3288
3285
3289
3286
let mut cmd = Command :: new ( make) ;
3290
- cmd. current_dir ( & self . testpaths . file )
3287
+ cmd. current_dir ( & self . testpaths . file . parent ( ) . unwrap ( ) )
3291
3288
. stdout ( Stdio :: piped ( ) )
3292
3289
. stderr ( Stdio :: piped ( ) )
3293
3290
. env ( "TARGET" , & self . config . target )
@@ -3487,10 +3484,11 @@ impl<'test> TestCx<'test> {
3487
3484
// Copy all input files (apart from rmake.rs) to the temporary directory,
3488
3485
// so that the input directory structure from `tests/run-make/<test>` is mirrored
3489
3486
// 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 ) {
3491
3489
let path = path. unwrap ( ) . path ( ) . to_path_buf ( ) ;
3492
3490
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 ( ) ) ;
3494
3492
if path. is_dir ( ) {
3495
3493
copy_dir_all ( & path, target) . unwrap ( ) ;
3496
3494
} else {
@@ -3588,7 +3586,7 @@ impl<'test> TestCx<'test> {
3588
3586
. arg ( "--extern" )
3589
3587
. arg ( format ! ( "run_make_support={}" , & support_lib_path. to_string_lossy( ) ) )
3590
3588
. arg ( "--edition=2021" )
3591
- . arg ( & self . testpaths . file . join ( "rmake.rs" ) )
3589
+ . arg ( & self . testpaths . file )
3592
3590
// Provide necessary library search paths for rustc.
3593
3591
. env ( dylib_env_var ( ) , & env:: join_paths ( host_dylib_search_paths) . unwrap ( ) ) ;
3594
3592
0 commit comments