Skip to content

Commit 094c3a2

Browse files
committed
test: Don't write files into the source tree
Tweak a few run-make tests to emit files in the output directories, not directly in the source tree.
1 parent 40cd1fd commit 094c3a2

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/test/run-make/dep-info-spaces/Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
ifneq ($(shell uname),FreeBSD)
66
ifndef IS_WINDOWS
77
all:
8-
$(RUSTC) --emit link,dep-info --crate-type=lib lib.rs
8+
cp lib.rs $(TMPDIR)/
9+
cp 'foo foo.rs' $(TMPDIR)/
10+
cp bar.rs $(TMPDIR)/
11+
$(RUSTC) --emit link,dep-info --crate-type=lib $(TMPDIR)/lib.rs
912
sleep 1
10-
touch 'foo foo.rs'
13+
touch $(TMPDIR)/'foo foo.rs'
1114
-rm -f $(TMPDIR)/done
1215
$(MAKE) -drf Makefile.foo
1316
rm $(TMPDIR)/done
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
LIB := $(shell $(RUSTC) --print file-names --crate-type=lib lib.rs)
1+
LIB := $(shell $(RUSTC) --print file-names --crate-type=lib $(TMPDIR)/lib.rs)
22

33
$(TMPDIR)/$(LIB):
4-
$(RUSTC) --emit link,dep-info --crate-type=lib lib.rs
4+
$(RUSTC) --emit link,dep-info --crate-type=lib $(TMPDIR)/lib.rs
55
touch $(TMPDIR)/done
66

77
-include $(TMPDIR)/lib.d

src/test/run-make/llvm-phase/test.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use rustc_driver::driver::CompileController;
2222
use rustc_trans::ModuleSource;
2323
use rustc::session::Session;
2424
use syntax::codemap::FileLoader;
25+
use std::env;
2526
use std::io;
2627
use std::path::{PathBuf, Path};
2728

@@ -75,9 +76,11 @@ fn main() {
7576
path.pop();
7677
path.pop();
7778

78-
let args: Vec<String> =
79+
let mut args: Vec<String> =
7980
format!("_ _ --sysroot {} --crate-type dylib", path.to_str().unwrap())
8081
.split(' ').map(|s| s.to_string()).collect();
82+
args.push("--out-dir".to_string());
83+
args.push(env::var("TMPDIR").unwrap());
8184

8285
let (result, _) = rustc_driver::run_compiler(
8386
&args, &mut JitCalls, Some(box JitLoader), None);

0 commit comments

Comments
 (0)