@@ -3,7 +3,15 @@ extern crate compiletest_rs as compiletest;
3
3
use std:: path:: { PathBuf , Path } ;
4
4
use std:: io:: Write ;
5
5
6
+ macro_rules! eprintln {
7
+ ( $( $arg: tt) * ) => {
8
+ let stderr = std:: io:: stderr( ) ;
9
+ writeln!( stderr. lock( ) , $( $arg) * ) . unwrap( ) ;
10
+ }
11
+ }
12
+
6
13
fn compile_fail ( sysroot : & Path , path : & str , target : & str , host : & str , fullmir : bool ) {
14
+ eprintln ! ( "## Running compile-fail tests in {} against miri for target {}" , path, target) ;
7
15
let mut config = compiletest:: default_config ( ) ;
8
16
config. mode = "compile-fail" . parse ( ) . expect ( "Invalid mode" ) ;
9
17
config. rustc_path = "target/debug/miri" . into ( ) ;
@@ -23,16 +31,18 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b
23
31
compiletest:: run_tests ( & config) ;
24
32
}
25
33
26
- fn run_pass ( ) {
34
+ fn run_pass ( path : & str ) {
35
+ eprintln ! ( "## Running run-pass tests in {} against rustc" , path) ;
27
36
let mut config = compiletest:: default_config ( ) ;
28
37
config. mode = "run-pass" . parse ( ) . expect ( "Invalid mode" ) ;
29
- config. src_base = PathBuf :: from ( "tests/run-pass" . to_string ( ) ) ;
38
+ config. src_base = PathBuf :: from ( path ) ;
30
39
config. target_rustcflags = Some ( "-Dwarnings" . to_string ( ) ) ;
31
40
config. host_rustcflags = Some ( "-Dwarnings" . to_string ( ) ) ;
32
41
compiletest:: run_tests ( & config) ;
33
42
}
34
43
35
44
fn miri_pass ( path : & str , target : & str , host : & str , fullmir : bool ) {
45
+ eprintln ! ( "## Running run-pass tests in {} against miri for target {}" , path, target) ;
36
46
let mut config = compiletest:: default_config ( ) ;
37
47
config. mode = "mir-opt" . parse ( ) . expect ( "Invalid mode" ) ;
38
48
config. src_base = PathBuf :: from ( path) ;
@@ -65,13 +75,10 @@ fn is_target_dir<P: Into<PathBuf>>(path: P) -> bool {
65
75
66
76
fn for_all_targets < F : FnMut ( String ) > ( sysroot : & Path , mut f : F ) {
67
77
let target_dir = sysroot. join ( "lib" ) . join ( "rustlib" ) ;
68
- println ! ( "target dir: {}" , target_dir. to_str( ) . unwrap( ) ) ;
69
78
for entry in std:: fs:: read_dir ( target_dir) . expect ( "invalid sysroot" ) {
70
79
let entry = entry. unwrap ( ) ;
71
80
if !is_target_dir ( entry. path ( ) ) { continue ; }
72
81
let target = entry. file_name ( ) . into_string ( ) . unwrap ( ) ;
73
- let stderr = std:: io:: stderr ( ) ;
74
- writeln ! ( stderr. lock( ) , "running tests for target {}" , target) . unwrap ( ) ;
75
82
f ( target) ;
76
83
}
77
84
}
@@ -209,7 +216,8 @@ fn compile_test() {
209
216
210
217
panic ! ( "ran miri on rustc test suite. Test failing for convenience" ) ;
211
218
} else {
212
- run_pass ( ) ;
219
+ run_pass ( "tests/run-pass" ) ;
220
+ run_pass ( "tests/run-pass-fullmir" ) ;
213
221
for_all_targets ( sysroot, |target| {
214
222
miri_pass ( "tests/run-pass" , & target, host, false ) ;
215
223
compile_fail ( sysroot, "tests/compile-fail" , & target, host, false ) ;
0 commit comments