Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Don't write files into the source tree #37176

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/test/run-make/dep-info-spaces/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
ifneq ($(shell uname),FreeBSD)
ifndef IS_WINDOWS
all:
$(RUSTC) --emit link,dep-info --crate-type=lib lib.rs
cp lib.rs $(TMPDIR)/
cp 'foo foo.rs' $(TMPDIR)/
cp bar.rs $(TMPDIR)/
$(RUSTC) --emit link,dep-info --crate-type=lib $(TMPDIR)/lib.rs
sleep 1
touch 'foo foo.rs'
touch $(TMPDIR)/'foo foo.rs'
-rm -f $(TMPDIR)/done
$(MAKE) -drf Makefile.foo
rm $(TMPDIR)/done
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-make/dep-info-spaces/Makefile.foo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LIB := $(shell $(RUSTC) --print file-names --crate-type=lib lib.rs)
LIB := $(shell $(RUSTC) --print file-names --crate-type=lib $(TMPDIR)/lib.rs)

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

-include $(TMPDIR)/lib.d
5 changes: 4 additions & 1 deletion src/test/run-make/llvm-phase/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use rustc_driver::driver::CompileController;
use rustc_trans::ModuleSource;
use rustc::session::Session;
use syntax::codemap::FileLoader;
use std::env;
use std::io;
use std::path::{PathBuf, Path};

Expand Down Expand Up @@ -75,9 +76,11 @@ fn main() {
path.pop();
path.pop();

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

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