1
1
#![ feature( slice_concat_ext) ]
2
2
3
3
extern crate compiletest_rs as compiletest;
4
- extern crate tempdir;
5
4
6
5
use std:: slice:: SliceConcatExt ;
7
6
use std:: path:: { PathBuf , Path } ;
8
7
use std:: io:: Write ;
9
- use tempdir:: TempDir ;
10
8
11
9
macro_rules! eprintln {
12
10
( $( $arg: tt) * ) => {
@@ -37,10 +35,8 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b
37
35
path,
38
36
target
39
37
) ;
40
- let build_dir = TempDir :: new ( "miri-tests" ) . unwrap ( ) ;
41
- let mut config = compiletest:: Config :: default ( ) ;
38
+ let mut config = compiletest:: Config :: default ( ) . tempdir ( ) ;
42
39
config. mode = "compile-fail" . parse ( ) . expect ( "Invalid mode" ) ;
43
- config. build_base = build_dir. path ( ) . to_owned ( ) ;
44
40
config. rustc_path = miri_path ( ) ;
45
41
let mut flags = Vec :: new ( ) ;
46
42
if rustc_test_suite ( ) . is_some ( ) {
@@ -70,10 +66,8 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b
70
66
71
67
fn run_pass ( path : & str ) {
72
68
eprintln ! ( "## Running run-pass tests in {} against rustc" , path) ;
73
- let build_dir = TempDir :: new ( "miri-tests" ) . unwrap ( ) ;
74
- let mut config = compiletest:: Config :: default ( ) ;
69
+ let mut config = compiletest:: Config :: default ( ) . tempdir ( ) ;
75
70
config. mode = "run-pass" . parse ( ) . expect ( "Invalid mode" ) ;
76
- config. build_base = build_dir. path ( ) . to_owned ( ) ;
77
71
config. src_base = PathBuf :: from ( path) ;
78
72
if let Some ( rustc_path) = rustc_test_suite ( ) {
79
73
config. rustc_path = rustc_path;
@@ -95,10 +89,8 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) {
95
89
target,
96
90
opt_str
97
91
) ;
98
- let build_dir = TempDir :: new ( "miri-tests" ) . unwrap ( ) ;
99
- let mut config = compiletest:: Config :: default ( ) ;
92
+ let mut config = compiletest:: Config :: default ( ) . tempdir ( ) ;
100
93
config. mode = "mir-opt" . parse ( ) . expect ( "Invalid mode" ) ;
101
- config. build_base = build_dir. path ( ) . to_owned ( ) ;
102
94
config. src_base = PathBuf :: from ( path) ;
103
95
config. target = target. to_owned ( ) ;
104
96
config. host = host. to_owned ( ) ;
0 commit comments